From d2b2746f8b740dc22ccc314630097ced2f0c1b9f Mon Sep 17 00:00:00 2001 From: pextech Date: Tue, 7 Dec 2021 11:00:23 +0200 Subject: [PATCH] added ESLINT --- .eslintrc.js | 26 + MoralisDappProvider/MoralisDappProvider.js | 20 +- MoralisDappProvider/context.js | 2 +- SliderOne.js | 148 +- components/$-minority-earned/Action.js | 44 +- components/$-minority-earned/Binary.js | 12 +- .../$-minority-earned/MinorityEarned.js | 25 +- .../MinorityEarnedActions.js | 227 ++- .../$-minority-earned/MinorityEarnedHeader.js | 12 +- components/$-minority-earned/NoData.js | 10 +- components/$-minority-earned/Pagination.js | 26 +- components/$-minority-earned/ProposalBox.js | 56 +- components/404.js | 15 +- components/AboutOne.js | 166 +- components/AboutTwo.js | 168 +- components/Account.jsx | 71 +- components/Address/Address.jsx | 113 +- components/AllyCard.js | 6 +- components/ApprovedProposals.js | 30 +- components/AvatarMaker.js | 22 +- components/BecomeTeacher.js | 132 +- components/BlackBanner.js | 10 +- components/Blockie.jsx | 6 +- components/BlogThree.js | 327 ++-- components/BlogTwo.js | 505 +++--- components/BrandCard.js | 6 +- components/BrandsOne.js | 28 +- components/BrandsTwo.js | 28 +- components/CallToActionFive.js | 118 +- components/CallToActionFour.js | 66 +- components/CallToActionOne.js | 48 +- components/CallToActionSix.js | 119 +- components/CallToActionThree.js | 112 +- components/CallToActionTwo.js | 110 +- components/Career.js | 7 +- components/Chapter.js | 10 +- .../ChapterDirectory.component.jsx | 42 +- .../ChapterMenu/ChapterMenu.component.jsx | 7 +- components/ChatMessage.js | 12 +- components/ChatUserCard.js | 41 +- components/ChatUserSearch.js | 160 +- components/Chats.js | 591 ++++--- components/CodeCamp.js | 16 +- components/ComingSoon.js | 58 +- components/Consultancy.js | 7 +- .../Consultancy/ConsultancyDashboard.js | 79 +- components/Consultancy/ConsultancyHero.js | 46 +- .../Consultancy/ConsultancyHomeExplainer.js | 392 +++-- components/Consultancy/consultancyHome.js | 85 +- .../Consultancy/helperFiles/addQuestion.js | 10 +- .../Consultancy/helperFiles/blurBackground.js | 8 +- components/Consultancy/helperFiles/buttons.js | 8 +- .../helperFiles/customInputTags/checkbox.js | 65 +- .../helperFiles/customInputTags/input.js | 30 +- .../customInputTags/inputWithIcon.js | 18 +- .../helperFiles/customInputTags/select.js | 151 +- .../helperFiles/customInputTags/tagInput.js | 77 +- .../Consultancy/helperFiles/errorPrint.js | 30 +- .../helperFiles/getDefaultValue.js | 6 +- .../helperFiles/getFormattedOutput.js | 6 +- .../helperFiles/keepingUpWithStep.js | 39 +- .../Consultancy/helperFiles/login-page.js | 20 +- .../Consultancy/helperFiles/needHelp.js | 4 +- .../Consultancy/helperFiles/overlayCard.js | 4 +- .../helperFiles/questionContainer.js | 16 +- components/Consultancy/helperFiles/temp.js | 21 +- .../helperFiles/templates/selectTemplate.js | 65 +- components/Consultancy/steps/step1.js | 4 +- components/Consultancy/steps/step10.js | 571 +++--- components/Consultancy/steps/step11.js | 72 +- components/Consultancy/steps/step2.js | 28 +- components/Consultancy/steps/step3.js | 58 +- components/Consultancy/steps/step4.js | 20 +- components/Consultancy/steps/step5.js | 83 +- components/Consultancy/steps/step6.js | 104 +- components/Consultancy/steps/step7.js | 24 +- components/Consultancy/steps/step8.js | 22 +- components/Consultancy/steps/step9.js | 34 +- .../Consultancy/wireframes/wireframe1.js | 75 +- components/Contact.js | 198 ++- components/Conversation.js | 46 +- components/CourseCatOne.js | 370 ++-- components/CourseCatThree.js | 150 +- components/CourseCatTwo.js | 394 ++--- components/CourseCount.js | 16 +- components/CourseDetails.js | 1031 +++++------ components/CourseOne.js | 262 +-- components/CourseThree.js | 1031 +++++------ components/CourseTwo.js | 960 +++++----- components/Courses.js | 592 ++++--- components/CreateEvent.js | 336 ++-- components/CreateProfile/CreateProfile.js | 345 ++-- components/CreateProfile/CreateProfileBody.js | 173 +- components/CreateProfile/CreateProfileDone.js | 116 +- components/CreateProfile/CreateProfileForm.js | 16 +- .../CreateProfile/CreateProfileForm1.js | 364 ++-- .../CreateProfile/CreateProfileForm2.js | 177 +- .../CreateProfile/CreateProfileForm3.js | 161 +- .../CreateProfile/CreateProfileForm4.js | 290 ++- .../CreateProfile/CreateProfileForm5.js | 368 ++-- .../CreateProfile/CreateProfileInput.js | 255 +-- .../CreateProfile/CreateProfileReducer.js | 8 +- .../CreateProfile/CreateProfileSidebar.js | 145 +- .../CreateProfile/CreateProfileSkills.js | 31 +- components/CreateProfileSidebar.js | 14 +- components/CreateTask.js | 40 +- components/CreateTaskFooter.js | 4 +- components/DashNav.js | 24 +- components/DashboardInputs.js | 8 +- components/DiversityTraining.js | 13 +- components/DonateAmount.js | 242 ++- components/DonateCompleted.js | 150 +- components/DonateDetails.js | 90 +- components/DonatePayment.js | 295 ++-- components/DonateStripeForm.js | 286 ++- components/DonateStripeModal.js | 165 +- components/Educational.js | 13 +- components/Entrepreneur.js | 6 +- components/Events/Event.js | 1075 ++++++------ components/Events/EventCard.js | 272 +-- components/Events/EventCardFeatured.js | 273 +-- .../Events/EventCardFeaturedSkeleton.js | 12 +- components/Events/EventCardSkeleton.js | 13 +- .../Events/EventCategoryFilterButton.js | 21 +- components/Events/EventMoreInfo.js | 441 ++--- components/Faq.js | 218 +-- components/Faucet/FaucetForm.js | 154 +- components/FeatureForm.js | 52 +- components/FeaturedAdvice.js | 64 +- components/FeaturedCard.js | 334 ++-- components/FeaturedCardSkeleton.js | 8 +- components/FeaturedInfoCard.js | 98 +- components/FeaturedMyCard.js | 125 +- components/FeaturedMyCardSkeleton.js | 4 +- components/FeaturedMyStartup.js | 206 +-- components/FeaturedMyStartupSkeleton.js | 50 +- components/FeaturedPopup.js | 52 +- components/FeaturedStartups.js | 190 +- components/FeaturedStartupsSkeleton.js | 50 +- components/FeaturedUpcoming.js | 198 ++- components/FeaturedUpcomingSkeleton.js | 112 +- components/Footer.js | 338 ++-- components/FundedStartup.js | 4 +- components/HomeBanner.js | 14 +- components/HomePageNewTopSection.js | 48 +- components/HomepageAbout.js | 286 ++- components/HomepageApp.js | 304 ++-- components/HomepageBuyMinority.js | 16 +- components/HomepageCore.js | 554 +++--- components/HomepageDonate.js | 447 +++-- components/HomepageMemberModal.js | 140 +- components/HomepageNav.js | 1552 +++++++++-------- components/HomepageNavDropdown.js | 60 +- components/HomepageNavLoggedin.js | 158 +- components/HomepageNavLogin.js | 456 +++-- components/HomepageTeam.js | 496 +++--- components/HomepageTeamCard.js | 36 +- components/HomepageTestimonials.js | 528 +++--- components/HomepageWave.js | 156 +- components/IncubatorHero.js | 69 +- components/InterestForm/FormValidations.js | 114 +- .../InterestForm/InterestForm.component.jsx | 548 +++--- components/Internship/ApplyForm.js | 144 +- components/Internship/Internship.js | 44 +- components/Internship/InternshipHero.js | 46 +- components/Internship/InternshipHome.js | 611 ++++--- components/Internship/InternshipModal.js | 215 +-- components/Internship/Testimonial.js | 358 ++-- components/JoinForm.js | 94 +- components/Layout.js | 96 +- components/LeadsForm.js | 510 +++--- components/Loader.js | 12 +- components/LoginPopup.js | 70 +- components/MPU.js | 74 +- components/MapJoin.js | 36 +- components/MeetTeam.js | 154 +- components/MeetingOne.js | 100 +- components/MembersWorldwide.js | 20 +- components/Mentorship.js | 65 +- components/MentorshipAppSideBar.js | 32 +- components/MentorshipAppSideBarChat.js | 68 +- components/MentorshipAppSideBarNavigation.js | 328 ++-- components/MentorshipAppSwipeCards.js | 260 ++- components/MentorshipProgramHero.js | 46 +- components/MentorshipProgramHome.js | 49 +- components/MentorshipQuestion1.js | 318 ++-- components/MentorshipQuestion2.js | 136 +- components/MentorshipQuestion3.js | 341 ++-- components/MentorshipQuestion4.js | 373 ++-- components/MentorshipQuestion5.js | 105 +- components/MentorshipQuestion6.js | 458 ++--- components/MentorshipRegister.js | 390 +++-- components/Mission.js | 90 +- .../ElectProposals/ElectProposals.js | 328 ++-- .../Moderator/ElectProposals/Pagination.js | 28 +- .../Moderator/ElectProposals/Proposal.js | 200 ++- .../Moderator/ElectProposals/TenPercentile.js | 260 ++- components/Moderator/Proposal.js | 304 ++-- .../ProposalNotification/ApprovedRejected.js | 325 ++-- .../ProposalNotification/PaginationData.js | 260 ++- .../ProposalNotification/Proposal.js | 318 ++-- .../ProposalNotification.js | 56 +- components/Moderator/TaskStatus.js | 14 +- components/Moderator/TaskStatusDragNdrop.js | 30 +- components/Moderator/myElectedProposal.js | 306 ++-- components/NativeBalance.jsx | 16 +- components/NavOne.js | 73 +- components/NavThree.js | 285 +-- components/NavTwo.js | 285 +-- components/News.js | 460 +++-- components/NewsDetails.js | 521 +++--- components/Notifications.js | 49 +- components/OnMedia.js | 119 +- components/Onboarding.js | 114 +- components/PageHeader.js | 36 +- components/Partner.js | 65 +- components/PastEvents.js | 123 +- components/PlannedTaskStatus.js | 31 +- components/PlannedTaskStatusHeader.js | 37 +- components/Pricing.js | 147 +- components/PrincipleDiversity.js | 108 +- components/PrincipleSoftware.js | 104 +- components/Principles.js | 78 +- components/PrinciplesCard.js | 31 +- components/Profile.js | 55 +- components/ProfileTwo.js | 432 +++-- components/ProfileTwoGenerateAvatarPopUp.js | 136 +- components/Program.js | 24 +- components/ProjectManager/TaskNotification.js | 28 +- .../ProjectManager/TaskNotificationHeader.js | 9 +- components/ProjectManager/TaskStatus.js | 37 +- components/ProposalDetailsHeader.js | 9 +- components/ProposalHeader.js | 2 +- components/RegisterIcon.js | 13 +- components/ReviewTask.js | 45 +- components/Service.js | 286 ++- components/Services.js | 4 +- components/ServicesCard.js | 6 +- components/ServicesTiles.js | 58 +- components/Sidebar.js | 90 +- components/SidebarList.js | 34 +- components/SidebarNav.js | 84 +- components/SidebarTwo.js | 55 +- components/SliderThree.js | 118 +- components/SliderTwo.js | 168 +- components/StartupLeftBar.js | 276 +-- components/StartupMainBar.js | 38 +- components/StartupRightBar.js | 607 +++---- components/StartupRoadmap.js | 178 +- components/StartupTopBar.js | 130 +- components/SubscribeOne.js | 76 +- components/Teachers.js | 520 +++--- components/TeachersDetails.js | 217 +-- components/TeamCard.js | 6 +- components/TeamOne.js | 282 +-- components/TeamTab.js | 430 ++--- components/Testimonial.js | 191 +- components/TestimonialOne.js | 442 ++--- components/Testimonials.js | 44 +- components/TestimonialsCard.js | 4 +- components/TextField.js | 6 +- components/Topbar.js | 54 +- components/UnderBannerBody.js | 8 +- components/UpcomingEvents.js | 70 +- components/UpdateProfile.js | 437 ++--- components/UpdateProfileTwo.js | 178 +- components/UseDetectOutsideClick.js | 50 +- components/UserDropDown.js | 31 +- components/VideoOne.js | 122 +- components/VideoThree.js | 138 +- components/VideoTwo.js | 114 +- components/ViewTask.js | 130 +- components/ViewTaskHeader.js | 2 +- components/career-components/Applied.js | 186 +- components/career-components/ApplyModal.js | 135 +- .../career-components/CareerExplainer.js | 73 +- .../career-components/CareersMainComponent.js | 24 +- .../CompanyLoadingSkeleton.js | 42 +- .../career-components/CurrentJobSkeleton.js | 18 +- components/career-components/JobCreation.js | 348 ++-- .../career-components/JobStubSkeleton.js | 10 +- components/career-components/JobsFilters.js | 168 +- .../career-components/LoadingSkeleton.js | 32 +- .../QuickApplyJobApplication.js | 164 +- components/career-components/Saved.js | 101 +- .../SavedOrAppliedJobsSkeleton.js | 8 +- .../careerExplainerHelper/category.js | 11 +- .../chapter-document/document.component.jsx | 24 +- .../chapter-dropdown/dropdown.component.jsx | 24 +- .../chapter/chapter-intro/intro.component.jsx | 33 +- .../leaderboard.component.jsx | 108 +- .../chapter-map-guide/mapGuide.component.jsx | 28 +- .../chapter-map/chapterMap.component.jsx | 119 +- .../modalContent.component.jsx | 43 +- .../chapter-select/select.component.jsx | 68 +- .../chapter-stat/chapterStat.component.jsx | 28 +- .../toolkitContent.component.jsx | 46 +- .../toolkitHeader.component.jsx | 15 +- .../toolkit.component.jsx | 35 +- .../chapterToolkit.component.jsx | 10 +- .../ChapterWrapper.component.jsx | 16 +- components/chapter/data/places.js | 170 +- components/chapter/data/stats.js | 530 +++--- components/chapter/data/toolkits.js | 326 ++-- .../chapterHeader/chapterHeader.component.jsx | 10 +- components/coreteam/ApprovedProposal.js | 388 +++-- components/coreteam/CheckDND.js | 389 ++--- components/coreteam/ModalComp.js | 68 +- components/coreteam/Notification.js | 1191 ++++++------- components/coreteam/SingleSubTask.js | 262 +-- components/coreteam/TaskBanner.js | 38 +- components/coreteam/TaskCard.js | 69 +- components/coreteam/TaskName.js | 10 +- components/coreteam/TaskNameDescription.js | 591 ++++--- components/coreteam/TaskNameHeader.js | 438 ++--- components/coreteam/TestTaskCard.js | 201 ++- components/coreteam/ViewTask.js | 257 ++- components/defisummer.js | 73 +- .../employers-page/home/Card/CandidateCard.js | 6 +- components/employers-page/home/Card/Card.js | 16 +- .../employers-page/home/Card/InterviewCard.js | 8 +- .../home/content/candidates/Candidates.js | 30 +- .../employers-page/home/content/index.js | 12 +- .../home/content/interview/Interview.js | 46 +- .../employers-page/home/content/jobs/Jobs.js | 56 +- .../employers-page/home/header/Header.js | 6 +- components/employers-page/sidenav/index.js | 40 +- .../events-card/events-card.jsx | 41 +- .../events-component/events-component.jsx | 119 +- .../events-menu/events-menu.jsx | 8 +- .../events-overview/events-overview.jsx | 18 +- .../events-popup/approve-action.jsx | 43 +- .../events-popup/events-popup.jsx | 65 +- .../events-popup/reject-action.jsx | 43 +- .../events-popup/review-action.jsx | 15 +- .../past-events/past-events.jsx | 99 +- .../recent-events/recent-events.jsx | 47 +- components/jobposting/card/index.js | 60 +- .../jobposting/content/JobsMainContent.js | 2 +- .../jobposting/content/heading/index.js | 359 ++-- components/jobposting/footer/index.js | 10 +- components/join/JoinCard.js | 41 +- components/join/JoinHerosection.js | 17 +- components/join/JoinNav.js | 46 +- components/join/MpaProgramsHighlight.js | 61 +- components/join/joinBar.js | 120 +- components/join/svg/icons.js | 78 +- components/learn/CourseCategories.js | 159 +- components/learn/CoursesSkeleton.js | 24 +- components/learn/FeaturedCourseList.js | 79 +- components/learn/FeaturedCourses.js | 90 +- components/learn/LearnBanner.js | 40 +- components/learn/RecommendedCourseList.js | 9 +- components/learn/RecommendedCourses.js | 86 +- .../learn/RecommendedCoursesListSkeleton.js | 13 +- components/learn/SkeletonElement.js | 213 ++- components/learn/UserCourseList.js | 158 +- components/learn/UserCourses.js | 86 +- .../learn/courseDetails/ActivityDetails.js | 445 ++--- .../learn/courseDetails/ActivityList.js | 136 +- components/learn/courseDetails/Course.js | 71 +- .../learn/courseDetails/CourseSidebar.js | 82 +- .../learn/courseDetails/CourseWeeksList.js | 319 ++-- .../learn/courseDetails/MainCourseInfo.js | 122 +- components/learn/courseDetails/UserBanner.js | 91 +- .../learn/courseDetails/WeeklyActivities.js | 195 ++- .../courseSidebarItems/AdvancedModules.js | 81 +- .../courseSidebarItems/BeginnerModules.js | 83 +- .../courseSidebarItems/IntermediateModules.js | 81 +- components/learn/quizActivity/QuizModal.js | 22 +- components/learn/quizActivity/QuizProgress.js | 26 +- components/learn/quizActivity/QuizResult.js | 154 +- components/learn/quizActivity/SimpleQuiz.js | 73 +- components/login-signup/card/index.jsx | 341 ++-- components/login-signup/form/Login.js | 26 +- components/login-signup/form/Signup.js | 66 +- components/login-signup/form/index.jsx | 189 +- components/login-signup/modal/index.jsx | 26 +- components/mpa-builder/builder.jsx | 16 +- components/mpa-loader/loader.jsx | 15 +- components/presale/PresalePage.js | 31 +- components/presale/presaleAmount.js | 106 +- components/presale/presaleCountDown.js | 73 +- components/presale/presaleHeroSection.js | 70 +- components/presale/presalePreorder.js | 350 ++-- components/presaleAmount.js | 92 +- components/presaleCountDown.js | 67 +- components/presaleHeroSection.js | 70 +- components/presalePreorder.js | 315 ++-- components/presaleSubNav.js | 31 +- .../search/chapters-card/chapters-card.jsx | 48 +- components/search/events-card/events-card.jsx | 20 +- .../search/events-card/events-popup.jsx | 54 +- components/search/jobs-card/jobs-card.jsx | 19 +- components/search/jobs-card/jobs-popup.jsx | 213 ++- .../search/search-main/popular-search.jsx | 12 +- .../search/search-main/search-category.jsx | 12 +- .../search/search-main/search-result.jsx | 100 +- components/search/search-main/search.jsx | 81 +- components/search/search-spare.js | 186 +- components/search/search.utils.js | 32 +- .../search/startups-card/startups-card.jsx | 30 +- components/search/users-card/users-card.jsx | 29 +- components/search/users-card/users-popup.jsx | 30 +- components/settings/CreateSettingAddition.js | 45 +- components/settings/CreateSettingInput.js | 153 +- components/settings/SettingBody.js | 35 +- .../SettingBodyNotificationsNotifications.js | 60 +- components/settings/SettingBodyOverview.js | 194 ++- .../settings/SettingBodyProfileBackground.js | 86 +- .../settings/SettingBodyProfileDetails.js | 97 +- .../settings/SettingBodyProfileEducation.js | 82 +- .../settings/SettingBodyProfileMedia.js | 82 +- .../settings/SettingBodyProfileOverview.js | 84 +- .../settings/SettingBodySecurityLogin.js | 233 ++- .../settings/SettingBodySecurityManagement.js | 30 +- .../SettingBodySecurityManagementModal.js | 41 +- .../settings/SettingBodySecurityPrivacy.js | 60 +- .../settings/SettingBodyWalletMyWallet.js | 62 +- components/settings/SettingBodyWalletVotes.js | 32 +- components/settings/SettingsLayout.js | 169 +- components/settings/SpecificSettingsLayout.js | 41 +- components/sponsorship/SponsorshipCard.js | 125 +- components/sponsorship/SponsorshipCheckout.js | 48 +- components/sponsorship/SponsorshipMain.js | 24 +- .../SponsorshipPaymentCompleted.js | 146 +- .../sponsorship/SponsorshipPaymentDetails.js | 70 +- components/vote-components/VoteCard.js | 34 +- components/vote-components/VoteGuide.js | 103 +- components/vote-components/VoteHero.js | 43 +- components/vote-components/VoteModal.js | 136 +- contexts/ModulesContext.js | 4 +- contexts/actions/actionTypes.js | 30 +- contexts/actions/auth/googleAuth.js | 84 +- contexts/actions/auth/login.js | 33 +- contexts/actions/auth/logout.js | 17 +- contexts/actions/auth/register.js | 24 +- contexts/actions/profile/getProfile.js | 24 +- contexts/actions/profile/updateProfile.js | 19 +- contexts/actions/profile/updateProfileJSON.js | 19 +- .../initialStates/profileInitialStates.js | 15 +- contexts/provider.js | 13 +- contexts/reducers/auth.js | 6 +- contexts/reducers/donate.js | 20 +- contexts/reducers/profile.js | 113 +- .../settingsPagesProvider.js | 9 +- contexts/utils/CustomDate.js | 10 +- contexts/utils/avatarFields.js | 134 +- contexts/utils/avatarOptions.js | 23 +- contexts/utils/fields.js | 40 +- contexts/utils/links.js | 400 ++--- contexts/utils/profileInputFields.js | 158 +- contexts/utils/profileInputFields1.js | 225 +-- contexts/utils/settings/getLevelUpTips.js | 278 ++- .../utils/settings/getProgressPercentage.js | 16 +- .../utils/settings/settingsInputFields.js | 250 +-- contexts/utils/toasts.js | 57 +- contexts/utils/universities.js | 2 +- ga/index.js | 4 +- helpers/axiosInstance.js | 22 +- helpers/dropDownItems.js | 44 +- helpers/formatIncubator.js | 51 +- helpers/formatters.js | 18 +- ...getSpecificSettingsLayoutNavigationList.js | 82 +- helpers/mockData.js | 1040 ++++++----- helpers/networks.js | 112 +- helpers/sleep.js | 4 +- helpers/teamMembers.js | 1284 +++++++------- helpers/timeago.js | 20 +- helpers/useNativeBalance.js | 12 +- helpers/userNames.js | 16 +- next.config.js | 131 +- package.json | 11 +- pages/404.js | 19 +- pages/Faucet.js | 22 +- pages/_app.js | 185 +- pages/_document.js | 8 +- pages/about.js | 58 +- pages/api/auth/[...nextauth].js | 6 +- pages/api/payment_intents/index.js | 69 +- pages/auth/index.js | 43 +- pages/avatar.js | 50 +- pages/career_explainer.js | 24 +- pages/careers/companies.js | 209 ++- pages/careers/companies/[company].js | 281 +-- pages/careers/create-new-company.js | 386 ++-- pages/careers/create-new-job.js | 84 +- pages/careers/employers-page/dashboard.js | 46 +- pages/careers/employers-page/employer-jobs.js | 42 +- pages/careers/index-1.js | 30 +- pages/careers/index.js | 387 ++-- pages/careers/saved-jobs.js | 25 +- pages/chapter/index.js | 105 +- pages/chapter/start-a-chapter.js | 35 +- pages/chaptertoolkit/[id].js | 101 +- pages/chat.js | 12 +- pages/consultancy.js | 22 +- pages/consultancy_dashboard.js | 22 +- pages/consultancy_explainer.js | 22 +- pages/coreteam/notification.js | 26 +- pages/coreteam/openandview.js | 17 +- pages/coreteam/viewtask.js | 39 +- pages/courses/[courseId]/index.js | 169 +- .../[courseId]/modules/[moduleLevel]/index.js | 185 +- .../module-details/[moduleId]/index.js | 191 +- pages/create-profile.js | 32 +- pages/createTask/[id].js | 32 +- pages/createTask/index.js | 14 +- pages/dashboard/index.js | 116 +- pages/dashboard/user/updateProfile.js | 151 +- pages/defisummer-summit.js | 20 +- pages/devxdao-milestones.js | 33 +- pages/events-proposal.js | 32 +- pages/events.js | 30 +- pages/incubator.js | 282 +-- pages/index.js | 168 +- pages/intern.js | 24 +- pages/join.js | 24 +- pages/learn-page.js | 38 +- pages/legal.js | 27 +- pages/mentorship.js | 26 +- pages/mentorshipApp.js | 128 +- pages/mentorshipProgram.js | 24 +- pages/minority-earned.js | 24 +- pages/moderator/elect_proposals.js | 14 +- pages/moderator/my_elected_proposal.js | 30 +- pages/moderator/proposal_notification.js | 30 +- pages/moderator/taskStatusNotification.js | 32 +- pages/partner.js | 26 +- pages/plannedTaskStatus.js | 28 +- pages/presale.js | 30 +- pages/privacy.js | 25 +- pages/proposal-info/[id].js | 27 +- pages/reviewTask.js | 28 +- pages/saved-jobs.js | 20 +- pages/search.js | 30 +- pages/settings/notifications/notifications.js | 17 +- pages/settings/overview/index.js | 14 +- pages/settings/profile/background.js | 16 +- pages/settings/profile/details.js | 16 +- pages/settings/profile/education.js | 16 +- pages/settings/profile/media.js | 16 +- pages/settings/profile/overview.js | 20 +- pages/settings/security/login.js | 16 +- pages/settings/security/management.js | 16 +- pages/settings/security/privacy.js | 16 +- pages/settings/wallet/my-wallet.js | 16 +- pages/settings/wallet/votes.js | 16 +- pages/sponsorship/Sponsorship.js | 12 +- pages/sponsorship/index.js | 80 +- pages/startup/[id].js | 130 +- pages/swap.js | 24 +- pages/taskNotification.js | 28 +- pages/tokenomics.js | 25 +- pages/uikit.js | 29 +- pages/user/[username].js | 68 +- pages/viewTask.js | 28 +- pages/viewTask/[id].js | 28 +- pages/vote.js | 44 +- pages/whitepaper.js | 25 +- postcss.config.js | 3 +- .../assets/plugins/bootstrap/bootstrap.min.js | 303 +++- public/assets/plugins/bootstrap/jquery.min.js | 165 +- .../plugins/kipso-icons/demo-files/demo.js | 46 +- tailwind.config.js | 56 +- 565 files changed, 35894 insertions(+), 33976 deletions(-) create mode 100644 .eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..eaae603a --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,26 @@ +module.exports = { + env: { + browser: true, + es2021: true, + }, + extends: [ + 'plugin:react/recommended', + 'airbnb', + ], + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + ecmaVersion: 13, + sourceType: 'module', + }, + plugins: [ + 'react', + ], + rules: { + 'react/function-component-definition': 'off', + 'jsx-a11y/click-events-have-key-events': 'off', + 'jsx-a11y/no-noninteractive-element-interactions': 'off', + 'react/jsx-filename-extension': 'off', + }, +}; diff --git a/MoralisDappProvider/MoralisDappProvider.js b/MoralisDappProvider/MoralisDappProvider.js index 47364146..d564ad38 100644 --- a/MoralisDappProvider/MoralisDappProvider.js +++ b/MoralisDappProvider/MoralisDappProvider.js @@ -1,25 +1,25 @@ -import React, { useEffect, useState } from "react"; -import { useMoralis } from "react-moralis"; -import MoralisDappContext from "./context"; +import React, { useEffect, useState } from 'react'; +import { useMoralis } from 'react-moralis'; +import MoralisDappContext from './context'; -function MoralisDappProvider({ children }) { +const MoralisDappProvider = function ({ children }) { const { web3, Moralis, user } = useMoralis(); const [walletAddress, setWalletAddress] = useState(); const [chainId, setChainId] = useState(); useEffect(() => { - Moralis.onChainChanged(function (chain) { + Moralis.onChainChanged((chain) => { setChainId(chain); }); - Moralis.onAccountsChanged(function (address) { + Moralis.onAccountsChanged((address) => { setWalletAddress(address[0]); }); }, []); useEffect(() => setChainId(web3.givenProvider?.chainId)); useEffect( - () => setWalletAddress(web3.givenProvider?.selectedAddress || user?.get("ethAddress")), - [web3, user] + () => setWalletAddress(web3.givenProvider?.selectedAddress || user?.get('ethAddress')), + [web3, user], ); return ( @@ -27,12 +27,12 @@ function MoralisDappProvider({ children }) { {children} ); -} +}; function useMoralisDapp() { const context = React.useContext(MoralisDappContext); if (context === undefined) { - throw new Error("useMoralisDapp must be used within a MoralisDappProvider"); + throw new Error('useMoralisDapp must be used within a MoralisDappProvider'); } return context; } diff --git a/MoralisDappProvider/context.js b/MoralisDappProvider/context.js index 406aa8d6..6d7c3abe 100644 --- a/MoralisDappProvider/context.js +++ b/MoralisDappProvider/context.js @@ -1,4 +1,4 @@ -import React from "react"; +import React from 'react'; const MoralisDappContext = React.createContext(); diff --git a/SliderOne.js b/SliderOne.js index 26c38cec..7d076115 100644 --- a/SliderOne.js +++ b/SliderOne.js @@ -1,82 +1,88 @@ -import React, {useState} from 'react'; +import React, { useState } from 'react'; import Swiper from 'react-id-swiper'; import 'swiper/css/swiper.css'; -const SliderOne = () => { +const SliderOne = function () { + const [swiper, setSwiper] = useState(null); - const [swiper, setSwiper] = useState(null); + const goNext = () => { + if (swiper !== null) { + swiper.slideNext(); + } + }; - const goNext = () => { - if (swiper !== null) { - swiper.slideNext(); - } - }; + const goPrev = () => { + if (swiper !== null) { + swiper.slidePrev(); + } + }; - const goPrev = () => { - if (swiper !== null) { - swiper.slidePrev(); - } - }; + return ( +
+
+ +
+
+
+
+
+ - return ( -
-
- - -
-
-
-
-
- - -
-
-

Minority
- Programmers Association

-

Code, Culture, Community.

- Join Today -
-
-
-
-
-
-
-
-
- - -
-
-

Learn
- to Code

-

with our international network of developers

- Learn More -
-
-
-
-
-
-
-
-
+
+
+

+ Minority
+ Programmers Association +

+

Code, Culture, Community.

+ Join Today +
+
- +
+
+
+
+
+ + +
+
+

+ Learn
+ to Code +

+

with our international network of developers

+ Learn More +
+
+
+ +
+
+
+
+
+
+
+ +
+ +
+
- ); -} -export default SliderOne; \ No newline at end of file +
+
+ ); +}; +export default SliderOne; diff --git a/components/$-minority-earned/Action.js b/components/$-minority-earned/Action.js index 8bdbd0ff..146c22de 100644 --- a/components/$-minority-earned/Action.js +++ b/components/$-minority-earned/Action.js @@ -1,30 +1,34 @@ -import React from 'react' - -const Action = ({actions}) => { - +import React from 'react'; +const Action = function ({ actions }) { return (
{actions.map((action) => ( -
-
-
- {action.category && {action.category}} -
-

{action.name}

-

On {new Date(action.date).toDateString().substr(3)}

+
+
+
+ {action.category && {action.category}} +
+

{action.name}

+

+ On + {new Date(action.date).toDateString().substr(3)} +

+
+
+
+

+ {action.amount} + $MINORITY +

+
-
-

{action.amount}$MINORITY

- -
-
))}
- - ) -} -export default Action + ); +}; + +export default Action; diff --git a/components/$-minority-earned/Binary.js b/components/$-minority-earned/Binary.js index 3e2fc6ac..79d21875 100644 --- a/components/$-minority-earned/Binary.js +++ b/components/$-minority-earned/Binary.js @@ -1,6 +1,6 @@ -import React from 'react' +import React from 'react'; -const Binary = () => { +const Binary = function () { return ( { fill="#fff" fillOpacity="0.1" d="M242.506-.36c1.704 0 3.264.312 4.68.936a10.13 10.13 0 013.6 2.628c.984 1.128 1.752 2.496 2.304 4.104.552 1.608.828 3.384.828 5.328 0 1.944-.276 3.708-.828 5.292-.552 1.608-1.32 2.976-2.304 4.104a10.572 10.572 0 01-3.6 2.628c-1.416.624-2.976.936-4.68.936-1.704 0-3.252-.312-4.644-.936a10.13 10.13 0 01-3.6-2.628c-1.008-1.128-1.788-2.496-2.34-4.104-.552-1.584-.828-3.348-.828-5.292s.276-3.72.828-5.328c.552-1.608 1.32-2.976 2.304-4.104a10.13 10.13 0 013.6-2.628c1.416-.624 2.976-.936 4.68-.936zm0 5.04c-1.776 0-3.168.708-4.176 2.124-1.032 1.416-1.548 3.36-1.548 5.832 0 2.424.516 4.344 1.548 5.76 1.032 1.44 2.424 2.16 4.176 2.16 1.752 0 3.144-.72 4.176-2.16 1.032-1.416 1.548-3.336 1.548-5.76 0-2.472-.504-4.416-1.512-5.832-1.032-1.416-2.436-2.124-4.212-2.124zm-4.991-27.48V-48h5.832v19.296l5.22-2.088v5.04l-7.38 2.952h-3.672zm4.991-73.56c1.704 0 3.264.312 4.68.936a10.13 10.13 0 013.6 2.628c.984 1.128 1.752 2.496 2.304 4.104.552 1.608.828 3.384.828 5.328 0 1.944-.276 3.708-.828 5.292-.552 1.608-1.32 2.976-2.304 4.104a10.572 10.572 0 01-3.6 2.628c-1.416.624-2.976.936-4.68.936-1.704 0-3.252-.312-4.644-.936a10.13 10.13 0 01-3.6-2.628c-1.008-1.128-1.788-2.496-2.34-4.104-.552-1.584-.828-3.348-.828-5.292s.276-3.72.828-5.328c.552-1.608 1.32-2.976 2.304-4.104a10.13 10.13 0 013.6-2.628c1.416-.624 2.976-.936 4.68-.936zm0 5.04c-1.776 0-3.168.708-4.176 2.124-1.032 1.416-1.548 3.36-1.548 5.832 0 2.424.516 4.344 1.548 5.76 1.032 1.44 2.424 2.16 4.176 2.16 1.752 0 3.144-.72 4.176-2.16 1.032-1.416 1.548-3.336 1.548-5.76 0-2.472-.504-4.416-1.512-5.832-1.032-1.416-2.436-2.124-4.212-2.124zm-4.991-27.48V-144h5.832v19.296l5.22-2.088v5.04l-7.38 2.952h-3.672zM204.515 73.2V48h5.832v19.296l5.22-2.088v5.04l-7.38 2.952h-3.672zm4.991-73.56c1.704 0 3.264.312 4.68.936a10.13 10.13 0 013.6 2.628c.984 1.128 1.752 2.496 2.304 4.104.552 1.608.828 3.384.828 5.328 0 1.944-.276 3.708-.828 5.292-.552 1.608-1.32 2.976-2.304 4.104a10.572 10.572 0 01-3.6 2.628c-1.416.624-2.976.936-4.68.936-1.704 0-3.252-.312-4.644-.936a10.13 10.13 0 01-3.6-2.628c-1.008-1.128-1.788-2.496-2.34-4.104-.552-1.584-.828-3.348-.828-5.292s.276-3.72.828-5.328c.552-1.608 1.32-2.976 2.304-4.104a10.13 10.13 0 013.6-2.628c1.416-.624 2.976-.936 4.68-.936zm0 5.04c-1.776 0-3.168.708-4.176 2.124-1.032 1.416-1.548 3.36-1.548 5.832 0 2.424.516 4.344 1.548 5.76 1.032 1.44 2.424 2.16 4.176 2.16 1.752 0 3.144-.72 4.176-2.16 1.032-1.416 1.548-3.336 1.548-5.76 0-2.472-.504-4.416-1.512-5.832-1.032-1.416-2.436-2.124-4.212-2.124zm-4.991-27.48V-48h5.832v19.296l5.22-2.088v5.04l-7.38 2.952h-3.672zm4.991-73.56c1.704 0 3.264.312 4.68.936a10.13 10.13 0 013.6 2.628c.984 1.128 1.752 2.496 2.304 4.104.552 1.608.828 3.384.828 5.328 0 1.944-.276 3.708-.828 5.292-.552 1.608-1.32 2.976-2.304 4.104a10.572 10.572 0 01-3.6 2.628c-1.416.624-2.976.936-4.68.936-1.704 0-3.252-.312-4.644-.936a10.13 10.13 0 01-3.6-2.628c-1.008-1.128-1.788-2.496-2.34-4.104-.552-1.584-.828-3.348-.828-5.292s.276-3.72.828-5.328c.552-1.608 1.32-2.976 2.304-4.104a10.13 10.13 0 013.6-2.628c1.416-.624 2.976-.936 4.68-.936zm0 5.04c-1.776 0-3.168.708-4.176 2.124-1.032 1.416-1.548 3.36-1.548 5.832 0 2.424.516 4.344 1.548 5.76 1.032 1.44 2.424 2.16 4.176 2.16 1.752 0 3.144-.72 4.176-2.16 1.032-1.416 1.548-3.336 1.548-5.76 0-2.472-.504-4.416-1.512-5.832-1.032-1.416-2.436-2.124-4.212-2.124zm-4.991-27.48V-144h5.832v19.296l5.22-2.088v5.04l-7.38 2.952h-3.672zM176.506 95.64c1.704 0 3.264.312 4.68.936a10.13 10.13 0 013.6 2.628c.984 1.128 1.752 2.496 2.304 4.104.552 1.608.828 3.384.828 5.328 0 1.944-.276 3.708-.828 5.292-.552 1.608-1.32 2.976-2.304 4.104a10.572 10.572 0 01-3.6 2.628c-1.416.624-2.976.936-4.68.936-1.704 0-3.252-.312-4.644-.936a10.13 10.13 0 01-3.6-2.628c-1.008-1.128-1.788-2.496-2.34-4.104-.552-1.584-.828-3.348-.828-5.292s.276-3.72.828-5.328c.552-1.608 1.32-2.976 2.304-4.104a10.13 10.13 0 013.6-2.628c1.416-.624 2.976-.936 4.68-.936zm0 5.04c-1.776 0-3.168.708-4.176 2.124-1.032 1.416-1.548 3.36-1.548 5.832 0 2.424.516 4.344 1.548 5.76 1.032 1.44 2.424 2.16 4.176 2.16 1.752 0 3.144-.72 4.176-2.16 1.032-1.416 1.548-3.336 1.548-5.76 0-2.472-.504-4.416-1.512-5.832-1.032-1.416-2.436-2.124-4.212-2.124zm-4.991-27.48V48h5.832v19.296l5.22-2.088v5.04l-7.38 2.952h-3.672zm4.991-73.56c1.704 0 3.264.312 4.68.936a10.13 10.13 0 013.6 2.628c.984 1.128 1.752 2.496 2.304 4.104.552 1.608.828 3.384.828 5.328 0 1.944-.276 3.708-.828 5.292-.552 1.608-1.32 2.976-2.304 4.104a10.572 10.572 0 01-3.6 2.628c-1.416.624-2.976.936-4.68.936-1.704 0-3.252-.312-4.644-.936a10.13 10.13 0 01-3.6-2.628c-1.008-1.128-1.788-2.496-2.34-4.104-.552-1.584-.828-3.348-.828-5.292s.276-3.72.828-5.328c.552-1.608 1.32-2.976 2.304-4.104a10.13 10.13 0 013.6-2.628c1.416-.624 2.976-.936 4.68-.936zm0 5.04c-1.776 0-3.168.708-4.176 2.124-1.032 1.416-1.548 3.36-1.548 5.832 0 2.424.516 4.344 1.548 5.76 1.032 1.44 2.424 2.16 4.176 2.16 1.752 0 3.144-.72 4.176-2.16 1.032-1.416 1.548-3.336 1.548-5.76 0-2.472-.504-4.416-1.512-5.832-1.032-1.416-2.436-2.124-4.212-2.124zm-4.991-27.48V-48h5.832v19.296l5.22-2.088v5.04l-7.38 2.952h-3.672zm4.991-73.56c1.704 0 3.264.312 4.68.936a10.13 10.13 0 013.6 2.628c.984 1.128 1.752 2.496 2.304 4.104.552 1.608.828 3.384.828 5.328 0 1.944-.276 3.708-.828 5.292-.552 1.608-1.32 2.976-2.304 4.104a10.572 10.572 0 01-3.6 2.628c-1.416.624-2.976.936-4.68.936-1.704 0-3.252-.312-4.644-.936a10.13 10.13 0 01-3.6-2.628c-1.008-1.128-1.788-2.496-2.34-4.104-.552-1.584-.828-3.348-.828-5.292s.276-3.72.828-5.328c.552-1.608 1.32-2.976 2.304-4.104a10.13 10.13 0 013.6-2.628c1.416-.624 2.976-.936 4.68-.936zm0 5.04c-1.776 0-3.168.708-4.176 2.124-1.032 1.416-1.548 3.36-1.548 5.832 0 2.424.516 4.344 1.548 5.76 1.032 1.44 2.424 2.16 4.176 2.16 1.752 0 3.144-.72 4.176-2.16 1.032-1.416 1.548-3.336 1.548-5.76 0-2.472-.504-4.416-1.512-5.832-1.032-1.416-2.436-2.124-4.212-2.124zm-4.991-27.48V-144h5.832v19.296l5.22-2.088v5.04l-7.38 2.952h-3.672zM138.515 169.2V144h5.832v19.296l5.22-2.088v5.04l-7.38 2.952h-3.672zm4.991-73.56c1.704 0 3.264.312 4.68.936a10.13 10.13 0 013.6 2.628c.984 1.128 1.752 2.496 2.304 4.104.552 1.608.828 3.384.828 5.328 0 1.944-.276 3.708-.828 5.292-.552 1.608-1.32 2.976-2.304 4.104a10.572 10.572 0 01-3.6 2.628c-1.416.624-2.976.936-4.68.936-1.704 0-3.252-.312-4.644-.936a10.13 10.13 0 01-3.6-2.628c-1.008-1.128-1.788-2.496-2.34-4.104-.552-1.584-.828-3.348-.828-5.292s.276-3.72.828-5.328c.552-1.608 1.32-2.976 2.304-4.104a10.13 10.13 0 013.6-2.628c1.416-.624 2.976-.936 4.68-.936zm0 5.04c-1.776 0-3.168.708-4.176 2.124-1.032 1.416-1.548 3.36-1.548 5.832 0 2.424.516 4.344 1.548 5.76 1.032 1.44 2.424 2.16 4.176 2.16 1.752 0 3.144-.72 4.176-2.16 1.032-1.416 1.548-3.336 1.548-5.76 0-2.472-.504-4.416-1.512-5.832-1.032-1.416-2.436-2.124-4.212-2.124zm-4.991-27.48V48h5.832v19.296l5.22-2.088v5.04l-7.38 2.952h-3.672zm4.991-73.56c1.704 0 3.264.312 4.68.936a10.13 10.13 0 013.6 2.628c.984 1.128 1.752 2.496 2.304 4.104.552 1.608.828 3.384.828 5.328 0 1.944-.276 3.708-.828 5.292-.552 1.608-1.32 2.976-2.304 4.104a10.572 10.572 0 01-3.6 2.628c-1.416.624-2.976.936-4.68.936-1.704 0-3.252-.312-4.644-.936a10.13 10.13 0 01-3.6-2.628c-1.008-1.128-1.788-2.496-2.34-4.104-.552-1.584-.828-3.348-.828-5.292s.276-3.72.828-5.328c.552-1.608 1.32-2.976 2.304-4.104a10.13 10.13 0 013.6-2.628c1.416-.624 2.976-.936 4.68-.936zm0 5.04c-1.776 0-3.168.708-4.176 2.124-1.032 1.416-1.548 3.36-1.548 5.832 0 2.424.516 4.344 1.548 5.76 1.032 1.44 2.424 2.16 4.176 2.16 1.752 0 3.144-.72 4.176-2.16 1.032-1.416 1.548-3.336 1.548-5.76 0-2.472-.504-4.416-1.512-5.832-1.032-1.416-2.436-2.124-4.212-2.124zm-4.991-27.48V-48h5.832v19.296l5.22-2.088v5.04l-7.38 2.952h-3.672zm4.991-73.56c1.704 0 3.264.312 4.68.936a10.13 10.13 0 013.6 2.628c.984 1.128 1.752 2.496 2.304 4.104.552 1.608.828 3.384.828 5.328 0 1.944-.276 3.708-.828 5.292-.552 1.608-1.32 2.976-2.304 4.104a10.572 10.572 0 01-3.6 2.628c-1.416.624-2.976.936-4.68.936-1.704 0-3.252-.312-4.644-.936a10.13 10.13 0 01-3.6-2.628c-1.008-1.128-1.788-2.496-2.34-4.104-.552-1.584-.828-3.348-.828-5.292s.276-3.72.828-5.328c.552-1.608 1.32-2.976 2.304-4.104a10.13 10.13 0 013.6-2.628c1.416-.624 2.976-.936 4.68-.936zm0 5.04c-1.776 0-3.168.708-4.176 2.124-1.032 1.416-1.548 3.36-1.548 5.832 0 2.424.516 4.344 1.548 5.76 1.032 1.44 2.424 2.16 4.176 2.16 1.752 0 3.144-.72 4.176-2.16 1.032-1.416 1.548-3.336 1.548-5.76 0-2.472-.504-4.416-1.512-5.832-1.032-1.416-2.436-2.124-4.212-2.124zm-4.991-27.48V-144h5.832v19.296l5.22-2.088v5.04l-7.38 2.952h-3.672zM110.506 191.64c1.704 0 3.264.312 4.68.936a10.13 10.13 0 013.6 2.628c.984 1.128 1.752 2.496 2.304 4.104.552 1.608.828 3.384.828 5.328 0 1.944-.276 3.708-.828 5.292-.552 1.608-1.32 2.976-2.304 4.104a10.572 10.572 0 01-3.6 2.628c-1.416.624-2.976.936-4.68.936-1.704 0-3.252-.312-4.644-.936a10.13 10.13 0 01-3.6-2.628c-1.008-1.128-1.788-2.496-2.34-4.104-.552-1.584-.828-3.348-.828-5.292s.276-3.72.828-5.328c.552-1.608 1.32-2.976 2.304-4.104a10.13 10.13 0 013.6-2.628c1.416-.624 2.976-.936 4.68-.936zm0 5.04c-1.776 0-3.168.708-4.176 2.124-1.032 1.416-1.548 3.36-1.548 5.832 0 2.424.516 4.344 1.548 5.76 1.032 1.44 2.424 2.16 4.176 2.16 1.752 0 3.144-.72 4.176-2.16 1.032-1.416 1.548-3.336 1.548-5.76 0-2.472-.504-4.416-1.512-5.832-1.032-1.416-2.436-2.124-4.212-2.124zm-4.991-27.48V144h5.832v19.296l5.22-2.088v5.04l-7.38 2.952h-3.672zm4.991-73.56c1.704 0 3.264.312 4.68.936a10.13 10.13 0 013.6 2.628c.984 1.128 1.752 2.496 2.304 4.104.552 1.608.828 3.384.828 5.328 0 1.944-.276 3.708-.828 5.292-.552 1.608-1.32 2.976-2.304 4.104a10.572 10.572 0 01-3.6 2.628c-1.416.624-2.976.936-4.68.936-1.704 0-3.252-.312-4.644-.936a10.13 10.13 0 01-3.6-2.628c-1.008-1.128-1.788-2.496-2.34-4.104-.552-1.584-.828-3.348-.828-5.292s.276-3.72.828-5.328c.552-1.608 1.32-2.976 2.304-4.104a10.13 10.13 0 013.6-2.628c1.416-.624 2.976-.936 4.68-.936zm0 5.04c-1.776 0-3.168.708-4.176 2.124-1.032 1.416-1.548 3.36-1.548 5.832 0 2.424.516 4.344 1.548 5.76 1.032 1.44 2.424 2.16 4.176 2.16 1.752 0 3.144-.72 4.176-2.16 1.032-1.416 1.548-3.336 1.548-5.76 0-2.472-.504-4.416-1.512-5.832-1.032-1.416-2.436-2.124-4.212-2.124zm-4.991-27.48V48h5.832v19.296l5.22-2.088v5.04l-7.38 2.952h-3.672zm4.991-73.56c1.704 0 3.264.312 4.68.936a10.13 10.13 0 013.6 2.628c.984 1.128 1.752 2.496 2.304 4.104.552 1.608.828 3.384.828 5.328 0 1.944-.276 3.708-.828 5.292-.552 1.608-1.32 2.976-2.304 4.104a10.572 10.572 0 01-3.6 2.628c-1.416.624-2.976.936-4.68.936-1.704 0-3.252-.312-4.644-.936a10.13 10.13 0 01-3.6-2.628c-1.008-1.128-1.788-2.496-2.34-4.104-.552-1.584-.828-3.348-.828-5.292s.276-3.72.828-5.328c.552-1.608 1.32-2.976 2.304-4.104a10.13 10.13 0 013.6-2.628c1.416-.624 2.976-.936 4.68-.936zm0 5.04c-1.776 0-3.168.708-4.176 2.124-1.032 1.416-1.548 3.36-1.548 5.832 0 2.424.516 4.344 1.548 5.76 1.032 1.44 2.424 2.16 4.176 2.16 1.752 0 3.144-.72 4.176-2.16 1.032-1.416 1.548-3.336 1.548-5.76 0-2.472-.504-4.416-1.512-5.832-1.032-1.416-2.436-2.124-4.212-2.124zm-4.991-27.48V-48h5.832v19.296l5.22-2.088v5.04l-7.38 2.952h-3.672zm4.991-73.56c1.704 0 3.264.312 4.68.936a10.13 10.13 0 013.6 2.628c.984 1.128 1.752 2.496 2.304 4.104.552 1.608.828 3.384.828 5.328 0 1.944-.276 3.708-.828 5.292-.552 1.608-1.32 2.976-2.304 4.104a10.572 10.572 0 01-3.6 2.628c-1.416.624-2.976.936-4.68.936-1.704 0-3.252-.312-4.644-.936a10.13 10.13 0 01-3.6-2.628c-1.008-1.128-1.788-2.496-2.34-4.104-.552-1.584-.828-3.348-.828-5.292s.276-3.72.828-5.328c.552-1.608 1.32-2.976 2.304-4.104a10.13 10.13 0 013.6-2.628c1.416-.624 2.976-.936 4.68-.936zm0 5.04c-1.776 0-3.168.708-4.176 2.124-1.032 1.416-1.548 3.36-1.548 5.832 0 2.424.516 4.344 1.548 5.76 1.032 1.44 2.424 2.16 4.176 2.16 1.752 0 3.144-.72 4.176-2.16 1.032-1.416 1.548-3.336 1.548-5.76 0-2.472-.504-4.416-1.512-5.832-1.032-1.416-2.436-2.124-4.212-2.124zm-4.991-27.48V-144h5.832v19.296l5.22-2.088v5.04l-7.38 2.952h-3.672zM72.515 265.2V240h5.832v19.296l5.22-2.088v5.04l-7.38 2.952h-3.672zm4.991-73.56c1.704 0 3.264.312 4.68.936a10.13 10.13 0 013.6 2.628c.984 1.128 1.752 2.496 2.304 4.104.552 1.608.828 3.384.828 5.328 0 1.944-.276 3.708-.828 5.292-.552 1.608-1.32 2.976-2.304 4.104a10.572 10.572 0 01-3.6 2.628c-1.416.624-2.976.936-4.68.936-1.704 0-3.252-.312-4.644-.936a10.13 10.13 0 01-3.6-2.628c-1.008-1.128-1.788-2.496-2.34-4.104-.552-1.584-.828-3.348-.828-5.292s.276-3.72.828-5.328c.552-1.608 1.32-2.976 2.304-4.104a10.13 10.13 0 013.6-2.628c1.416-.624 2.976-.936 4.68-.936zm0 5.04c-1.776 0-3.168.708-4.176 2.124-1.032 1.416-1.548 3.36-1.548 5.832 0 2.424.516 4.344 1.548 5.76 1.032 1.44 2.424 2.16 4.176 2.16 1.752 0 3.144-.72 4.176-2.16 1.032-1.416 1.548-3.336 1.548-5.76 0-2.472-.504-4.416-1.512-5.832-1.032-1.416-2.436-2.124-4.212-2.124zm-4.991-27.48V144h5.832v19.296l5.22-2.088v5.04l-7.38 2.952h-3.672zm4.991-73.56c1.704 0 3.264.312 4.68.936a10.13 10.13 0 013.6 2.628c.984 1.128 1.752 2.496 2.304 4.104.552 1.608.828 3.384.828 5.328 0 1.944-.276 3.708-.828 5.292-.552 1.608-1.32 2.976-2.304 4.104a10.572 10.572 0 01-3.6 2.628c-1.416.624-2.976.936-4.68.936-1.704 0-3.252-.312-4.644-.936a10.13 10.13 0 01-3.6-2.628c-1.008-1.128-1.788-2.496-2.34-4.104-.552-1.584-.828-3.348-.828-5.292s.276-3.72.828-5.328c.552-1.608 1.32-2.976 2.304-4.104a10.13 10.13 0 013.6-2.628c1.416-.624 2.976-.936 4.68-.936zm0 5.04c-1.776 0-3.168.708-4.176 2.124-1.032 1.416-1.548 3.36-1.548 5.832 0 2.424.516 4.344 1.548 5.76 1.032 1.44 2.424 2.16 4.176 2.16 1.752 0 3.144-.72 4.176-2.16 1.032-1.416 1.548-3.336 1.548-5.76 0-2.472-.504-4.416-1.512-5.832-1.032-1.416-2.436-2.124-4.212-2.124zM72.515 73.2V48h5.832v19.296l5.22-2.088v5.04l-7.38 2.952h-3.672zM77.506-.36c1.704 0 3.264.312 4.68.936a10.13 10.13 0 013.6 2.628c.984 1.128 1.752 2.496 2.304 4.104.552 1.608.828 3.384.828 5.328 0 1.944-.276 3.708-.828 5.292-.552 1.608-1.32 2.976-2.304 4.104a10.572 10.572 0 01-3.6 2.628c-1.416.624-2.976.936-4.68.936-1.704 0-3.252-.312-4.644-.936a10.13 10.13 0 01-3.6-2.628c-1.008-1.128-1.788-2.496-2.34-4.104-.552-1.584-.828-3.348-.828-5.292s.276-3.72.828-5.328c.552-1.608 1.32-2.976 2.304-4.104a10.13 10.13 0 013.6-2.628c1.416-.624 2.976-.936 4.68-.936zm0 5.04c-1.776 0-3.168.708-4.176 2.124-1.032 1.416-1.548 3.36-1.548 5.832 0 2.424.516 4.344 1.548 5.76 1.032 1.44 2.424 2.16 4.176 2.16 1.752 0 3.144-.72 4.176-2.16 1.032-1.416 1.548-3.336 1.548-5.76 0-2.472-.504-4.416-1.512-5.832-1.032-1.416-2.436-2.124-4.212-2.124zM72.515-22.8V-48h5.832v19.296l5.22-2.088v5.04l-7.38 2.952h-3.672zm4.991-73.56c1.704 0 3.264.312 4.68.936a10.13 10.13 0 013.6 2.628c.984 1.128 1.752 2.496 2.304 4.104.552 1.608.828 3.384.828 5.328 0 1.944-.276 3.708-.828 5.292-.552 1.608-1.32 2.976-2.304 4.104a10.572 10.572 0 01-3.6 2.628c-1.416.624-2.976.936-4.68.936-1.704 0-3.252-.312-4.644-.936a10.13 10.13 0 01-3.6-2.628c-1.008-1.128-1.788-2.496-2.34-4.104-.552-1.584-.828-3.348-.828-5.292s.276-3.72.828-5.328c.552-1.608 1.32-2.976 2.304-4.104a10.13 10.13 0 013.6-2.628c1.416-.624 2.976-.936 4.68-.936zm0 5.04c-1.776 0-3.168.708-4.176 2.124-1.032 1.416-1.548 3.36-1.548 5.832 0 2.424.516 4.344 1.548 5.76 1.032 1.44 2.424 2.16 4.176 2.16 1.752 0 3.144-.72 4.176-2.16 1.032-1.416 1.548-3.336 1.548-5.76 0-2.472-.504-4.416-1.512-5.832-1.032-1.416-2.436-2.124-4.212-2.124zm-4.991-27.48V-144h5.832v19.296l5.22-2.088v5.04l-7.38 2.952h-3.672zM44.506 287.64c1.704 0 3.264.312 4.68.936a10.13 10.13 0 013.6 2.628c.984 1.128 1.752 2.496 2.304 4.104.552 1.608.828 3.384.828 5.328 0 1.944-.276 3.708-.828 5.292-.552 1.608-1.32 2.976-2.304 4.104a10.572 10.572 0 01-3.6 2.628c-1.416.624-2.976.936-4.68.936-1.704 0-3.252-.312-4.644-.936a10.13 10.13 0 01-3.6-2.628c-1.008-1.128-1.788-2.496-2.34-4.104-.552-1.584-.828-3.348-.828-5.292s.276-3.72.828-5.328c.552-1.608 1.32-2.976 2.304-4.104a10.13 10.13 0 013.6-2.628c1.416-.624 2.976-.936 4.68-.936zm0 5.04c-1.776 0-3.168.708-4.176 2.124-1.032 1.416-1.548 3.36-1.548 5.832 0 2.424.516 4.344 1.548 5.76 1.032 1.44 2.424 2.16 4.176 2.16 1.752 0 3.144-.72 4.176-2.16 1.032-1.416 1.548-3.336 1.548-5.76 0-2.472-.504-4.416-1.512-5.832-1.032-1.416-2.436-2.124-4.212-2.124zm-4.991-27.48V240h5.832v19.296l5.22-2.088v5.04l-7.38 2.952h-3.672zm4.991-73.56c1.704 0 3.264.312 4.68.936a10.13 10.13 0 013.6 2.628c.984 1.128 1.752 2.496 2.304 4.104.552 1.608.828 3.384.828 5.328 0 1.944-.276 3.708-.828 5.292-.552 1.608-1.32 2.976-2.304 4.104a10.572 10.572 0 01-3.6 2.628c-1.416.624-2.976.936-4.68.936-1.704 0-3.252-.312-4.644-.936a10.13 10.13 0 01-3.6-2.628c-1.008-1.128-1.788-2.496-2.34-4.104-.552-1.584-.828-3.348-.828-5.292s.276-3.72.828-5.328c.552-1.608 1.32-2.976 2.304-4.104a10.13 10.13 0 013.6-2.628c1.416-.624 2.976-.936 4.68-.936zm0 5.04c-1.776 0-3.168.708-4.176 2.124-1.032 1.416-1.548 3.36-1.548 5.832 0 2.424.516 4.344 1.548 5.76 1.032 1.44 2.424 2.16 4.176 2.16 1.752 0 3.144-.72 4.176-2.16 1.032-1.416 1.548-3.336 1.548-5.76 0-2.472-.504-4.416-1.512-5.832-1.032-1.416-2.436-2.124-4.212-2.124zm-4.991-27.48V144h5.832v19.296l5.22-2.088v5.04l-7.38 2.952h-3.672zm4.991-73.56c1.704 0 3.264.312 4.68.936a10.13 10.13 0 013.6 2.628c.984 1.128 1.752 2.496 2.304 4.104.552 1.608.828 3.384.828 5.328 0 1.944-.276 3.708-.828 5.292-.552 1.608-1.32 2.976-2.304 4.104a10.572 10.572 0 01-3.6 2.628c-1.416.624-2.976.936-4.68.936-1.704 0-3.252-.312-4.644-.936a10.13 10.13 0 01-3.6-2.628c-1.008-1.128-1.788-2.496-2.34-4.104-.552-1.584-.828-3.348-.828-5.292s.276-3.72.828-5.328c.552-1.608 1.32-2.976 2.304-4.104a10.13 10.13 0 013.6-2.628c1.416-.624 2.976-.936 4.68-.936zm0 5.04c-1.776 0-3.168.708-4.176 2.124-1.032 1.416-1.548 3.36-1.548 5.832 0 2.424.516 4.344 1.548 5.76 1.032 1.44 2.424 2.16 4.176 2.16 1.752 0 3.144-.72 4.176-2.16 1.032-1.416 1.548-3.336 1.548-5.76 0-2.472-.504-4.416-1.512-5.832-1.032-1.416-2.436-2.124-4.212-2.124zM39.515 73.2V48h5.832v19.296l5.22-2.088v5.04l-7.38 2.952h-3.672zM44.506-.36c1.704 0 3.264.312 4.68.936a10.13 10.13 0 013.6 2.628c.984 1.128 1.752 2.496 2.304 4.104.552 1.608.828 3.384.828 5.328 0 1.944-.276 3.708-.828 5.292-.552 1.608-1.32 2.976-2.304 4.104a10.572 10.572 0 01-3.6 2.628c-1.416.624-2.976.936-4.68.936-1.704 0-3.252-.312-4.644-.936a10.13 10.13 0 01-3.6-2.628c-1.008-1.128-1.788-2.496-2.34-4.104-.552-1.584-.828-3.348-.828-5.292s.276-3.72.828-5.328c.552-1.608 1.32-2.976 2.304-4.104a10.13 10.13 0 013.6-2.628c1.416-.624 2.976-.936 4.68-.936zm0 5.04c-1.776 0-3.168.708-4.176 2.124-1.032 1.416-1.548 3.36-1.548 5.832 0 2.424.516 4.344 1.548 5.76 1.032 1.44 2.424 2.16 4.176 2.16 1.752 0 3.144-.72 4.176-2.16 1.032-1.416 1.548-3.336 1.548-5.76 0-2.472-.504-4.416-1.512-5.832-1.032-1.416-2.436-2.124-4.212-2.124zM39.515-22.8V-48h5.832v19.296l5.22-2.088v5.04l-7.38 2.952h-3.672zm4.991-73.56c1.704 0 3.264.312 4.68.936a10.13 10.13 0 013.6 2.628c.984 1.128 1.752 2.496 2.304 4.104.552 1.608.828 3.384.828 5.328 0 1.944-.276 3.708-.828 5.292-.552 1.608-1.32 2.976-2.304 4.104a10.572 10.572 0 01-3.6 2.628c-1.416.624-2.976.936-4.68.936-1.704 0-3.252-.312-4.644-.936a10.13 10.13 0 01-3.6-2.628c-1.008-1.128-1.788-2.496-2.34-4.104-.552-1.584-.828-3.348-.828-5.292s.276-3.72.828-5.328c.552-1.608 1.32-2.976 2.304-4.104a10.13 10.13 0 013.6-2.628c1.416-.624 2.976-.936 4.68-.936zm0 5.04c-1.776 0-3.168.708-4.176 2.124-1.032 1.416-1.548 3.36-1.548 5.832 0 2.424.516 4.344 1.548 5.76 1.032 1.44 2.424 2.16 4.176 2.16 1.752 0 3.144-.72 4.176-2.16 1.032-1.416 1.548-3.336 1.548-5.76 0-2.472-.504-4.416-1.512-5.832-1.032-1.416-2.436-2.124-4.212-2.124zm-4.991-27.48V-144h5.832v19.296l5.22-2.088v5.04l-7.38 2.952h-3.672zM6.515 361.2V336h5.832v19.296l5.22-2.088v5.04l-7.38 2.952H6.515zm4.991-73.56c1.704 0 3.264.312 4.68.936a10.13 10.13 0 013.6 2.628c.984 1.128 1.752 2.496 2.304 4.104.552 1.608.828 3.384.828 5.328 0 1.944-.276 3.708-.828 5.292-.552 1.608-1.32 2.976-2.304 4.104a10.572 10.572 0 01-3.6 2.628c-1.416.624-2.976.936-4.68.936-1.704 0-3.252-.312-4.644-.936a10.13 10.13 0 01-3.6-2.628c-1.008-1.128-1.788-2.496-2.34-4.104-.552-1.584-.828-3.348-.828-5.292s.276-3.72.828-5.328c.552-1.608 1.32-2.976 2.304-4.104a10.13 10.13 0 013.6-2.628c1.416-.624 2.976-.936 4.68-.936zm0 5.04c-1.776 0-3.168.708-4.176 2.124-1.032 1.416-1.548 3.36-1.548 5.832 0 2.424.516 4.344 1.548 5.76 1.032 1.44 2.424 2.16 4.176 2.16 1.752 0 3.144-.72 4.176-2.16 1.032-1.416 1.548-3.336 1.548-5.76 0-2.472-.504-4.416-1.512-5.832-1.032-1.416-2.436-2.124-4.212-2.124zM6.515 265.2V240h5.832v19.296l5.22-2.088v5.04l-7.38 2.952H6.515zm4.991-73.56c1.704 0 3.264.312 4.68.936a10.13 10.13 0 013.6 2.628c.984 1.128 1.752 2.496 2.304 4.104.552 1.608.828 3.384.828 5.328 0 1.944-.276 3.708-.828 5.292-.552 1.608-1.32 2.976-2.304 4.104a10.572 10.572 0 01-3.6 2.628c-1.416.624-2.976.936-4.68.936-1.704 0-3.252-.312-4.644-.936a10.13 10.13 0 01-3.6-2.628c-1.008-1.128-1.788-2.496-2.34-4.104-.552-1.584-.828-3.348-.828-5.292s.276-3.72.828-5.328c.552-1.608 1.32-2.976 2.304-4.104a10.13 10.13 0 013.6-2.628c1.416-.624 2.976-.936 4.68-.936zm0 5.04c-1.776 0-3.168.708-4.176 2.124-1.032 1.416-1.548 3.36-1.548 5.832 0 2.424.516 4.344 1.548 5.76 1.032 1.44 2.424 2.16 4.176 2.16 1.752 0 3.144-.72 4.176-2.16 1.032-1.416 1.548-3.336 1.548-5.76 0-2.472-.504-4.416-1.512-5.832-1.032-1.416-2.436-2.124-4.212-2.124zM6.515 169.2V144h5.832v19.296l5.22-2.088v5.04l-7.38 2.952H6.515zm4.991-73.56c1.704 0 3.264.312 4.68.936a10.13 10.13 0 013.6 2.628c.984 1.128 1.752 2.496 2.304 4.104.552 1.608.828 3.384.828 5.328 0 1.944-.276 3.708-.828 5.292-.552 1.608-1.32 2.976-2.304 4.104a10.572 10.572 0 01-3.6 2.628c-1.416.624-2.976.936-4.68.936-1.704 0-3.252-.312-4.644-.936a10.13 10.13 0 01-3.6-2.628c-1.008-1.128-1.788-2.496-2.34-4.104-.552-1.584-.828-3.348-.828-5.292s.276-3.72.828-5.328c.552-1.608 1.32-2.976 2.304-4.104a10.13 10.13 0 013.6-2.628c1.416-.624 2.976-.936 4.68-.936zm0 5.04c-1.776 0-3.168.708-4.176 2.124-1.032 1.416-1.548 3.36-1.548 5.832 0 2.424.516 4.344 1.548 5.76 1.032 1.44 2.424 2.16 4.176 2.16 1.752 0 3.144-.72 4.176-2.16 1.032-1.416 1.548-3.336 1.548-5.76 0-2.472-.504-4.416-1.512-5.832-1.032-1.416-2.436-2.124-4.212-2.124zM6.515 73.2V48h5.832v19.296l5.22-2.088v5.04l-7.38 2.952H6.515zM11.506-.36c1.704 0 3.264.312 4.68.936a10.13 10.13 0 013.6 2.628c.984 1.128 1.752 2.496 2.304 4.104.552 1.608.828 3.384.828 5.328 0 1.944-.276 3.708-.828 5.292-.552 1.608-1.32 2.976-2.304 4.104a10.572 10.572 0 01-3.6 2.628c-1.416.624-2.976.936-4.68.936-1.704 0-3.252-.312-4.644-.936a10.13 10.13 0 01-3.6-2.628c-1.008-1.128-1.788-2.496-2.34-4.104C.37 16.344.094 14.58.094 12.636s.276-3.72.828-5.328c.552-1.608 1.32-2.976 2.304-4.104a10.13 10.13 0 013.6-2.628c1.416-.624 2.976-.936 4.68-.936zm0 5.04c-1.776 0-3.168.708-4.176 2.124-1.032 1.416-1.548 3.36-1.548 5.832 0 2.424.516 4.344 1.548 5.76 1.032 1.44 2.424 2.16 4.176 2.16 1.752 0 3.144-.72 4.176-2.16 1.032-1.416 1.548-3.336 1.548-5.76 0-2.472-.504-4.416-1.512-5.832-1.032-1.416-2.436-2.124-4.212-2.124zM6.515-22.8V-48h5.832v19.296l5.22-2.088v5.04l-7.38 2.952H6.515zm4.991-73.56c1.704 0 3.264.312 4.68.936a10.13 10.13 0 013.6 2.628c.984 1.128 1.752 2.496 2.304 4.104.552 1.608.828 3.384.828 5.328 0 1.944-.276 3.708-.828 5.292-.552 1.608-1.32 2.976-2.304 4.104a10.572 10.572 0 01-3.6 2.628c-1.416.624-2.976.936-4.68.936-1.704 0-3.252-.312-4.644-.936a10.13 10.13 0 01-3.6-2.628c-1.008-1.128-1.788-2.496-2.34-4.104C.37-79.656.094-81.42.094-83.364s.276-3.72.828-5.328c.552-1.608 1.32-2.976 2.304-4.104a10.13 10.13 0 013.6-2.628c1.416-.624 2.976-.936 4.68-.936zm0 5.04c-1.776 0-3.168.708-4.176 2.124-1.032 1.416-1.548 3.36-1.548 5.832 0 2.424.516 4.344 1.548 5.76 1.032 1.44 2.424 2.16 4.176 2.16 1.752 0 3.144-.72 4.176-2.16 1.032-1.416 1.548-3.336 1.548-5.76 0-2.472-.504-4.416-1.512-5.832-1.032-1.416-2.436-2.124-4.212-2.124zM6.515-118.8V-144h5.832v19.296l5.22-2.088v5.04l-7.38 2.952H6.515z" - > + /> - ) -} + ); +}; -export default Binary +export default Binary; diff --git a/components/$-minority-earned/MinorityEarned.js b/components/$-minority-earned/MinorityEarned.js index dc139c67..b561f0ea 100644 --- a/components/$-minority-earned/MinorityEarned.js +++ b/components/$-minority-earned/MinorityEarned.js @@ -1,16 +1,15 @@ -import React from 'react' -import HomepageNav from '../HomepageNav' -import MinorityEarnedHeader from './MinorityEarnedHeader' -import MinorityEarnedActions from './MinorityEarnedActions' -import ProposalBox from './ProposalBox' - -const MinorityEarned = () => { +import React from 'react'; +import HomepageNav from '../HomepageNav'; +import MinorityEarnedHeader from './MinorityEarnedHeader'; +import MinorityEarnedActions from './MinorityEarnedActions'; +import ProposalBox from './ProposalBox'; +const MinorityEarned = function () { const styling = { - background: "linear-gradient(90deg, #FF00B8 0%, #FF655B 50.8%, #FFC700 100%)", + background: 'linear-gradient(90deg, #FF00B8 0%, #FF655B 50.8%, #FFC700 100%)', height: 'auto', - display: 'flex' - } + display: 'flex', + }; return (
@@ -20,7 +19,7 @@ const MinorityEarned = () => {
- ) -} + ); +}; -export default MinorityEarned +export default MinorityEarned; diff --git a/components/$-minority-earned/MinorityEarnedActions.js b/components/$-minority-earned/MinorityEarnedActions.js index 04981019..9dc68cc3 100644 --- a/components/$-minority-earned/MinorityEarnedActions.js +++ b/components/$-minority-earned/MinorityEarnedActions.js @@ -1,164 +1,161 @@ -import React, { useState, useEffect, Fragment } from 'react' -import Action from './Action' -import Pagination from './Pagination' -import NoData from './NoData' -import Loader from '../Loader' - -const MinorityEarnedActions = () => { - const [actions, setActions] = useState([]) - const [currentPage, setCurrentPage] = useState(1) - const [actionsPerPage] = useState(5) - const [sortType, setSortType] = useState('Sort By') - const [filter, setFilter] = useState('all') - const [categories, setCategories] = useState([]) - const [allData, setAllData] = useState([]) - const [loading, setLoading] = useState(false) +import React, { useState, useEffect, Fragment } from 'react'; +import Action from './Action'; +import Pagination from './Pagination'; +import NoData from './NoData'; +import Loader from '../Loader'; + +const MinorityEarnedActions = function () { + const [actions, setActions] = useState([]); + const [currentPage, setCurrentPage] = useState(1); + const [actionsPerPage] = useState(5); + const [sortType, setSortType] = useState('Sort By'); + const [filter, setFilter] = useState('all'); + const [categories, setCategories] = useState([]); + const [allData, setAllData] = useState([]); + const [loading, setLoading] = useState(false); useEffect(() => { - filterArray() - }, [filter]) + filterArray(); + }, [filter]); useEffect(() => { - sortArray(sortType) - }, [sortType]) + sortArray(sortType); + }, [sortType]); useEffect(() => { - - let uniqueCategories = [] - const allCategories = [] + let uniqueCategories = []; + const allCategories = []; // Fetch the action data. Set loading state to true before fetch, back to false after the fetch is complete const fetchData = () => { - - setLoading(true) + setLoading(true); fetch('https://koinstreet-learn-api.herokuapp.com/api/v1/minority_earned/') - .then(response => response.json()) - .then((response) => { - setAllData(response.data.reverse()) - setActions(response.data) - setLoading(false) - - // Set unique categories for filter dropdown - response.data.map((action) => { - allCategories.push(action.category) - }) - uniqueCategories = [...new Set(allCategories)] - setCategories(uniqueCategories) - }) - } - - fetchData() - - }, []) - -// Function to sort the actions by amount or date - const sortArray = type => { + .then((response) => response.json()) + .then((response) => { + setAllData(response.data.reverse()); + setActions(response.data); + setLoading(false); + + // Set unique categories for filter dropdown + response.data.map((action) => { + allCategories.push(action.category); + }); + uniqueCategories = [...new Set(allCategories)]; + setCategories(uniqueCategories); + }); + }; + + fetchData(); + }, []); + + // Function to sort the actions by amount or date + const sortArray = (type) => { const types = { amountAsc: 'amount', amountDesc: 'amount', - date: 'date' - } + date: 'date', + }; - const sortProperty = types[type] + const sortProperty = types[type]; if (sortType == 'amountAsc') { - const sorted = [...actions].sort((a,b) => a[sortProperty] - b[sortProperty]) - setActions(sorted) + const sorted = [...actions].sort((a, b) => a[sortProperty] - b[sortProperty]); + setActions(sorted); } else if (sortType == 'amountDesc') { - const sorted = [...actions].sort((a,b) => b[sortProperty] - a[sortProperty]) - setActions(sorted) + const sorted = [...actions].sort((a, b) => b[sortProperty] - a[sortProperty]); + setActions(sorted); } else if (sortType == 'date') { - const sorted = [...actions].sort((a,b) => new Date(a[sortProperty]) - new Date(b[sortProperty])) - setActions(sorted) + const sorted = [...actions].sort((a, b) => new Date(a[sortProperty]) - new Date(b[sortProperty])); + setActions(sorted); } else { - setActions(allData) + setActions(allData); } - } + }; // Filter the array, sets current page back to 1 after filtering const filterArray = () => { - setCurrentPage(1) + setCurrentPage(1); if (filter != 'all') { - for(let i = 0; i < categories.length; i++) { - if(filter == categories[i]) { - const filtered = [...allData].filter(action => action.category == categories[i]) - setActions(filtered) - } + for (let i = 0; i < categories.length; i++) { + if (filter == categories[i]) { + const filtered = [...allData].filter((action) => action.category == categories[i]); + setActions(filtered); + } } } else { - setActions(allData) + setActions(allData); } - } + }; // Get current actions const indexOfLastAction = currentPage * actionsPerPage; const indexOfFirstAction = indexOfLastAction - actionsPerPage; - const currentActions = actions.slice(indexOfFirstAction, indexOfLastAction) + const currentActions = actions.slice(indexOfFirstAction, indexOfLastAction); // Change page const paginate = (pageNumber) => setCurrentPage(pageNumber); - + const nextPage = (currentPage) => { - if(currentPage === Math.ceil(actions.length / actionsPerPage)) { - return + if (currentPage === Math.ceil(actions.length / actionsPerPage)) { + return; } - setCurrentPage(currentPage + 1) - } + setCurrentPage(currentPage + 1); + }; const previousPage = () => { - if(currentPage === 1) { - return + if (currentPage === 1) { + return; } - setCurrentPage(currentPage - 1) - } + setCurrentPage(currentPage - 1); + }; - if (loading) { return ( -
+
- ) + ); } return ( -
= 1 ? '': ' small'}`}> - - {allData.length >= 1 && loading != true ? - -
- - - - -
- - - -
- : } - - +
= 1 ? '' : ' small'}`}> + + {allData.length >= 1 && loading != true + ? ( + <> +
+ + + + +
+ + + + + ) + : } +
- ) -} + ); +}; -export default MinorityEarnedActions +export default MinorityEarnedActions; diff --git a/components/$-minority-earned/MinorityEarnedHeader.js b/components/$-minority-earned/MinorityEarnedHeader.js index dd4832d1..c7a46251 100644 --- a/components/$-minority-earned/MinorityEarnedHeader.js +++ b/components/$-minority-earned/MinorityEarnedHeader.js @@ -1,8 +1,6 @@ -import React from 'react' - -const MinorityEarnedHeader = () => { - +import React from 'react'; +const MinorityEarnedHeader = function () { return (
@@ -10,7 +8,7 @@ const MinorityEarnedHeader = () => {

Check your $ Minority earned through different actions.

- ) -} + ); +}; -export default MinorityEarnedHeader +export default MinorityEarnedHeader; diff --git a/components/$-minority-earned/NoData.js b/components/$-minority-earned/NoData.js index 33a3c9e1..9b431154 100644 --- a/components/$-minority-earned/NoData.js +++ b/components/$-minority-earned/NoData.js @@ -1,12 +1,12 @@ -import React from 'react' +import React from 'react'; -const NoData = () => { +const NoData = function () { return (

Sorry, you have no $ Minority Earned yet!

Check back after you completed some actions!

- ) -} + ); +}; -export default NoData +export default NoData; diff --git a/components/$-minority-earned/Pagination.js b/components/$-minority-earned/Pagination.js index b31da0ae..d85b0815 100644 --- a/components/$-minority-earned/Pagination.js +++ b/components/$-minority-earned/Pagination.js @@ -1,33 +1,35 @@ -import React from 'react' +import React from 'react'; -const Pagination = ({actionsPerPage, totalActions, paginate, currentPage, nextPage, previousPage}) => { +const Pagination = function ({ + actionsPerPage, totalActions, paginate, currentPage, nextPage, previousPage, +}) { const pageNumbers = []; - for(let i = 1; i <= Math.ceil(totalActions / actionsPerPage); i++) { - pageNumbers.push(i) + for (let i = 1; i <= Math.ceil(totalActions / actionsPerPage); i++) { + pageNumbers.push(i); } - let maxPage = Math.ceil(totalActions / actionsPerPage); + const maxPage = Math.ceil(totalActions / actionsPerPage); return ( - ) -} + ); +}; -export default Pagination +export default Pagination; diff --git a/components/$-minority-earned/ProposalBox.js b/components/$-minority-earned/ProposalBox.js index 6ee1fd5f..a5180207 100644 --- a/components/$-minority-earned/ProposalBox.js +++ b/components/$-minority-earned/ProposalBox.js @@ -1,8 +1,7 @@ -import React, {useState} from 'react' -import Binary from './Binary' - -const ProposalBox = () => { +import React, { useState } from 'react'; +import Binary from './Binary'; +const ProposalBox = function () { const [myProposals, setMyProposals] = useState(92); const [otherActions, setOtherActions] = useState(60); const [spent, setSpent] = useState(12); @@ -10,13 +9,17 @@ const ProposalBox = () => { return (
- +
-

Go Back to My Proposals.

+

+ Go Back to + My Proposals + . +

@@ -24,24 +27,43 @@ const ProposalBox = () => {
-
- +
-

$ Minority earned through My Proposals - {myProposals}

-

$ Minority earned through Other Actions - {otherActions}

-

$ Minority Spent over 2 months - {spent}

+

+ $ Minority earned through + My Proposals + {' '} + - + {myProposals} +

+

+ $ Minority earned through + Other Actions + {' '} + - + {otherActions} +

+

+ $ Minority + Spent + {' '} + over 2 months - + {spent} +

-

Total net $ Minority - {total}

+

+ Total net $ Minority - + {total} +

-
- ) -} + ); +}; -export default ProposalBox +export default ProposalBox; diff --git a/components/404.js b/components/404.js index 89c3d815..68f13e89 100644 --- a/components/404.js +++ b/components/404.js @@ -1,14 +1,13 @@ -import React from "react"; -import Link from "next/link"; -import { useEffect } from "react"; -import { useRouter } from "next/router"; +import React, { useEffect } from 'react'; +import Link from 'next/link'; +import { useRouter } from 'next/router'; -const NotFound = () => { +const NotFound = function () { const router = useRouter(); - //Redirects to homepage after 3 sec. + // Redirects to homepage after 3 sec. useEffect(() => { const timer = setTimeout(() => { - router.push("/"); + router.push('/'); }, 5000); return () => clearTimeout(timer); }, []); @@ -24,7 +23,7 @@ const NotFound = () => {

Error code: 404

diff --git a/components/AboutOne.js b/components/AboutOne.js index 03f955c2..e3951b86 100644 --- a/components/AboutOne.js +++ b/components/AboutOne.js @@ -1,80 +1,86 @@ -import React, { Component } from "react"; -import CountUp from "react-countup"; -import VisibilitySensor from "react-visibility-sensor"; - -class AboutOne extends Component { - constructor() { - super(); - this.state = { - startCounter: false, - }; - } - - onVisibilityChange = (isVisible) => { - if (isVisible) { - this.setState({ startCounter: true }); - } - }; - - render() { - return ( -
- -
-
-

- Let’s study with
- expert instructors -

-
-
-
-
- -
-
- -
-
-
-

- - - -

-
- - - - - -
-

students love us

-
-
-

- There are many variations of passages of lorem ipsum available, but - the majority have -
- suffered alteration in some form, by injected humour words which - don't look even slightly
believable. Lorem Ipsn gravida nibh - vel velit auctor aliquetn auci elit cons. -

- - Start Learning Now - -
-
- ); - } -} - -export default AboutOne; +import React, { Component } from 'react'; +import CountUp from 'react-countup'; +import VisibilitySensor from 'react-visibility-sensor'; + +class AboutOne extends Component { + constructor() { + super(); + this.state = { + startCounter: false, + }; + } + + onVisibilityChange = (isVisible) => { + if (isVisible) { + this.setState({ startCounter: true }); + } + }; + + render() { + return ( +
+ +
+
+

+ Let’s study with + {' '} +
+ expert instructors +

+
+
+
+
+ +
+
+ +
+
+
+

+ + + +

+
+ + + + + +
+

students love us

+
+
+

+ There are many variations of passages of lorem ipsum available, but + the majority have +
+ suffered alteration in some form, by injected humour words which + don't look even slightly + {' '} +
+ {' '} + believable. Lorem Ipsn gravida nibh + vel velit auctor aliquetn auci elit cons. +

+ + Start Learning Now + +
+
+ ); + } +} + +export default AboutOne; diff --git a/components/AboutTwo.js b/components/AboutTwo.js index e841cc68..05212ad1 100644 --- a/components/AboutTwo.js +++ b/components/AboutTwo.js @@ -1,82 +1,86 @@ -import React, { Component } from "react"; -import CountUp from "react-countup"; -import VisibilitySensor from "react-visibility-sensor"; - -export default class AboutTwo extends Component { - constructor() { - super(); - this.state = { - startCounter: false, - }; - } - - onVisibilityChange = (isVisible) => { - if (isVisible) { - this.setState({ startCounter: true }); - } - }; - - render() { - return ( -
-
-
-
-
-
-

- An international
network of programmers -

-
-

- Teaching, mentoring, learning STEM education. -

-
-
-
- -
-
-

Learn to code

-
-
-
-
- -
-
-

Grow your skills

-
-
-
- - Grow Today - -
-
-
-
- - -
-
- Members Worldwide - - - - - -
-
-
-
-
-
-
- ); - } -} +import React, { Component } from 'react'; +import CountUp from 'react-countup'; +import VisibilitySensor from 'react-visibility-sensor'; + +export default class AboutTwo extends Component { + constructor() { + super(); + this.state = { + startCounter: false, + }; + } + + onVisibilityChange = (isVisible) => { + if (isVisible) { + this.setState({ startCounter: true }); + } + }; + + render() { + return ( +
+
+
+
+
+
+

+ An international + {' '} +
+ {' '} + network of programmers +

+
+

+ Teaching, mentoring, learning STEM education. +

+
+
+
+ +
+
+

Learn to code

+
+
+
+
+ +
+
+

Grow your skills

+
+
+
+ + Grow Today + +
+
+
+
+ + +
+
+ Members Worldwide + + + + + +
+
+
+
+
+
+
+ ); + } +} diff --git a/components/Account.jsx b/components/Account.jsx index 90cd16a0..9ade085e 100644 --- a/components/Account.jsx +++ b/components/Account.jsx @@ -1,29 +1,30 @@ -import { useState } from "react"; -import { useMoralis } from "react-moralis"; -import { Button, Card, Modal } from "antd"; -import { SelectOutlined } from "@ant-design/icons"; -import { useMoralisDapp } from "../MoralisDappProvider/MoralisDappProvider"; -import { getEllipsisTxt } from "../helpers/formatters"; -import Address from "./Address/Address"; -import { getExplorer } from "../helpers/networks"; +import { useState } from 'react'; +import { useMoralis } from 'react-moralis'; +import { Button, Card, Modal } from 'antd'; +import { SelectOutlined } from '@ant-design/icons'; +import { useMoralisDapp } from '../MoralisDappProvider/MoralisDappProvider'; +import { getEllipsisTxt } from '../helpers/formatters'; +import Address from './Address/Address'; +import { getExplorer } from '../helpers/networks'; + const styles = { account: { - height: "20px", - padding: "0 10px", - display: "flex", - justifyContent: "center", - alignItems: "center", - width: "fit-content", - borderRadius: "5px", - backgroundColor: "rgb(244, 244, 244)", - cursor: "pointer", + height: '20px', + padding: '0 10px', + display: 'flex', + justifyContent: 'center', + alignItems: 'center', + width: 'fit-content', + borderRadius: '5px', + backgroundColor: 'rgb(244, 244, 244)', + cursor: 'pointer', }, text: { - color: "#21BF96", + color: '#21BF96', }, }; -const Account = () => { +const Account = function () { const { authenticate, isAuthenticated, logout } = useMoralis(); const { walletAddress, chainId } = useMoralisDapp(); const [isModalVisible, setIsModalVisible] = useState(false); @@ -34,7 +35,7 @@ const Account = () => { return (
authenticate({ signingMessage: "connected!" })} + onClick={() => authenticate({ signingMessage: 'connected!' })} >

Connect wallet

@@ -51,34 +52,34 @@ const Account = () => { footer={null} onCancel={() => setIsModalVisible(false)} bodyStyle={{ - padding: "15px", - fontSize: "17px", - fontWeight: "500", + padding: '15px', + fontSize: '17px', + fontWeight: '500', }} - style={{ fontSize: "16px", fontWeight: "500", zIndex: "100" }} + style={{ fontSize: '16px', fontWeight: '500', zIndex: '100' }} width="400px" > Account
-
+ @@ -87,11 +88,11 @@ const Account = () => { size="large" type="primary" style={{ - width: "100%", - marginTop: "10px", - borderRadius: "0.5rem", - fontSize: "16px", - fontWeight: "500", + width: '100%', + marginTop: '10px', + borderRadius: '0.5rem', + fontSize: '16px', + fontWeight: '500', }} onClick={() => { logout(); diff --git a/components/Address/Address.jsx b/components/Address/Address.jsx index 3fbab018..a4afce86 100644 --- a/components/Address/Address.jsx +++ b/components/Address/Address.jsx @@ -1,21 +1,20 @@ -import { useEffect } from "react"; -import { useState } from "react"; -import { useMoralisDapp } from "../../MoralisDappProvider/MoralisDappProvider"; -import { getEllipsisTxt } from "../../helpers/formatters"; -import Blockie from "../Blockie"; +import { useEffect, useState } from 'react'; +import { useMoralisDapp } from '../../MoralisDappProvider/MoralisDappProvider'; +import { getEllipsisTxt } from '../../helpers/formatters'; +import Blockie from '../Blockie'; const styles = { address: { - height: "36px", - display: "flex", - gap: "5px", - backgroundColor: "rgba(255, 255, 255, 0.1)", - borderRadius: "9px", - alignItems: "center", + height: '36px', + display: 'flex', + gap: '5px', + backgroundColor: 'rgba(255, 255, 255, 0.1)', + borderRadius: '9px', + alignItems: 'center', }, }; -function Address(props) { +const Address = function (props) { const { walletAddress } = useMoralisDapp(); const [address, setAddress] = useState(); const [isClicked, setIsClicked] = useState(false); @@ -26,56 +25,60 @@ function Address(props) { if (!address) return null; - const Copy = () => ( - { - navigator.clipboard.writeText(address); - setIsClicked(true); - }} - > - - - - - Copy Address - - ); + const Copy = function () { + return ( + { + navigator.clipboard.writeText(address); + setIsClicked(true); + }} + > + + + + + Copy Address + + ); + }; return (
- {props.avatar === "left" && } + {props.avatar === 'left' && }

{props.size ? getEllipsisTxt(address, props.size) : address}

- {props.avatar === "right" && } + {props.avatar === 'right' && } {props.copyable && (isClicked ? : )}
); -} +}; export default Address; -const Check = () => ( - - - - Copied! - -); +const Check = function () { + return ( + + + + Copied! + + ); +}; diff --git a/components/AllyCard.js b/components/AllyCard.js index eb6d0831..9fa515a3 100644 --- a/components/AllyCard.js +++ b/components/AllyCard.js @@ -1,9 +1,9 @@ -import React from "react"; +import React from 'react'; -const AllyCard = (props) => { +const AllyCard = function (props) { return ( diff --git a/components/ApprovedProposals.js b/components/ApprovedProposals.js index 0169f8e4..314d025b 100644 --- a/components/ApprovedProposals.js +++ b/components/ApprovedProposals.js @@ -1,15 +1,13 @@ -import { FaSortUp } from "react-icons/fa"; -import { FaSortDown } from "react-icons/fa"; -import Link from "next/link"; -import approvedproposal from "../components/ProjectManager/approvedproposal.json"; -import { useState } from "react"; -import { useEffect } from "react"; +import { FaSortUp, FaSortDown } from 'react-icons/fa'; +import Link from 'next/link'; +import { useState, useEffect } from 'react'; +import approvedproposal from './ProjectManager/approvedproposal.json'; // Currently using JSON data for dynamic loading // After completing backend JSON should be removed and Proposals data will be loading- // through getStaticProps function instead of useEffect hooks export const getStaticProps = async () => { - const res = await fetch("http://localhost:3000/getProposalsdata"); + const res = await fetch('http://localhost:3000/getProposalsdata'); const data = await res.json(); return { @@ -19,7 +17,7 @@ export const getStaticProps = async () => { }; }; -const ApprovedProposals = () => { +const ApprovedProposals = function () { const [proposals, setProposals] = useState([]); const [votes, setVotes] = useState(0); // This votes should ve post to database as API and will be shown on page loading from DB through API @@ -28,14 +26,14 @@ const ApprovedProposals = () => { }, []); useEffect(() => { - fetch("http://localhost:3000/addVote", { - method: "POST", - headers: { "Content-Type": "application/json" }, + fetch('http://localhost:3000/addVote', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(votes), }) .then((response) => response.json()) .then((data) => { - console.log("saved to server"); + console.log('saved to server'); }) .catch((error) => { console.error(error); @@ -54,10 +52,14 @@ const ApprovedProposals = () => {

- Type: {proposal.type} + Type: + {' '} + {proposal.type}

- Category: {proposal.category} + Category: + {' '} + {proposal.category}

diff --git a/components/AvatarMaker.js b/components/AvatarMaker.js index 0e6935c2..16e87730 100644 --- a/components/AvatarMaker.js +++ b/components/AvatarMaker.js @@ -1,6 +1,6 @@ -import React from "react"; +import React from 'react'; -const AvatarMaker = () => { +const AvatarMaker = function () { return (
{

- {" "} - Join
Blockchain
with your NFT + {' '} + Join + {' '} +
+ {' '} + Blockchain + {' '} +
+ {' '} + with your NFT

Create your own avatar!

-
+


@@ -33,8 +41,8 @@ const AvatarMaker = () => {
+ style={({ height: '600px' }, { width: '600px' })} + />

diff --git a/components/BecomeTeacher.js b/components/BecomeTeacher.js index 752ceaaa..c2bf5d7d 100644 --- a/components/BecomeTeacher.js +++ b/components/BecomeTeacher.js @@ -1,66 +1,66 @@ -import React from "react"; - -const BecomeTeacher = () => { - return ( -
-
-
-
-
-

Teaching benefits

-

- Lorem Ipsum is simply dummy text of the printing and type - industry. Lorem Ipsum has been the standard dummy text ever - since the when an unknown was popularised. It has survived not - only five centuries, but also the leap into electronic - typesetting remaining unchanged. -

-

Health and Pension

-

- Lorem Ipsum has been the standard dummy text ever since the when - an unknown was popularised. It has survived not only five - centuries. but also the leap into electronic typesetting - remaining unchanged. -

-

Vacation Time

-

- Lorem Ipsum has been the standard dummy text ever since the when - an unknown was popularised. It has survived not only five - centuries. but also the leap into electronic typesetting - remaining unchanged. -

-
-
-
-
-
-

- Apply for teaching -

-
-
- - - - - -
-
-
-
-
-
-
- ); -}; - -export default BecomeTeacher; +import React from 'react'; + +const BecomeTeacher = function () { + return ( +
+
+
+
+
+

Teaching benefits

+

+ Lorem Ipsum is simply dummy text of the printing and type + industry. Lorem Ipsum has been the standard dummy text ever + since the when an unknown was popularised. It has survived not + only five centuries, but also the leap into electronic + typesetting remaining unchanged. +

+

Health and Pension

+

+ Lorem Ipsum has been the standard dummy text ever since the when + an unknown was popularised. It has survived not only five + centuries. but also the leap into electronic typesetting + remaining unchanged. +

+

Vacation Time

+

+ Lorem Ipsum has been the standard dummy text ever since the when + an unknown was popularised. It has survived not only five + centuries. but also the leap into electronic typesetting + remaining unchanged. +

+
+
+
+
+
+

+ Apply for teaching +

+
+
+ + + + + +
+
+
+
+
+
+
+ ); +}; + +export default BecomeTeacher; diff --git a/components/BlackBanner.js b/components/BlackBanner.js index 53b17414..4cbc4ef8 100644 --- a/components/BlackBanner.js +++ b/components/BlackBanner.js @@ -1,9 +1,9 @@ -import React from "react"; +import React from 'react'; -const LegalBanner = (props) => { - let title = props.title; - let subtitle = props.subtitle; - let bannerImgLink = props.bannerImgLink; +const LegalBanner = function (props) { + const { title } = props; + const { subtitle } = props; + const { bannerImgLink } = props; return (
diff --git a/components/Blockie.jsx b/components/Blockie.jsx index c5784530..811bec4e 100644 --- a/components/Blockie.jsx +++ b/components/Blockie.jsx @@ -1,7 +1,7 @@ -import Blockies from "react-blockies"; -import { useMoralisDapp } from "../MoralisDappProvider/MoralisDappProvider"; +import Blockies from 'react-blockies'; +import { useMoralisDapp } from '../MoralisDappProvider/MoralisDappProvider'; -const Blockie = (props) => { +const Blockie = function (props) { const { walletAddress } = useMoralisDapp(); if ((!props.address && !props.currentWallet) || !walletAddress) return null; diff --git a/components/BlogThree.js b/components/BlogThree.js index b5c548f1..5b84c447 100644 --- a/components/BlogThree.js +++ b/components/BlogThree.js @@ -1,162 +1,165 @@ -import React from "react"; - -const BlogThree = () => { - return ( -
-
-
-

- Our latest news
& articles -

-
-
-
-
-
- - - - -
-
- -

- What Is A Software Engineer? -

-

- What exactly is a software engineer? -

- - Read More - -
-
-
-
-
-
- - - - -
-
- -

- - Do you need a degree in Computer Science? - -

-

- Do you need a degree in computer science. -

- - Read More - -
-
-
- -
-
-
- ); -}; - -export default BlogThree; +import React from 'react'; + +const BlogThree = function () { + return ( +
+
+
+

+ Our latest news + {' '} +
+ & articles +

+
+
+
+
+
+ + + + +
+
+ +

+ What Is A Software Engineer? +

+

+ What exactly is a software engineer? +

+ + Read More + +
+
+
+
+
+
+ + + + +
+
+ +

+ + Do you need a degree in Computer Science? + +

+

+ Do you need a degree in computer science. +

+ + Read More + +
+
+
+ +
+
+
+ ); +}; + +export default BlogThree; diff --git a/components/BlogTwo.js b/components/BlogTwo.js index 2e10137d..d10704e6 100644 --- a/components/BlogTwo.js +++ b/components/BlogTwo.js @@ -1,251 +1,254 @@ -import React from "react"; -import Swiper from "react-id-swiper"; -import "swiper/css/swiper.css"; - -const BlogTwo = () => { - const params = { - slidesPerView: 3, - loop: true, - speed: 1000, - spaceBetween: 30, - autoplay: { - delay: 3000, - disableOnInteraction: false, - }, - pagination: { - el: ".swiper-pagination", - clickable: true, - }, - - // Responsive breakpoints - breakpoints: { - 1024: { - slidesPerView: 3, - }, - 768: { - slidesPerView: 2, - }, - 640: { - slidesPerView: 1, - }, - 320: { - slidesPerView: 1, - }, - }, - }; - - return ( -
-
-
-

- Our latest news
& articles -

-
-
- - - - - - - - - - - -
-
-
- ); -}; -export default BlogTwo; +import React from 'react'; +import Swiper from 'react-id-swiper'; +import 'swiper/css/swiper.css'; + +const BlogTwo = function () { + const params = { + slidesPerView: 3, + loop: true, + speed: 1000, + spaceBetween: 30, + autoplay: { + delay: 3000, + disableOnInteraction: false, + }, + pagination: { + el: '.swiper-pagination', + clickable: true, + }, + + // Responsive breakpoints + breakpoints: { + 1024: { + slidesPerView: 3, + }, + 768: { + slidesPerView: 2, + }, + 640: { + slidesPerView: 1, + }, + 320: { + slidesPerView: 1, + }, + }, + }; + + return ( +
+
+
+

+ Our latest news + {' '} +
+ & articles +

+
+
+ + + + + + + + + + + +
+
+
+ ); +}; +export default BlogTwo; diff --git a/components/BrandCard.js b/components/BrandCard.js index 40c9f51f..ed71c034 100644 --- a/components/BrandCard.js +++ b/components/BrandCard.js @@ -1,9 +1,9 @@ -import React from "react"; +import React from 'react'; -const BrandCard = (props) => { +const BrandCard = function (props) { return ( diff --git a/components/BrandsOne.js b/components/BrandsOne.js index 41f4a863..263df46a 100644 --- a/components/BrandsOne.js +++ b/components/BrandsOne.js @@ -1,9 +1,9 @@ -import React from "react"; -import Swiper from "react-id-swiper"; -import "swiper/css/swiper.css"; -import BrandCard from "./BrandCard"; +import React from 'react'; +import Swiper from 'react-id-swiper'; +import 'swiper/css/swiper.css'; +import BrandCard from './BrandCard'; -const BrandsOne = () => { +const BrandsOne = function () { const params = { slidesPerView: 5, loop: true, @@ -33,21 +33,21 @@ const BrandsOne = () => { const Brands = [ { - brandLink: "https://www.accenture.com/", - imgSrc: "assets/images/accenture.png", + brandLink: 'https://www.accenture.com/', + imgSrc: 'assets/images/accenture.png', }, - { brandLink: "https://www.cgi.com/en", imgSrc: "assets/images/cgi.png" }, + { brandLink: 'https://www.cgi.com/en', imgSrc: 'assets/images/cgi.png' }, { - brandLink: "https://www.captechconsulting.com/", - imgSrc: "assets/images/caotech.png", + brandLink: 'https://www.captechconsulting.com/', + imgSrc: 'assets/images/caotech.png', }, { - brandLink: "https://www.jmu.edu/cise/cs/", - imgSrc: "assets/images/jmucs.png", + brandLink: 'https://www.jmu.edu/cise/cs/', + imgSrc: 'assets/images/jmucs.png', }, { - brandLink: "https://www.jmu.edu/cob/", - imgSrc: "assets/images/jmucob.png", + brandLink: 'https://www.jmu.edu/cob/', + imgSrc: 'assets/images/jmucob.png', }, ]; diff --git a/components/BrandsTwo.js b/components/BrandsTwo.js index 50ffe5d1..0dd2dc5c 100644 --- a/components/BrandsTwo.js +++ b/components/BrandsTwo.js @@ -1,9 +1,9 @@ -import React from "react"; -import AllyCard from "./AllyCard"; -import Swiper from "react-id-swiper"; -import "swiper/css/swiper.css"; +import React from 'react'; +import Swiper from 'react-id-swiper'; +import AllyCard from './AllyCard'; +import 'swiper/css/swiper.css'; -const BrandsTwo = () => { +const BrandsTwo = function () { const params = { slidesPerView: 5, loop: true, @@ -33,20 +33,20 @@ const BrandsTwo = () => { const AllyTile = [ { - allyLink: "https://mason360.gmu.edu/bam/", - imgSrc: "assets/images/brand-1-1.png", + allyLink: 'https://mason360.gmu.edu/bam/', + imgSrc: 'assets/images/brand-1-1.png', }, { - allyLink: "https://www.encode.club/", - imgSrc: "assets/images/encodeclub1.jpg", + allyLink: 'https://www.encode.club/', + imgSrc: 'assets/images/encodeclub1.jpg', }, - { allyLink: "https://aisnet.org/", imgSrc: "assets/images/ais.png" }, - { allyLink: "https://devpost.com/", imgSrc: "assets/images/devpost.png" }, + { allyLink: 'https://aisnet.org/', imgSrc: 'assets/images/ais.png' }, + { allyLink: 'https://devpost.com/', imgSrc: 'assets/images/devpost.png' }, { - allyLink: "https://thelastmile.org/", - imgSrc: "assets/images/lastmile.png", + allyLink: 'https://thelastmile.org/', + imgSrc: 'assets/images/lastmile.png', }, - { allyLink: "https://blockchainedu.org/", imgSrc: "assets/images/ben.png" }, + { allyLink: 'https://blockchainedu.org/', imgSrc: 'assets/images/ben.png' }, ]; return ( diff --git a/components/CallToActionFive.js b/components/CallToActionFive.js index 5129767a..cd41c18d 100644 --- a/components/CallToActionFive.js +++ b/components/CallToActionFive.js @@ -1,58 +1,60 @@ -import React from "react"; - -const CallToActionFive = () => { - return ( -
- - - - - - -
- -
-
- -
-
-

- Start growing with
- the community -

-

- Duis aute irure dolor in reprehenderit in velit esse -

- - Learn More - -
-
- ); -}; - -export default CallToActionFive; +import React from 'react'; + +const CallToActionFive = function () { + return ( +
+ + + + + + +
+ +
+
+ +
+
+

+ Start growing with + {' '} +
+ the community +

+

+ Duis aute irure dolor in reprehenderit in velit esse +

+ + Learn More + +
+
+ ); +}; + +export default CallToActionFive; diff --git a/components/CallToActionFour.js b/components/CallToActionFour.js index 97e7cdb1..8c35e3c2 100644 --- a/components/CallToActionFour.js +++ b/components/CallToActionFour.js @@ -1,32 +1,34 @@ -import React from "react"; - -const CallToActionFour = () => { - return ( -
- - -
-
-

- We’ve got the best talent
- across all IT specializations -

-
-

- We teach the relevant industry leading technologies, while building - the career of everyone of our members. -

-
-
- ); -}; - -export default CallToActionFour; +import React from 'react'; + +const CallToActionFour = function () { + return ( +
+ + +
+
+

+ We’ve got the best talent + {' '} +
+ across all IT specializations +

+
+

+ We teach the relevant industry leading technologies, while building + the career of everyone of our members. +

+
+
+ ); +}; + +export default CallToActionFour; diff --git a/components/CallToActionOne.js b/components/CallToActionOne.js index 3fe91663..451046df 100644 --- a/components/CallToActionOne.js +++ b/components/CallToActionOne.js @@ -1,24 +1,24 @@ -import React from "react"; - -const CallToActionOne = () => { - return ( -
-
-

- Minority Programmers empower communities through STEM education, - entrepnuership, and job placement. -

- -
-
- ); -}; - -export default CallToActionOne; +import React from 'react'; + +const CallToActionOne = function () { + return ( +
+
+

+ Minority Programmers empower communities through STEM education, + entrepnuership, and job placement. +

+ +
+
+ ); +}; + +export default CallToActionOne; diff --git a/components/CallToActionSix.js b/components/CallToActionSix.js index 3e9f91fc..811b74a9 100644 --- a/components/CallToActionSix.js +++ b/components/CallToActionSix.js @@ -1,58 +1,61 @@ -import React, { Component } from "react"; -import CountUp from "react-countup"; -import VisibilitySensor from "react-visibility-sensor"; - -class CallToActionSix extends Component { - constructor() { - super(); - this.state = { - startCounter: false, - }; - } - onVisibilityChange = (isVisible) => { - if (isVisible) { - this.setState({ startCounter: true }); - } - }; - - render() { - return ( -
- -
-
-
-
-

- Start online learning anything -

-
- -
-
-
- -

- More than{" "} - - - - - {" "} - students are registered -

-
-
-
- ); - } -} - -export default CallToActionSix; +import React, { Component } from 'react'; +import CountUp from 'react-countup'; +import VisibilitySensor from 'react-visibility-sensor'; + +class CallToActionSix extends Component { + constructor() { + super(); + this.state = { + startCounter: false, + }; + } + + onVisibilityChange = (isVisible) => { + if (isVisible) { + this.setState({ startCounter: true }); + } + }; + + render() { + return ( +
+ +
+
+
+
+

+ Start online learning anything +

+
+ +
+
+
+ +

+ More than + {' '} + + + + + + {' '} + students are registered +

+
+
+
+ ); + } +} + +export default CallToActionSix; diff --git a/components/CallToActionThree.js b/components/CallToActionThree.js index c39e91d4..691891a2 100644 --- a/components/CallToActionThree.js +++ b/components/CallToActionThree.js @@ -1,56 +1,56 @@ -import React, { Component } from "react"; - -class CallToActionThree extends Component { - render() { - return ( -
-
-
-
- -
-
-
-
-

Our Services

-
-

- We mentor, teach, train, and develop opportunities for - underrepresented communities -

-
-
- -

- Professional Courses -

-
-
- -

Expert Teachers

-
-
- -

- Onboarding/Training -

-
-
- - Learn More - -
-
-
-
-
- ); - } -} - -export default CallToActionThree; +import React, { Component } from 'react'; + +class CallToActionThree extends Component { + render() { + return ( +
+
+
+
+ +
+
+
+
+

Our Services

+
+

+ We mentor, teach, train, and develop opportunities for + underrepresented communities +

+
+
+ +

+ Professional Courses +

+
+
+ +

Expert Teachers

+
+
+ +

+ Onboarding/Training +

+
+
+ + Learn More + +
+
+
+
+
+ ); + } +} + +export default CallToActionThree; diff --git a/components/CallToActionTwo.js b/components/CallToActionTwo.js index f5e89345..4f4c9eed 100644 --- a/components/CallToActionTwo.js +++ b/components/CallToActionTwo.js @@ -1,52 +1,58 @@ -import React from "react"; - -const CallToActionTwo = () => { - return ( -
-
-
-
-
-
- - - -
-
-

Become an teacher

-

- There are many variations of passages of lore available but{" "} -
the majority have suffered alteration in some form. -

- - Start Teaching - -
-
-
-
-
-
- - - -
-
-

Join our community

-

- There are many variations of passages of lore available but{" "} -
the majority have suffered alteration in some form. -

- - Start Learning - -
-
-
-
-
-
- ); -}; - -export default CallToActionTwo; +import React from 'react'; + +const CallToActionTwo = function () { + return ( +
+
+
+
+
+
+ + + +
+
+

Become an teacher

+

+ There are many variations of passages of lore available but + {' '} +
+ {' '} + the majority have suffered alteration in some form. +

+ + Start Teaching + +
+
+
+
+
+
+ + + +
+
+

Join our community

+

+ There are many variations of passages of lore available but + {' '} +
+ {' '} + the majority have suffered alteration in some form. +

+ + Start Learning + +
+
+
+
+
+
+ ); +}; + +export default CallToActionTwo; diff --git a/components/Career.js b/components/Career.js index 106c0c59..25f5ae8c 100644 --- a/components/Career.js +++ b/components/Career.js @@ -1,11 +1,11 @@ -import React from "react"; +import React from 'react'; -const Career = () => { +const Career = function () { return (

Get A Job At MPA Today

@@ -14,6 +14,7 @@ const Career = () => { href="https://docs.google.com/forms/d/e/1FAIpQLSdmfHMGP4dS6_90RuzpenDkif7casdzLerA5pQtS_qvS9BqLQ/viewform?embedded=true" target="_blank" className="thm-btn cta-one__btn" + rel="noreferrer" > Search Careers diff --git a/components/Chapter.js b/components/Chapter.js index 60ad27d6..39d2fd75 100644 --- a/components/Chapter.js +++ b/components/Chapter.js @@ -1,6 +1,6 @@ -import React from "react"; +import React from 'react'; -const Chapter = () => { +const Chapter = function () { return (
@@ -9,7 +9,7 @@ const Chapter = () => {
- +
@@ -22,6 +22,7 @@ const Chapter = () => { href="https://docs.google.com/forms/d/e/1FAIpQLSdmfHMGP4dS6_90RuzpenDkif7casdzLerA5pQtS_qvS9BqLQ/viewform?embedded=true" target="_blank" className="thm-btn cta-two__btn" + rel="noreferrer" > Find a Course @@ -33,7 +34,7 @@ const Chapter = () => {
- +
@@ -46,6 +47,7 @@ const Chapter = () => { href="https://docs.google.com/forms/d/e/1FAIpQLSdmfHMGP4dS6_90RuzpenDkif7casdzLerA5pQtS_qvS9BqLQ/viewform?embedded=true" target="_blank" className="thm-btn cta-two__btn" + rel="noreferrer" > Next Steps diff --git a/components/ChapterDirectory/ChapterDirectory.component.jsx b/components/ChapterDirectory/ChapterDirectory.component.jsx index acba7fb6..853a3a36 100644 --- a/components/ChapterDirectory/ChapterDirectory.component.jsx +++ b/components/ChapterDirectory/ChapterDirectory.component.jsx @@ -1,33 +1,30 @@ -import styles from './ChapterDirectory.module.css'; -import ChapterMenu from '../ChapterMenu/ChapterMenu.component'; -import InterestForm from '../InterestForm/InterestForm.component'; import Link from 'next/link'; import axios from 'axios'; import { useEffect, useState } from 'react'; +import styles from './ChapterDirectory.module.css'; +import ChapterMenu from '../ChapterMenu/ChapterMenu.component'; +import InterestForm from '../InterestForm/InterestForm.component'; -const ChapterDirectory = ({ setOpen, token, active, userData }) => { +const ChapterDirectory = function ({ + setOpen, token, active, userData, +}) { const [startedAChapter, setStartedAChapter] = useState(null); const [locationDetails, setLocationDetails] = useState(null); const url = 'https://koinstreet-learn-api.herokuapp.com/api/v1/location'; - const userDetails = { firstName: userData.firstName, lastName: userData.lastName } + const userDetails = { firstName: userData.firstName, lastName: userData.lastName }; useEffect(() => { axios.get(url) - .then(res => res.data.data) - .then(data => setLocationDetails(data)) - .catch(err => { console.log(err) }); + .then((res) => res.data.data) + .then((data) => setLocationDetails(data)) + .catch((err) => { console.log(err); }); }, []); - useEffect(() => { - let result = locationDetails && locationDetails - .reduce((acc, { added_by }) => { - return [...acc, { firstName: added_by.firstName, lastName: added_by.lastName }] - }, []) - .find(details => { - return JSON.stringify(details) === JSON.stringify(userDetails) - }); + const result = locationDetails && locationDetails + .reduce((acc, { added_by }) => [...acc, { firstName: added_by.firstName, lastName: added_by.lastName }], []) + .find((details) => JSON.stringify(details) === JSON.stringify(userDetails)); setStartedAChapter(result); }, [locationDetails]); @@ -35,10 +32,8 @@ const ChapterDirectory = ({ setOpen, token, active, userData }) => {
{ startedAChapter - ? - - : - + ? + : }
@@ -53,8 +48,7 @@ const ChapterDirectory = ({ setOpen, token, active, userData }) => {
- ) -} - + ); +}; -export default ChapterDirectory; \ No newline at end of file +export default ChapterDirectory; diff --git a/components/ChapterMenu/ChapterMenu.component.jsx b/components/ChapterMenu/ChapterMenu.component.jsx index 5504e447..158f1e50 100644 --- a/components/ChapterMenu/ChapterMenu.component.jsx +++ b/components/ChapterMenu/ChapterMenu.component.jsx @@ -1,6 +1,6 @@ import styles from './ChapterMenu.module.css'; -const ChapterMenu = ({ userData, active }) => { +const ChapterMenu = function ({ userData, active }) { return (
@@ -69,8 +69,7 @@ const ChapterMenu = ({ userData, active }) => {
- ) -} + ); +}; export default ChapterMenu; - diff --git a/components/ChatMessage.js b/components/ChatMessage.js index 355b7281..5b0a0b13 100644 --- a/components/ChatMessage.js +++ b/components/ChatMessage.js @@ -1,12 +1,14 @@ -import { useState } from "react"; -import { timeago } from "../helpers/timeago"; +import { useState } from 'react'; +import { timeago } from '../helpers/timeago'; // commented out copy and delete for now (still has inline css from developing/testing) // const copyMessage = () => { // console.log('copied'); // } -const ChatMessage = ({ user, message, own, deleteMessage }) => { +const ChatMessage = function ({ + user, message, own, deleteMessage, +}) { // const [isHovering, setIsHovering] = useState(false); return own ? ( //
setIsHovering(true)} onMouseOut={()=> setIsHovering(false)}> @@ -31,11 +33,11 @@ const ChatMessage = ({ user, message, own, deleteMessage }) => { //
setIsHovering(true)} onMouseOut={()=> setIsHovering(false)}> //
-
+
profile picture
{/* Image from sender?? */} diff --git a/components/ChatUserCard.js b/components/ChatUserCard.js index 9139f6f3..7d1b1680 100644 --- a/components/ChatUserCard.js +++ b/components/ChatUserCard.js @@ -1,51 +1,58 @@ -import React, { useState } from "react"; +import React, { useState } from 'react'; -const ChatUserCard = ({ u, createChat, setPopUp }) => { +const ChatUserCard = function ({ u, createChat, setPopUp }) { const [addUserClicked, setAddUserClicked] = useState(false); - const [createChatMessage, setCreateChatMessage] = useState(""); + const [createChatMessage, setCreateChatMessage] = useState(''); return ( <>
{ setAddUserClicked(!addUserClicked); }} > - {u?.firstName} {u?.lastName} + {u?.firstName} + {' '} + {u?.lastName}
{addUserClicked && (
- - Creating a chat with {u?.firstName} {u?.lastName}: + + Creating a chat with + {' '} + {u?.firstName} + {' '} + {u?.lastName} + : + />
{ setAddUserClicked(false); }} @@ -54,7 +61,7 @@ const ChatUserCard = ({ u, createChat, setPopUp }) => {
{ createChat(u, createChatMessage); setPopUp(false); diff --git a/components/ChatUserSearch.js b/components/ChatUserSearch.js index 8b7a88c3..13c38457 100644 --- a/components/ChatUserSearch.js +++ b/components/ChatUserSearch.js @@ -1,19 +1,19 @@ import React, { useState, useEffect } from 'react'; -import ChatUserCard from './ChatUserCard'; import axios from 'axios'; +import ChatUserCard from './ChatUserCard'; -const ChatUserSearch = ({setPopUp, allchats, blockedchats, pendingchats, thisUser, addChatRequest, socket, onlineUsers}) => { - const [userSearch, setUserSearch] = useState(""); +const ChatUserSearch = function ({ + setPopUp, allchats, blockedchats, pendingchats, thisUser, addChatRequest, socket, onlineUsers, +}) { + const [userSearch, setUserSearch] = useState(''); const [userResults, setUserResults] = useState([]); const [tempUserResults, setTempUserResults] = useState({}); useEffect(() => { const searchUsers = async () => { - if (userSearch == "") { + if (userSearch == '') { setUserResults([]); - return; - } - else { + } else { try { const token = window.localStorage.getItem('jwtToken'); // const res = await axios.get("http://localhost:5000/api/v1/user/search/" + userSearch, { @@ -21,129 +21,133 @@ const ChatUserSearch = ({setPopUp, allchats, blockedchats, pendingchats, thisUse // 'Authorization': `Bearer ${token}` // } // }); - const res = await axios.get("http://koinstreet-learn-api.herokuapp.com/api/v1/user/search/" + userSearch, { - headers: { - 'Authorization': `Bearer ${token}` - } - }); - setTempUserResults({query:userSearch, results:res.data.data}); - + const res = await axios.get(`http://koinstreet-learn-api.herokuapp.com/api/v1/user/search/${userSearch}`, { + headers: { + Authorization: `Bearer ${token}`, + }, + }); + setTempUserResults({ query: userSearch, results: res.data.data }); } catch (err) { console.log(err); } } - } + }; searchUsers(); }, [userSearch]); // To ensure most recent results are show useEffect(() => { - if(tempUserResults.query == userSearch) { + if (tempUserResults.query == userSearch) { setUserResults(tempUserResults.results); } - }, [tempUserResults]) + }, [tempUserResults]); const createChat = async (user, message) => { try { const token = window.localStorage.getItem('jwtToken'); - let body={receiverId:user._id}; + const body = { receiverId: user._id }; // const res = await axios.post("http://localhost:5000/api/v1/chat/", body, { // headers: { // 'Authorization': `Bearer ${token}` // } // }); - const res = await axios.post("http://koinstreet-learn-api.herokuapp.com/api/v1/chat/", body, { - headers: { - 'Authorization': `Bearer ${token}` - } - }); - - // update the pending chats with the result - let createdchat = res.data.data; + const res = await axios.post('http://koinstreet-learn-api.herokuapp.com/api/v1/chat/', body, { + headers: { + Authorization: `Bearer ${token}`, + }, + }); + + // update the pending chats with the result + const createdchat = res.data.data; addChatRequest(res.data.data, user); - if(message!=="") { - let messageContent = { + if (message !== '') { + const messageContent = { user: user._id, - message: message, + message, chatId: res.data.data._id, - } - const newMessage = await axios.post("http://localhost:5000/api/v1/chat_message/", messageContent, { + }; + const newMessage = await axios.post('http://localhost:5000/api/v1/chat_message/', messageContent, { headers: { - 'Authorization': `Bearer ${token}` - } + Authorization: `Bearer ${token}`, + }, }); // If the user is online, tell socket if (onlineUsers.find((u) => u.userId == user._id)) { - socket.emit("createChat", ({ - receiverId:user._id, chat:createdchat})); - }; - } - else { + socket.emit('createChat', ({ receiverId: user._id, chat: createdchat })); + } + } else { // If the user is online, tell socket - if (onlineUsers.find((u) => u.userId == user._id)) { - socket.emit("createChat", ({receiverId:user._id, chat:createdchat})); - }; - } + if (onlineUsers.find((u) => u.userId == user._id)) { + socket.emit('createChat', ({ receiverId: user._id, chat: createdchat })); + } + } } catch (err) { console.log(err); } - } + }; const setUpUserResults = () => { - let allusers = []; - allchats.map((c)=> allusers.push(c.users.find((m)=>m._id !==thisUser._id))); - pendingchats.map((c)=>allusers.push(c.users.find((m)=>m._id!==thisUser._id))); - blockedchats.map((c)=>allusers.push(c.users.find((m)=>m._id!==thisUser._id))); + const allusers = []; + allchats.map((c) => allusers.push(c.users.find((m) => m._id !== thisUser._id))); + pendingchats.map((c) => allusers.push(c.users.find((m) => m._id !== thisUser._id))); + blockedchats.map((c) => allusers.push(c.users.find((m) => m._id !== thisUser._id))); const cards = () => { - let cardsarr = []; + const cardsarr = []; if (userResults.length == 0) { - return Looks like there are no users that match the search criteria! + return Looks like there are no users that match the search criteria!; } userResults.map((u) => { - if (!allusers.find((m)=>m._id == u._id) && thisUser._id != u._id) { - cardsarr.push( - - ) + if (!allusers.find((m) => m._id == u._id) && thisUser._id != u._id) { + cardsarr.push( + , + ); } - }) - if(cardsarr.length == 0){ - return Looks like there are no users that match the search criteria! - } - else { - return cardsarr + }); + if (cardsarr.length == 0) { + return Looks like there are no users that match the search criteria!; } - } + return cardsarr; + }; + + if (userSearch == '') { return Search a user to start a chat!; } - if(userSearch == "") { return Search a user to start a chat!} - else { - let result=( + const result = ( <> - {cards()} + {cards()} ); if (result == <>) { - return Looks like there are no users that match the search criteria! - } - else { - return result; + return Looks like there are no users that match the search criteria!; } - } - } + + return result; + }; return ( -
-
- setUserSearch(e.target.value)} /> -
setPopUp(false)}>x
+
+
+ setUserSearch(e.target.value)} /> +
setPopUp(false)} + > + x +
-
+
{setUpUserResults()}
- ) -} + ); +}; export default ChatUserSearch; - diff --git a/components/Chats.js b/components/Chats.js index 6581b06d..e0cf58f3 100644 --- a/components/Chats.js +++ b/components/Chats.js @@ -1,23 +1,23 @@ -import React, { useState, useEffect, useRef } from "react"; -import Conversation from "./Conversation"; -import Message from "./ChatMessage"; -import ChatUserSearch from "./ChatUserSearch"; -import axios from "axios"; -import { io } from "socket.io-client"; -import Highlighter from "react-highlight-words"; - -const Chats = ({ data }) => { +import React, { useState, useEffect, useRef } from 'react'; +import axios from 'axios'; +import { io } from 'socket.io-client'; +import Highlighter from 'react-highlight-words'; +import Conversation from './Conversation'; +import Message from './ChatMessage'; +import ChatUserSearch from './ChatUserSearch'; + +const Chats = function ({ data }) { const [allchats, setAllchats] = useState([]); const [pendingchats, setPendingchats] = useState([]); const [blockedchats, setBlockedchats] = useState([]); - const [chatlist, setChatlist] = useState("all"); + const [chatlist, setChatlist] = useState('all'); const [currentChat, setCurrentChat] = useState(null); - const [newMessage, setNewMessage] = useState(""); + const [newMessage, setNewMessage] = useState(''); const [messages, setMessages] = useState([]); const [recipient, setRecipient] = useState({}); const [blockPopUp, setBlockPopUp] = useState(false); const [expandInfo, setExpandInfo] = useState(false); - const [chatSearch, setChatSearch] = useState(""); + const [chatSearch, setChatSearch] = useState(''); const [searchPopUp, setSearchPopUp] = useState(false); const [onlineUsers, setOnlineUsers] = useState([]); const [searchResults, setSearchResults] = useState(null); @@ -32,141 +32,141 @@ const Chats = ({ data }) => { const socket = useRef(); const redirect = () => { - window.location.href = "/auth"; + window.location.href = '/auth'; }; useEffect(() => { // Redirect to login if bad token/user info - const token = localStorage.getItem("jwtToken"); - const userInfo = localStorage.getItem("userInfo"); + const token = localStorage.getItem('jwtToken'); + const userInfo = localStorage.getItem('userInfo'); if (token === null || userInfo === {}) { redirect(); } - socket.current = io("ws://localhost:8900"); - socket.current.on("connection", (msg) => { + socket.current = io('ws://localhost:8900'); + socket.current.on('connection', (msg) => { console.log(msg); }); - socket.current.on("getUsers", (users) => { + socket.current.on('getUsers', (users) => { setOnlineUsers(users); }); - socket.current.on("getMessage", ({ chatId, text }) => { + socket.current.on('getMessage', ({ chatId, text }) => { setSocketContent({ - type: "gotMessage", - chatId: chatId, - text: text, + type: 'gotMessage', + chatId, + text, }); }); - socket.current.on("blockedChat", ({ chat }) => { + socket.current.on('blockedChat', ({ chat }) => { setSocketContent({ - type: "blockedChat", - chat: chat, + type: 'blockedChat', + chat, }); }); - socket.current.on("unblockedChat", ({ chat }) => { + socket.current.on('unblockedChat', ({ chat }) => { setSocketContent({ - type: "unblockedChat", - chat: chat, + type: 'unblockedChat', + chat, }); }); - socket.current.on("addedToChat", ({ chat }) => { + socket.current.on('addedToChat', ({ chat }) => { setSocketContent({ - type: "addedToChat", - chat: chat, + type: 'addedToChat', + chat, }); }); - socket.current.on("rejectedChat", ({ chat }) => { + socket.current.on('rejectedChat', ({ chat }) => { setSocketContent({ - type: "rejectedChat", - chat: chat, + type: 'rejectedChat', + chat, }); }); - socket.current.on("acceptedChat", ({ chat }) => { + socket.current.on('acceptedChat', ({ chat }) => { setSocketContent({ - type: "acceptedChat", - chat: chat, + type: 'acceptedChat', + chat, }); }); }, []); useEffect(() => { - if (socketContent.type === "blockedChat") { - let chat = socketContent.chat; + if (socketContent.type === 'blockedChat') { + const { chat } = socketContent; chat.blocked = true; - let newall = allchats.filter((c) => c._id != chat._id); + const newall = allchats.filter((c) => c._id != chat._id); setAllchats(newall); setBlockedchats([...blockedchats, chat]); if (currentChat._id == chat._id) { setCurrentChat(allchats[0]); } - console.log("Chat been blocked"); + console.log('Chat been blocked'); } - if (socketContent.type === "unblockedChat") { - let chat = socketContent.chat; + if (socketContent.type === 'unblockedChat') { + const { chat } = socketContent; chat.blocked = false; - let newblocked = blockedchats.filter((c) => c._id != chat._id); + const newblocked = blockedchats.filter((c) => c._id != chat._id); setBlockedchats(newblocked); setAllchats([chat, ...allchats]); - console.log("Chat been unblocked"); + console.log('Chat been unblocked'); } - if (socketContent.type === "addedToChat") { - let chat = socketContent.chat; + if (socketContent.type === 'addedToChat') { + const { chat } = socketContent; setPendingchats([chat, ...pendingchats]); - console.log("added to a chat"); + console.log('added to a chat'); } - if (socketContent.type === "rejectedChat") { - let chat = socketContent.chat; - let newpending = pendingchats.filter((c) => c._id != chat._id); + if (socketContent.type === 'rejectedChat') { + const { chat } = socketContent; + const newpending = pendingchats.filter((c) => c._id != chat._id); setPendingchats(newpending); - console.log("chat been rejected"); + console.log('chat been rejected'); } - if (socketContent.type === "acceptedChat") { - let chat = socketContent.chat; - let newpending = pendingchats.filter((c) => c._id != chat._id); + if (socketContent.type === 'acceptedChat') { + const { chat } = socketContent; + const newpending = pendingchats.filter((c) => c._id != chat._id); setPendingchats(newpending); - let tempallchats = allchats; + const tempallchats = allchats; setAllchats([chat, ...tempallchats]); - console.log("chat been accepted"); + console.log('chat been accepted'); } - if (socketContent.type === "gotMessage") { - let chatId = socketContent.chatId; - let text = socketContent.text; + if (socketContent.type === 'gotMessage') { + const { chatId } = socketContent; + const { text } = socketContent; if (currentChat?._id == chatId) { setMessages([...messages, text]); } else { let chatty = allchats.find((c) => c._id == chatId); - let newAllchats = allchats.filter((c) => c._id != chatId); + const newAllchats = allchats.filter((c) => c._id != chatId); chatty = { ...chatty, newMessage: true }; setAllchats([chatty, ...newAllchats]); } - console.log("got a message"); + console.log('got a message'); } }, [socketContent]); useEffect(() => { const getChats = async () => { try { - const token = window.localStorage.getItem("jwtToken"); + const token = window.localStorage.getItem('jwtToken'); // let res = await axios.get("http://localhost:5000/api/v1/chat/", { const res = await axios.get( - "http://koinstreet-learn-api.herokuapp.com/api/v1/chat/", + 'http://koinstreet-learn-api.herokuapp.com/api/v1/chat/', { headers: { Authorization: `Bearer ${token}`, }, - } + }, ); setAllchats(res.data.data); } catch (err) { @@ -176,19 +176,19 @@ const Chats = ({ data }) => { const getPendingChats = async () => { try { - const token = window.localStorage.getItem("jwtToken"); + const token = window.localStorage.getItem('jwtToken'); // let res = await axios.get("http://localhost:5000/api/v1/chat/pending", { // headers: { // 'Authorization': `Bearer ${token}` // } // }); const res = await axios.get( - "http://koinstreet-learn-api.herokuapp.com/api/v1/chat/pending", + 'http://koinstreet-learn-api.herokuapp.com/api/v1/chat/pending', { headers: { Authorization: `Bearer ${token}`, }, - } + }, ); setPendingchats(res.data.data); } catch (err) { @@ -198,19 +198,19 @@ const Chats = ({ data }) => { const getBlockedChats = async () => { try { - const token = window.localStorage.getItem("jwtToken"); + const token = window.localStorage.getItem('jwtToken'); // const res = await axios.get("http://localhost:5000/api/v1/chat/block", { // headers: { // 'Authorization': `Bearer ${token}` // } // }); const res = await axios.get( - "http://koinstreet-learn-api.herokuapp.com/api/v1/chat/block", + 'http://koinstreet-learn-api.herokuapp.com/api/v1/chat/block', { headers: { Authorization: `Bearer ${token}`, }, - } + }, ); setBlockedchats(res.data.data); } catch (err) { @@ -223,7 +223,7 @@ const Chats = ({ data }) => { getBlockedChats(); if (user._id) { - socket.current.emit("addUser", user._id); + socket.current.emit('addUser', user._id); } }, [user._id]); @@ -231,16 +231,16 @@ const Chats = ({ data }) => { const getMessages = async () => { if (currentChat) { try { - const token = window.localStorage.getItem("jwtToken"); + const token = window.localStorage.getItem('jwtToken'); const res = await axios.get( - "http://koinstreet-learn-api.herokuapp.com/api/v1/chat_message/" + - currentChat._id, + `http://koinstreet-learn-api.herokuapp.com/api/v1/chat_message/${ + currentChat._id}`, { // const res = await axios.get("http://localhost:5000/api/v1/chat_message/" + currentChat._id, { headers: { Authorization: `Bearer ${token}`, }, - } + }, ); setMessages(res.data.data); } catch (err) { @@ -249,31 +249,29 @@ const Chats = ({ data }) => { } }; getMessages(); - if (currentChat) - setRecipient(currentChat.users.find((m) => m._id !== user._id)); + if (currentChat) setRecipient(currentChat.users.find((m) => m._id !== user._id)); }, [currentChat]); useEffect(() => { const searchChat = async () => { - if (chatSearch == "") { + if (chatSearch == '') { setSearchResults(null); - return; } else { try { - const token = window.localStorage.getItem("jwtToken"); + const token = window.localStorage.getItem('jwtToken'); // const res = await axios.get("http://localhost:5000/api/v1/chat/search/" + chatSearch, { // headers: { // 'Authorization': `Bearer ${token}` // } // }); const res = await axios.get( - "http://koinstreet-learn-api.herokuapp.com/api/v1/chat/search/" + - chatSearch, + `http://koinstreet-learn-api.herokuapp.com/api/v1/chat/search/${ + chatSearch}`, { headers: { Authorization: `Bearer ${token}`, }, - } + }, ); setTempResults({ query: chatSearch, results: res.data.data }); } catch (err) { @@ -293,21 +291,21 @@ const Chats = ({ data }) => { useEffect(() => { messageRef.current?.scrollIntoView({ - behavior: "auto", - block: "end", - inline: "nearest", + behavior: 'auto', + block: 'end', + inline: 'nearest', }); }, [messages]); const deleteMessage = () => { - console.log("deleteclicked"); + console.log('deleteclicked'); }; const blockUser = async () => { try { - let chatid = currentChat._id; - let body = { chatid: chatid }; - const token = window.localStorage.getItem("jwtToken"); + const chatid = currentChat._id; + const body = { chatid }; + const token = window.localStorage.getItem('jwtToken'); // await axios.put("http://localhost:5000/api/v1/chat/block", body, { // headers: { // 'Authorization': `Bearer ${token}` @@ -315,26 +313,26 @@ const Chats = ({ data }) => { // }) await axios .put( - "http://koinstreet-learn-api.herokuapp.com/api/v1/chat/block", + 'http://koinstreet-learn-api.herokuapp.com/api/v1/chat/block', body, { headers: { Authorization: `Bearer ${token}`, }, - } + }, ) .then((res) => { // If the user is online, tell socket if (onlineUsers.find((u) => u.userId == recipient._id)) { - socket.current.emit("blockUser", { + socket.current.emit('blockUser', { receiverId: recipient._id, chat: currentChat, }); } // update all chats and blocked chats - let newBlocked = allchats.find((c) => c._id == chatid); - let newAllchats = allchats.filter((c) => c._id != chatid); + const newBlocked = allchats.find((c) => c._id == chatid); + const newAllchats = allchats.filter((c) => c._id != chatid); setAllchats(newAllchats); newBlocked.blocked = true; newBlocked.blocking_user = user._id; @@ -350,32 +348,32 @@ const Chats = ({ data }) => { } }; const addChatRequest = (chat, user2) => { - let temp = [user, user2]; + const temp = [user, user2]; chat.users = temp; setPendingchats([chat, ...pendingchats]); }; const acceptChat = async (chat, setpopUp) => { try { - let body = { chatid: chat._id }; - const token = window.localStorage.getItem("jwtToken"); + const body = { chatid: chat._id }; + const token = window.localStorage.getItem('jwtToken'); await axios - .put("http://koinstreet-learn-api.herokuapp.com/api/v1/chat/", body, { + .put('http://koinstreet-learn-api.herokuapp.com/api/v1/chat/', body, { headers: { Authorization: `Bearer ${token}`, }, }) .then((res) => { // If the user is online, tell socket - let receiver = chat.users.find((m) => m._id !== user._id); + const receiver = chat.users.find((m) => m._id !== user._id); if (onlineUsers.find((u) => u.userId == receiver._id)) { - socket.current.emit("acceptChat", { + socket.current.emit('acceptChat', { receiverId: receiver._id, - chat: chat, + chat, }); } // update all chats and pending chats - let newPendingchats = pendingchats.filter((c) => c._id != chat._id); + const newPendingchats = pendingchats.filter((c) => c._id != chat._id); setPendingchats(newPendingchats); chat.accepted = true; setAllchats([chat, ...allchats]); @@ -391,7 +389,7 @@ const Chats = ({ data }) => { }; const rejectChat = async (chat, setpopUp) => { try { - const token = window.localStorage.getItem("jwtToken"); + const token = window.localStorage.getItem('jwtToken'); // await axios.delete("http://localhost:5000/api/v1/chat/" + chat._id, { // headers: { // 'Authorization': `Bearer ${token}` @@ -399,25 +397,25 @@ const Chats = ({ data }) => { // }) await axios .delete( - "http://koinstreet-learn-api.herokuapp.com/api/v1/chat/" + chat._id, + `http://koinstreet-learn-api.herokuapp.com/api/v1/chat/${chat._id}`, { headers: { Authorization: `Bearer ${token}`, }, - } + }, ) .then((res) => { // If the user is online, tell socket - let receiver = chat.users.find((m) => m._id !== user._id); + const receiver = chat.users.find((m) => m._id !== user._id); if (onlineUsers.find((u) => u.userId == receiver._id)) { - socket.current.emit("rejectChat", { + socket.current.emit('rejectChat', { receiverId: receiver._id, - chat: chat, + chat, }); } // update pending chats - let newPendingchats = pendingchats.filter((c) => c._id != chat._id); + const newPendingchats = pendingchats.filter((c) => c._id != chat._id); setPendingchats(newPendingchats); setpopUp(false); setCurrentChat(null); @@ -431,8 +429,8 @@ const Chats = ({ data }) => { }; const unblockChat = async (chat, setpopup) => { try { - let body = { chatid: chat._id }; - const token = window.localStorage.getItem("jwtToken"); + const body = { chatid: chat._id }; + const token = window.localStorage.getItem('jwtToken'); // await axios.put("http://localhost:5000/api/v1/chat/block", body, { // headers: { // 'Authorization': `Bearer ${token}` @@ -440,26 +438,26 @@ const Chats = ({ data }) => { // }) await axios .put( - "http://koinstreet-learn-api.herokuapp.com/api/v1/chat/block", + 'http://koinstreet-learn-api.herokuapp.com/api/v1/chat/block', body, { headers: { Authorization: `Bearer ${token}`, }, - } + }, ) .then((res) => { // If the user is online, tell socket - let receiver = chat.users.find((m) => m._id !== user._id); + const receiver = chat.users.find((m) => m._id !== user._id); if (onlineUsers.find((u) => u.userId == receiver._id)) { - socket.current.emit("unblockUser", { + socket.current.emit('unblockUser', { receiverId: receiver._id, - chat: chat, + chat, }); } // update all chats and blocked chats - let newBlockedchats = blockedchats.filter((c) => c._id != chat._id); + const newBlockedchats = blockedchats.filter((c) => c._id != chat._id); setBlockedchats(newBlockedchats); chat.blocked = false; chat.blocking_user = null; @@ -484,38 +482,38 @@ const Chats = ({ data }) => { }; const receiverId = currentChat.users.find( - (member) => member._id !== user._id + (member) => member._id !== user._id, ); try { - const token = window.localStorage.getItem("jwtToken"); + const token = window.localStorage.getItem('jwtToken'); // const res = await axios.post("http://localhost:5000/api/v1/chat_message/", message, { // headers: { // 'Authorization': `Bearer ${token}` // } // }); const res = await axios.post( - "http://koinstreet-learn-api.herokuapp.com/api/v1/chat_message/", + 'http://koinstreet-learn-api.herokuapp.com/api/v1/chat_message/', message, { headers: { Authorization: `Bearer ${token}`, }, - } + }, ); // send the new message to the socket - socket.current.emit("sendMessage", { + socket.current.emit('sendMessage', { chatId: currentChat._id, receiverId: receiverId._id, text: res.data.data, }); setMessages([...messages, res.data.data]); - setNewMessage(""); + setNewMessage(''); messageRef.current?.scrollIntoView({ - behavior: "smooth", - block: "end", - inline: "nearest", + behavior: 'smooth', + block: 'end', + inline: 'nearest', }); } catch (err) { console.log(err); @@ -523,107 +521,98 @@ const Chats = ({ data }) => { }; const setUpChats = () => { - if (chatlist === "all") { + if (chatlist === 'all') { if (allchats === []) { return ( - + You don't have any chats, click the create chat button to start one! ); - } else { - return ( - <> - {allchats?.map((c) => { - return ( -
{ - setExpandInfo(false); - if (c.newMessage) { - c.newMessage = false; - } - setCurrentChat(c); - }} - > - -
- ); - })} - - ); } + return ( + <> + {allchats?.map((c) => ( +
{ + setExpandInfo(false); + if (c.newMessage) { + c.newMessage = false; + } + setCurrentChat(c); + }} + > + +
+ ))} + + ); } - if (chatlist === "blocked") { + if (chatlist === 'blocked') { if (blockedchats?.length === 0) { return ( - + You don't have any blocked chats! ); - } else { - return ( - <> - {blockedchats?.map((c) => { - return ( -
{ - setExpandInfo(false); - setCurrentChat(c); - }} - > - -
- ); - })} - - ); } + return ( + <> + {blockedchats?.map((c) => ( +
{ + setExpandInfo(false); + setCurrentChat(c); + }} + > + +
+ ))} + + ); } - if (chatlist === "pending") { + if (chatlist === 'pending') { if (pendingchats?.length === 0) { return ( - + You don't have any pending chats! ); - } else { - return ( - <> - {pendingchats?.map((c) => { - return ( -
{ - setExpandInfo(false); - setCurrentChat(c); - }} - > - -
- ); - })} - - ); } + return ( + <> + {pendingchats?.map((c) => ( +
{ + setExpandInfo(false); + setCurrentChat(c); + }} + > + +
+ ))} + + ); } }; @@ -635,34 +624,32 @@ const Chats = ({ data }) => { if (searchResults && searchResults.chats.length > 0) { chatRes = ( <> - Chats - {searchResults.chats.map((c) => { - return ( -
{ - setExpandInfo(false); - setCurrentChat(c); - }} - > - -
- ); - })} + Chats + {searchResults.chats.map((c) => ( +
{ + setExpandInfo(false); + setCurrentChat(c); + }} + > + +
+ ))} ); } if (searchResults && searchResults.messages.length > 0) { messageRes = ( <> - Messages + Messages {searchResults.messages.map((m) => { - let muser = m.chat.users.find((m) => m._id !== user._id); + const muser = m.chat.users.find((m) => m._id !== user._id); return (
{ setExpandInfo(false); setCurrentChat(m.chat); messageReferences[m._id]?.scrollIntoView({ - behavior: "smooth", - block: "end", - inline: "nearest", + behavior: 'smooth', + block: 'end', + inline: 'nearest', }); }} >
-
+
- {muser?.firstName} {muser?.lastName} + {muser?.firstName} + {' '} + {muser?.lastName}
@@ -704,12 +693,12 @@ const Chats = ({ data }) => { ); } if ( - searchResults && - searchResults.messages.length == 0 && - searchResults.chats.length == 0 + searchResults + && searchResults.messages.length == 0 + && searchResults.chats.length == 0 ) { chatRes = ( - + There are no chats or messages that match the search ); @@ -728,14 +717,14 @@ const Chats = ({ data }) => {
{ onChange={(e) => setChatSearch(e.target.value)} />
- {chatSearch == "" ? setUpChats() : setUpResults()} + {chatSearch == '' ? setUpChats() : setUpResults()}
{/* pop up for searching users */} @@ -806,19 +795,21 @@ const Chats = ({ data }) => { )}
{currentChat ? ( <>
- {recipient.firstName} {recipient.lastName} + {recipient.firstName} + {' '} + {recipient.lastName} {!expandInfo && (
{ onClick={() => setExpandInfo(true)} > Expand my info - +
)}
@@ -857,7 +848,7 @@ const Chats = ({ data }) => { placeholder="Aa" onChange={(e) => setNewMessage(e.target.value)} value={newMessage} - > + /> @@ -870,7 +861,7 @@ const Chats = ({ data }) => {
{ > + style={{ fontSize: '18px' }} + />
Hide info
- {recipient.firstName} {recipient.lastName} + {recipient.firstName} + {' '} + {recipient.lastName} {blockPopUp && (
- Are you sure you want to block {recipient.firstName}{" "} - {recipient.lastName}? + Are you sure you want to block + {' '} + {recipient.firstName} + {' '} + {recipient.lastName} + ?
{
)}
-
+
{user.GithubLink && ( - - + + )} {user.LinkedinLink && ( - + + style={{ marginLeft: '25px' }} + /> )} {user.FacebookLink && ( - + + style={{ marginLeft: '25px' }} + /> )} {/* Don't show block button if the chat is already blocked or if it isnt accepted */} {!currentChat?.blocked && currentChat?.accepted && (
- blockPopUp ? setBlockPopUp(false) : setBlockPopUp(true) - } + onClick={() => (blockPopUp ? setBlockPopUp(false) : setBlockPopUp(true))} > Block
@@ -951,27 +946,31 @@ const Chats = ({ data }) => {
-
+
{recipient.userName && ( <> - Username
+ Username + {' '} +
)} {/* Add privacy check for emails */} Email
-
+
{recipient.userName && ( <> - {" "} - {recipient.userName}
+ {' '} + {recipient.userName} + {' '} +
)} {recipient.email} diff --git a/components/CodeCamp.js b/components/CodeCamp.js index 784821c9..367b64d0 100644 --- a/components/CodeCamp.js +++ b/components/CodeCamp.js @@ -1,6 +1,6 @@ -import React, { Component } from "react"; -import CountUp from "react-countup"; -import VisibilitySensor from "react-visibility-sensor"; +import React, { Component } from 'react'; +import CountUp from 'react-countup'; +import VisibilitySensor from 'react-visibility-sensor'; class CodeCamp extends Component { constructor() { @@ -62,11 +62,11 @@ class CodeCamp extends Component {

- - - - - + + + + +

students love us

diff --git a/components/ComingSoon.js b/components/ComingSoon.js index 646d63db..66363bab 100644 --- a/components/ComingSoon.js +++ b/components/ComingSoon.js @@ -1,38 +1,34 @@ -import React from "react"; +import React from 'react'; -const ComingSoon = ({ closeClick }) => { +const ComingSoon = function ({ closeClick }) { return ( - <> -
-

- Coming soon -

-
-
-

Minority

-

Programmers

-

Team

-
- profile -
-
- +
+

+ Coming soon +

+
+
+

Minority

+

Programmers

+

Team

+ profile +
+
+
- +
); }; diff --git a/components/Consultancy.js b/components/Consultancy.js index 065b0546..0f4188f8 100644 --- a/components/Consultancy.js +++ b/components/Consultancy.js @@ -1,11 +1,11 @@ -import React from "react"; +import React from 'react'; -const Consultancy = () => { +const Consultancy = function () { return (

@@ -17,6 +17,7 @@ const Consultancy = () => { href="https://.gg/zGBrEd7UCn" target="_blank" className="thm-btn cta-one__btn" + rel="noreferrer" > Work With Us diff --git a/components/Consultancy/ConsultancyDashboard.js b/components/Consultancy/ConsultancyDashboard.js index 50ea36dc..655ed1eb 100644 --- a/components/Consultancy/ConsultancyDashboard.js +++ b/components/Consultancy/ConsultancyDashboard.js @@ -1,44 +1,47 @@ import React, { useEffect, useContext, useState } from 'react'; -const ConsultancyDashboard = ({ data }) => { - return ( -
-
-
-
-
- -
-
-

Hey, ({data.firstName})

-

Welcome back the Consultancy Program

-
-
-
-
-
- - -
-

Projects

-
-
-
- -
-

Quotes

-
-
-
- -
-

Task

-
-
-
+const ConsultancyDashboard = function ({ data }) { + return ( +
+
+
+
+
+
-
- ); +
+

+ Hey, ({data.firstName} + ) +

+

Welcome back the Consultancy Program

+
+
+
+
+
+ + +
+

Projects

+
+
+
+ +
+

Quotes

+
+
+
+ +
+

Task

+
+
+

+
+ + ); }; export default ConsultancyDashboard; diff --git a/components/Consultancy/ConsultancyHero.js b/components/Consultancy/ConsultancyHero.js index e27f636c..fe1dd85c 100644 --- a/components/Consultancy/ConsultancyHero.js +++ b/components/Consultancy/ConsultancyHero.js @@ -1,31 +1,27 @@ import React from 'react'; -const ConsultancyHero = () => { +const ConsultancyHero = function () { + const scrollTo = () => { + const section = document.querySelector('#all-startups'); + section.scrollIntoView({ behavior: 'smooth', block: 'start' }); + }; - const scrollTo = () => { - const section = document.querySelector('#all-startups'); - section.scrollIntoView({ behavior: 'smooth', block: 'start' }) - } - - - return ( - <> -
-
-
-
-
-

- Consultancy + return ( +
+
+
+
+
+

+ Consultancy

-

Get your idea turned into a complete web application ready for market with our transparent task-based escrow system that gives you as client, the control over how your product is being built.

-
-
-
-
-
- - ); +

Get your idea turned into a complete web application ready for market with our transparent task-based escrow system that gives you as client, the control over how your product is being built.

+

+
+
+
+
+ ); }; -export default ConsultancyHero; \ No newline at end of file +export default ConsultancyHero; diff --git a/components/Consultancy/ConsultancyHomeExplainer.js b/components/Consultancy/ConsultancyHomeExplainer.js index cea520f6..d2ca1b76 100644 --- a/components/Consultancy/ConsultancyHomeExplainer.js +++ b/components/Consultancy/ConsultancyHomeExplainer.js @@ -1,197 +1,205 @@ -import React, { useEffect, useContext, useState, useRef } from 'react'; -import { useRouter } from "next/router"; -import Link from "next/link"; +import React, { + useEffect, useContext, useState, useRef, +} from 'react'; +import { useRouter } from 'next/router'; +import Link from 'next/link'; import { GlobalContext } from '../../contexts/provider'; import { useDetectOutsideClick } from '../UseDetectOutsideClick'; -import Card from '../login-signup/card' - -const ConsultancyHomeExplainer = ({ data, active, clickRegister, setClickRegister, }) => { - const router = useRouter() - - const [click, setClick] = useState(false) - const dropdownRef = useRef(null); - const [isActive, setIsActive] = useDetectOutsideClick(dropdownRef, false); - const onClick = () => setIsActive(!isActive); - return ( -
-
- - -
-
-
-
- mentorSUP -
-
- num1 -
-
-
-
    -

    - Make Account

    -
  • - REGISTER for a Minority Programmers Association account.
  • -
  • - Go to CONSULTANCY page and submit your project idea.
  • -
  • - Get all the resources to BUILD a Large Scale Tech Business.
  • -
-
-
-
- - {/* start matching */} -
-
- -
-
    -

    Submit Your Idea

    -
  • - Submit your PROJECT PROPOSAL directly to a project manager.
  • -
  • - A MPA project manager will translate you requirements to a PROJECT QUOTE (budget, staffing, timeline, with a complete task break down and vesting schedule)
  • -
  • - You would be charge for a fee to project quotes.
  • -
-
-
-
- mentorSUP -
-
- num1 -
-
-
-
- - {/* start Program */} -
-
-
-
- mentorSUP -
-
- num1 -
-
-
-
    -

    Approve Quote

    -
  • - CHECK the quote propused by the project manager
  • -
  • - Stake your PAYMENT in $MINORITY tokens, to be paid out automatically based on completion of tasks.
  • -
  • - Wait for QUALIFIED TEAM members to take your task and submit tasks for review.
  • -
-
-
-
- - {/* gain */} -
-
-
-
    -

    Approve Tasks

    -
  • - Based on the DEFINITION OF DONE for complete tasks, approve them or submit them for review.
  • -
  • - Approval allows builders to directly get part of the budget PAID in $MINORITY. Do this until project is delivered. FINAL REVIEW
  • -
  • - If any disputes occur the Board of Project Managers settle it based on deliverables vs Definition of Done.
  • -
-
-
-
- mentorSUP -
-
- num1 -
-
-
-
- - {/* */} - - -
- {data ? - <> - - - - - - - - : <> - - - - } -
- - -
-

Are you a Project Manager?

-
-
-
- -
-

Apply for our - “Board of Project - Managers”

-
-
-
- -
-

Resolve consultancy disputes

-
-
-
- -
-

Earn $MINORITY

-
-
-
- - - {data === null ? - '' - : ( -
- - - -
- ) - } - - {clickRegister && active ? -
-
{ - setClickRegister(false) - }}> -
-
- -
- { setClickRegister(false) }}> -
: - "" - } +import Card from '../login-signup/card'; + +const ConsultancyHomeExplainer = function ({ + data, active, clickRegister, setClickRegister, +}) { + const router = useRouter(); + + const [click, setClick] = useState(false); + const dropdownRef = useRef(null); + const [isActive, setIsActive] = useDetectOutsideClick(dropdownRef, false); + const onClick = () => setIsActive(!isActive); + return ( +
+
+ + +
+
+
+
+ mentorSUP +
+
+ num1 +
+
+
+
    +

    - Make Account

    +
  • - REGISTER for a Minority Programmers Association account.
  • +
  • - Go to CONSULTANCY page and submit your project idea.
  • +
  • - Get all the resources to BUILD a Large Scale Tech Business.
  • +
+
+
+
+ + {/* start matching */} +
+
+ +
+
    +

    Submit Your Idea

    +
  • - Submit your PROJECT PROPOSAL directly to a project manager.
  • +
  • - A MPA project manager will translate you requirements to a PROJECT QUOTE (budget, staffing, timeline, with a complete task break down and vesting schedule)
  • +
  • - You would be charge for a fee to project quotes.
  • +
+
+
+
+ mentorSUP +
+
+ num1 +
+
+
+
+ + {/* start Program */} +
+
+
+
+ mentorSUP +
+
+ num1 +
+
+
+
    +

    Approve Quote

    +
  • - CHECK the quote propused by the project manager
  • +
  • - Stake your PAYMENT in $MINORITY tokens, to be paid out automatically based on completion of tasks.
  • +
  • - Wait for QUALIFIED TEAM members to take your task and submit tasks for review.
  • +
+
+
+
+ + {/* gain */} +
+
+
+
    +

    Approve Tasks

    +
  • - Based on the DEFINITION OF DONE for complete tasks, approve them or submit them for review.
  • +
  • - Approval allows builders to directly get part of the budget PAID in $MINORITY. Do this until project is delivered. FINAL REVIEW
  • +
  • - If any disputes occur the Board of Project Managers settle it based on deliverables vs Definition of Done.
  • +
+
+
+
+ mentorSUP +
+
+ num1 +
+
+
+
+ + {/* */} + +
+ {data + ? ( + <> + + + + + + + + ) + : ( + <> + + + + )} +
+ +
+

Are you a Project Manager?

+
+
+
+ +
+

+ Apply for our + “Board of Project + Managers” +

+
+
+
+ +
+

Resolve consultancy disputes

+
+
+
+ +
+

Earn $MINORITY

+
+
+
+ + {data === null + ? '' + : ( +
+ + + +
+ )} + + {clickRegister && active + ? ( +
+
{ + setClickRegister(false); + }} + > +
+
+ +
+ { setClickRegister(false); }} />
-
- ); + ) + : ''} +
+
+ ); }; -export default ConsultancyHomeExplainer; \ No newline at end of file +export default ConsultancyHomeExplainer; diff --git a/components/Consultancy/consultancyHome.js b/components/Consultancy/consultancyHome.js index 2cab4484..2310b1e5 100644 --- a/components/Consultancy/consultancyHome.js +++ b/components/Consultancy/consultancyHome.js @@ -1,22 +1,24 @@ -import { useEffect, useState, Fragment } from "react"; -import Wireframe1 from "./wireframes/wireframe1"; +import { useEffect, useState, Fragment } from 'react'; +import Wireframe1 from './wireframes/wireframe1'; // import Card from "../login-signup/card"; -import LoginPage from "./helperFiles/login-page"; -import Page1 from "./steps/step1"; -import Page2 from "./steps/step2"; -import Page3 from "./steps/step3"; -import Page4 from "./steps/step4"; -import Page5 from "./steps/step5"; -import Page6 from "./steps/step6"; -import Page7 from "./steps/step7"; -import Page8 from "./steps/step8"; -import Page9 from "./steps/step9"; -import Page10 from "./steps/step10"; -import Page11 from "./steps/step11"; +import LoginPage from './helperFiles/login-page'; +import Page1 from './steps/step1'; +import Page2 from './steps/step2'; +import Page3 from './steps/step3'; +import Page4 from './steps/step4'; +import Page5 from './steps/step5'; +import Page6 from './steps/step6'; +import Page7 from './steps/step7'; +import Page8 from './steps/step8'; +import Page9 from './steps/step9'; +import Page10 from './steps/step10'; +import Page11 from './steps/step11'; -let localStorageConsultancyKey = "consultancy-questions"; -let localStorageStepKey = "consultancy-step"; -function Consultancy({ data, active, clickRegister, setClickRegister }) { +const localStorageConsultancyKey = 'consultancy-questions'; +const localStorageStepKey = 'consultancy-step'; +const Consultancy = function ({ + data, active, clickRegister, setClickRegister, +}) { const [step, setstep] = useState(0); const [questions, setQuestions] = useState({}); console.log(questions); @@ -28,46 +30,39 @@ function Consultancy({ data, active, clickRegister, setClickRegister }) { }, [data]); function getLocalVariables(key, wrapFxn, defaultValue) { - let hasKey = window.localStorage.getItem(key); + const hasKey = window.localStorage.getItem(key); console.log(hasKey); if (hasKey) { return wrapFxn(hasKey); - } else { - return defaultValue; } + return defaultValue; } useEffect(() => { - setQuestions((prev) => { - return getLocalVariables( - localStorageConsultancyKey, - (value) => { - console.log(value); - return JSON.parse(JSON.parse(JSON.stringify(value))); - }, - prev - ); - }); + setQuestions((prev) => getLocalVariables( + localStorageConsultancyKey, + (value) => { + console.log(value); + return JSON.parse(JSON.parse(JSON.stringify(value))); + }, + prev, + )); if (data === null) { setClickRegister(true); } else { - setstep((prev) => { - return getLocalVariables( - localStorageStepKey, - (value) => { - return parseInt(value); - }, - prev - ); - }); + setstep((prev) => getLocalVariables( + localStorageStepKey, + (value) => parseInt(value), + prev, + )); } }, []); useEffect(() => { - let lenght_of_questions = Object.values(questions).length; + const lenght_of_questions = Object.values(questions).length; if (lenght_of_questions > 0 && lenght_of_questions + 1 >= step) { window.localStorage.setItem( localStorageConsultancyKey, - JSON.stringify(questions) + JSON.stringify(questions), ); } }, [questions, step]); @@ -78,8 +73,8 @@ function Consultancy({ data, active, clickRegister, setClickRegister }) { }, [step]); return ( - -
+ <> +
{step == 0 && ( - + ); -} +}; export default Consultancy; diff --git a/components/Consultancy/helperFiles/addQuestion.js b/components/Consultancy/helperFiles/addQuestion.js index 91a205ed..03fd3072 100644 --- a/components/Consultancy/helperFiles/addQuestion.js +++ b/components/Consultancy/helperFiles/addQuestion.js @@ -1,9 +1,7 @@ function addQuestion(setQuestions, step, allQuestions) { - setQuestions((prev) => { - return { - ...prev, - [`question${step - 1}`]: allQuestions, - }; - }); + setQuestions((prev) => ({ + ...prev, + [`question${step - 1}`]: allQuestions, + })); } export default addQuestion; diff --git a/components/Consultancy/helperFiles/blurBackground.js b/components/Consultancy/helperFiles/blurBackground.js index 97851210..19c763b8 100644 --- a/components/Consultancy/helperFiles/blurBackground.js +++ b/components/Consultancy/helperFiles/blurBackground.js @@ -1,13 +1,13 @@ -import { useEffect, useRef } from "react"; +import { useEffect, useRef } from 'react'; -function BlurBackground({ children }) { +const BlurBackground = function ({ children }) { useEffect(() => { - document.body.classList.add("hide-overflow"); + document.body.classList.add('hide-overflow'); }, []); return (
{children}
); -} +}; export default BlurBackground; diff --git a/components/Consultancy/helperFiles/buttons.js b/components/Consultancy/helperFiles/buttons.js index f22038d7..f3534051 100644 --- a/components/Consultancy/helperFiles/buttons.js +++ b/components/Consultancy/helperFiles/buttons.js @@ -1,7 +1,7 @@ -import { Fragment } from "react"; +import { Fragment } from 'react'; const dummyFunction = () => {}; -function Buttons({ +const Buttons = function ({ left, right, marginTop, @@ -31,11 +31,11 @@ function Buttons({ style={marginTop ? { marginTop } : {}} > - {customPlusText ? customPlusText : } + {customPlusText || <>→} ) : null}
); -} +}; export default Buttons; diff --git a/components/Consultancy/helperFiles/customInputTags/checkbox.js b/components/Consultancy/helperFiles/customInputTags/checkbox.js index 69a1c260..805def42 100644 --- a/components/Consultancy/helperFiles/customInputTags/checkbox.js +++ b/components/Consultancy/helperFiles/customInputTags/checkbox.js @@ -1,7 +1,7 @@ -import { Fragment, useEffect, useRef } from "react"; -import ErrorPrint from "../errorPrint"; +import { Fragment, useEffect, useRef } from 'react'; +import ErrorPrint from '../errorPrint'; -function Checkboxes({ +const Checkboxes = function ({ checkboxes, setCheckboxes, checkBoxLabels, @@ -16,15 +16,13 @@ function Checkboxes({ const arr = []; for (let i = 0; i < checkBoxLabels.length; i++) { const bool = defaultValue - ? defaultValue.indexOf(checkBoxLabels[i]) === -1 - ? false - : true + ? defaultValue.indexOf(checkBoxLabels[i]) !== -1 : false; const obj = { label: checkBoxLabels[i], checked: bool }; arr.push(obj); } return arr; - })(), + }()), ]); function validateSubmission(validList) { setCheckboxes([questionStr, validList]); @@ -35,16 +33,14 @@ function Checkboxes({ } }, []); const validateCheckBox = () => { - let checkedCheckboxes = options.current + const checkedCheckboxes = options.current .filter((checkbox) => { if (checkbox.checked) { return true; } return false; }) - .map((checkbox) => { - return checkbox.label; - }); + .map((checkbox) => checkbox.label); if (checkboxes === null) { invalidSymbol.current = checkboxes; @@ -57,39 +53,36 @@ function Checkboxes({ }; return ( - -
- {options.current.map((checkbox, index) => { - return ( -
-
{ - options.current[index].checked = - !options.current[index].checked; - validateCheckBox(); - }} - > - +
+ {options.current.map((checkbox, index) => ( +
+
{ + options.current[index].checked = !options.current[index].checked; + validateCheckBox(); + }} + > + -
-
{checkbox.label}
+ aria-hidden="true" + />
- ); - })} +
{checkbox.label}
+
+ ))}
{checkboxes === null ? ( ) : null} - + ); -} +}; export default Checkboxes; diff --git a/components/Consultancy/helperFiles/customInputTags/input.js b/components/Consultancy/helperFiles/customInputTags/input.js index 797e11e2..61a6e399 100644 --- a/components/Consultancy/helperFiles/customInputTags/input.js +++ b/components/Consultancy/helperFiles/customInputTags/input.js @@ -1,28 +1,28 @@ -import { Fragment } from "react"; -import ErrorPrint from "../errorPrint"; +import { Fragment } from 'react'; +import ErrorPrint from '../errorPrint'; -//undefined ---> the input was just initialized -//[] ---> the input is incorrect -//string ---> the input is correct +// undefined ---> the input was just initialized +// [] ---> the input is incorrect +// string ---> the input is correct -function Input({ +const Input = function ({ inputValue, handleInputChange, - inputType = "text", - placeholder = "Please enter text", + inputType = 'text', + placeholder = 'Please enter text', defaultValue, }) { return ( - + <> {inputValue instanceof Array ? : null} - + ); -} +}; export default Input; diff --git a/components/Consultancy/helperFiles/customInputTags/inputWithIcon.js b/components/Consultancy/helperFiles/customInputTags/inputWithIcon.js index 834d07ca..15522d0f 100644 --- a/components/Consultancy/helperFiles/customInputTags/inputWithIcon.js +++ b/components/Consultancy/helperFiles/customInputTags/inputWithIcon.js @@ -1,6 +1,6 @@ -import { Fragment } from "react"; +import { Fragment } from 'react'; -function InputWithIcon({ +const InputWithIcon = function ({ marginTop, label, placeholder, @@ -9,7 +9,7 @@ function InputWithIcon({ defaultValue, iconLink, validationMethod, - color = "var(--mpa-navy)", + color = 'var(--mpa-navy)', width, hideIcon, maxLength, @@ -20,15 +20,15 @@ function InputWithIcon({ id, }) { return ( -
+
-
+
{/* the email input */}
); -} +}; export default InputWithIcon; diff --git a/components/Consultancy/helperFiles/customInputTags/select.js b/components/Consultancy/helperFiles/customInputTags/select.js index eb742548..3c4a243d 100644 --- a/components/Consultancy/helperFiles/customInputTags/select.js +++ b/components/Consultancy/helperFiles/customInputTags/select.js @@ -1,52 +1,51 @@ -import { useMemo, useState, useRef, useEffect, Fragment } from "react"; -import ErrorPrint from "../errorPrint"; +import { + useMemo, useState, useRef, useEffect, Fragment, +} from 'react'; +import ErrorPrint from '../errorPrint'; -//--->undefined means waiting on submission -//--->null means invalid entry -//-->[] means correct entry -const Select = ({ +// --->undefined means waiting on submission +// --->null means invalid entry +// -->[] means correct entry +const Select = function ({ options, setSelected, selected, - questionStr = "", + questionStr = '', optionsShowByDefault = false, defaultValue, children, sizeOfParent = 80, turnOffLeftBorder = false, - defaultStr = "...Select an option", + defaultStr = '...Select an option', watchNull, colorScheme = { - mainColor: "", - hoverColor: "", - selectedFontColor: "", + mainColor: '', + hoverColor: '', + selectedFontColor: '', }, -}) => { +}) { const [dropDown, setDropDown] = useState(optionsShowByDefault); - const updatedOptions = useMemo(() => { - return [defaultStr, ...options]; - }, [options]); + const updatedOptions = useMemo(() => [defaultStr, ...options], [options]); const { - mainColor = "", - hoverColor = "", - selectedFontColor = "", + mainColor = '', + hoverColor = '', + selectedFontColor = '', } = colorScheme; const selectedIndex = useRef( - defaultValue === undefined ? 0 : defaultValue + 1 + defaultValue === undefined ? 0 : defaultValue + 1, ); const invalidSymbol = useRef(undefined); function validateSubmission() { setSelected([questionStr, updatedOptions[selectedIndex.current]]); } - const getRootVariable = (str) => - parseInt( - window.getComputedStyle(document.body).getPropertyValue("--" + str) - ); + const getRootVariable = (str) => parseInt( + window.getComputedStyle(document.body).getPropertyValue(`--${str}`), + ); - const maximumOptionHeight = getRootVariable("maximumOptionPerScrollable"); - const optionHeight = getRootVariable("optionHeight"); + const maximumOptionHeight = getRootVariable('maximumOptionPerScrollable'); + const optionHeight = getRootVariable('optionHeight'); const validateSelection = () => { if (selected === null) { @@ -66,59 +65,61 @@ const Select = ({ }, []); useEffect(() => { function closeDropDown(e) { - if (e.target.className.indexOf("option-item") === -1 && dropDown) { + if (e.target.className.indexOf('option-item') === -1 && dropDown) { setDropDown(false); } } - window.addEventListener("click", closeDropDown); - return () => window.removeEventListener("click", closeDropDown); + window.addEventListener('click', closeDropDown); + return () => window.removeEventListener('click', closeDropDown); }, [dropDown]); return ( - + <>
- + `} +
{updatedOptions[selectedIndex.current]} + />
- {updatedOptions.map((option, index) => { - return ( -
{ - selectedIndex.current = index; + {updatedOptions.map((option, index) => ( +
{ + selectedIndex.current = index; - validateSelection(); + validateSelection(); - setDropDown(false); - }} - > - + - {option} - -
- ); - })} + }} + > + {option} + +
+ ))}
@@ -174,9 +171,9 @@ const Select = ({
{selected === null || watchNull ? ( - + ) : null} -
+ ); }; export default Select; diff --git a/components/Consultancy/helperFiles/customInputTags/tagInput.js b/components/Consultancy/helperFiles/customInputTags/tagInput.js index 7d244f29..a6dff5b0 100644 --- a/components/Consultancy/helperFiles/customInputTags/tagInput.js +++ b/components/Consultancy/helperFiles/customInputTags/tagInput.js @@ -1,44 +1,43 @@ -import { useEffect, useMemo, useRef } from "react"; +import { useEffect, useMemo, useRef } from 'react'; + const defaultCriteriaCheck = (callback, input, prevArr) => { if (input.length > 0 && prevArr.indexOf(input) === -1) { callback(); } }; -function TagInput({ +const TagInput = function ({ children, listOfTags, updateListOfTags, criteriaCheck = defaultCriteriaCheck, - targetCode = "Enter", + targetCode = 'Enter', }) { const inputRef = useRef(); const containerRef = useRef(); useEffect(() => { function handleTagCreation(e) { - //function that actually saves the input + // function that actually saves the input function callback() { - updateListOfTags((prev) => { - return [...prev, inputRef.current.value]; - }); - inputRef.current.value = ""; + updateListOfTags((prev) => [...prev, inputRef.current.value]); + inputRef.current.value = ''; if (containerRef.current) { containerRef.current.scrollLeft = containerRef.current.scrollWidth; } } - //check to see that the we are listening on submission of new tag + // check to see that the we are listening on submission of new tag if ( - e.code === targetCode && - inputRef.current === document.activeElement + e.code === targetCode + && inputRef.current === document.activeElement ) { try { - //call end users validation function, if the function sent back is invalid, we run my validation function - //we also send in a function that the end user runs when the validation test passes, the input string end user could use for validation, an array of list of all tags + // call end users validation function, if the function sent back is invalid, we run my validation function + // we also send in a function that the end user runs when the validation test passes, the input string end user could use for validation, an array of list of all tags criteriaCheck( () => { callback(); }, inputRef.current.value, - [...listOfTags] + [...listOfTags], ); } catch (e) { defaultCriteriaCheck( @@ -46,22 +45,21 @@ function TagInput({ callback(); }, inputRef.current.value, - [...listOfTags] + [...listOfTags], ); } } } - window.addEventListener("keydown", handleTagCreation); - return () => window.removeEventListener("keydown", handleTagCreation); + window.addEventListener('keydown', handleTagCreation); + return () => window.removeEventListener('keydown', handleTagCreation); }, [listOfTags]); const calculateWidth = useMemo(() => { if (listOfTags.length > 0) { - return "small-width"; - } else { - return ""; + return 'small-width'; } + return ''; }, [listOfTags]); return (
- {listOfTags.map((tag, index) => { - return ( -
- {tag} - { - updateListOfTags((prev) => { - const retArr = [...prev]; - let indexOfRemoved = retArr.indexOf(tag); - retArr.splice(indexOfRemoved, 1); - return retArr; - }); - }} - > - × - {" "} -
- ); - })} + {listOfTags.map((tag, index) => ( +
+ {tag} + { + updateListOfTags((prev) => { + const retArr = [...prev]; + const indexOfRemoved = retArr.indexOf(tag); + retArr.splice(indexOfRemoved, 1); + return retArr; + }); + }} + > + × + + {' '} +
+ ))}
); -} +}; export default TagInput; diff --git a/components/Consultancy/helperFiles/errorPrint.js b/components/Consultancy/helperFiles/errorPrint.js index 9de51781..6714dda3 100644 --- a/components/Consultancy/helperFiles/errorPrint.js +++ b/components/Consultancy/helperFiles/errorPrint.js @@ -1,20 +1,20 @@ -function ErrorPrint({ errors = [], red, left }) { +const ErrorPrint = function ({ errors = [], red, left }) { return (
- {errors.map((error, index) => { - return ( -

- - {error} -

- ); - })} + {errors.map((error, index) => ( +

+ - + {' '} + {error} +

+ ))}
); -} +}; export default ErrorPrint; diff --git a/components/Consultancy/helperFiles/getDefaultValue.js b/components/Consultancy/helperFiles/getDefaultValue.js index 65750d83..f580fde7 100644 --- a/components/Consultancy/helperFiles/getDefaultValue.js +++ b/components/Consultancy/helperFiles/getDefaultValue.js @@ -1,13 +1,13 @@ -import { useMemo } from "react"; +import { useMemo } from 'react'; export function useDefaultValue(questions, step, index) { return useMemo(() => { try { - console.log("set"); + console.log('set'); return questions[`question${step - 1}`][index].answer; } catch (e) { console.log(e); - return ""; + return ''; } }, [questions, step]); } diff --git a/components/Consultancy/helperFiles/getFormattedOutput.js b/components/Consultancy/helperFiles/getFormattedOutput.js index 18fee181..8824fcdd 100644 --- a/components/Consultancy/helperFiles/getFormattedOutput.js +++ b/components/Consultancy/helperFiles/getFormattedOutput.js @@ -1,8 +1,6 @@ export function getFormattedOutput(questions, myEmail) { - const prefix = "question"; - const getArray = (index, innerIndex) => { - return questions[prefix + index][innerIndex]; - }; + const prefix = 'question'; + const getArray = (index, innerIndex) => questions[prefix + index][innerIndex]; return { project_name: getArray(0, 0).answer, industry: getArray(1, 0).answer, diff --git a/components/Consultancy/helperFiles/keepingUpWithStep.js b/components/Consultancy/helperFiles/keepingUpWithStep.js index 03b10364..539a19bc 100644 --- a/components/Consultancy/helperFiles/keepingUpWithStep.js +++ b/components/Consultancy/helperFiles/keepingUpWithStep.js @@ -1,16 +1,15 @@ -import { Fragment } from "react"; +import { Fragment } from 'react'; const totalSteps = 9; -function KeepingUpWithStep({ selected, marginTop = 0 }) { - const calculateLinePercentage = () => - selected === 0 ? 0 : ((selected - 1) / (totalSteps - 1)) * 100; +const KeepingUpWithStep = function ({ selected, marginTop = 0 }) { + const calculateLinePercentage = () => (selected === 0 ? 0 : ((selected - 1) / (totalSteps - 1)) * 100); const percentageOfBlueLine = Number.isInteger(selected) ? calculateLinePercentage() - : ""; + : ''; return ( - + <> {selected <= totalSteps ? (
{ - return ( - = index ? "selectedStep" : "" - }`} - > - {index} - - ); - })} + }()), + ].map((index) => ( + = index ? 'selectedStep' : '' + }`} + > + {index} + + ))}
) : null} - + ); -} +}; export default KeepingUpWithStep; diff --git a/components/Consultancy/helperFiles/login-page.js b/components/Consultancy/helperFiles/login-page.js index c20ec1ad..39ec2f42 100644 --- a/components/Consultancy/helperFiles/login-page.js +++ b/components/Consultancy/helperFiles/login-page.js @@ -1,9 +1,9 @@ -import { Fragment } from "react"; -import Card from "../../login-signup/card"; +import { Fragment } from 'react'; +import Card from '../../login-signup/card'; -function LoginPage({ setClickRegister, clickRegister }) { +const LoginPage = function ({ setClickRegister, clickRegister }) { return ( - + <> {clickRegister ? (
{ setClickRegister(false); }} - >
+ />
- +
{ setClickRegister(false); }} - > + />
) : ( - "" + '' )} -
+ ); -} +}; export default LoginPage; diff --git a/components/Consultancy/helperFiles/needHelp.js b/components/Consultancy/helperFiles/needHelp.js index e04ef9ed..3225f1e7 100644 --- a/components/Consultancy/helperFiles/needHelp.js +++ b/components/Consultancy/helperFiles/needHelp.js @@ -1,8 +1,8 @@ -function NeedHelp({ link = "#" }) { +const NeedHelp = function ({ link = '#' }) { return ( ); -} +}; export default NeedHelp; diff --git a/components/Consultancy/helperFiles/overlayCard.js b/components/Consultancy/helperFiles/overlayCard.js index a34f0632..53353246 100644 --- a/components/Consultancy/helperFiles/overlayCard.js +++ b/components/Consultancy/helperFiles/overlayCard.js @@ -1,8 +1,8 @@ -function OverlayCard({ children }) { +const OverlayCard = function ({ children }) { return (
{children}
); -} +}; export default OverlayCard; diff --git a/components/Consultancy/helperFiles/questionContainer.js b/components/Consultancy/helperFiles/questionContainer.js index eab26451..3c443fe5 100644 --- a/components/Consultancy/helperFiles/questionContainer.js +++ b/components/Consultancy/helperFiles/questionContainer.js @@ -1,8 +1,8 @@ -import { useEffect } from "react"; -import Buttons from "./buttons"; -import KeepingUpWithStep from "./keepingUpWithStep"; +import { useEffect } from 'react'; +import Buttons from './buttons'; +import KeepingUpWithStep from './keepingUpWithStep'; -function QuestionContainer({ +const QuestionContainer = function ({ children, left, right, @@ -11,8 +11,8 @@ function QuestionContainer({ minus, step, style, - className = "", - id = "", + className = '', + id = '', customPlusText, keepingUpMarginTop, }) { @@ -34,7 +34,7 @@ function QuestionContainer({ return (
@@ -51,5 +51,5 @@ function QuestionContainer({
); -} +}; export default QuestionContainer; diff --git a/components/Consultancy/helperFiles/temp.js b/components/Consultancy/helperFiles/temp.js index d62feb7d..eb0fdd68 100644 --- a/components/Consultancy/helperFiles/temp.js +++ b/components/Consultancy/helperFiles/temp.js @@ -1,17 +1,17 @@ -import { useState } from "react"; -import Select from "../customInputTags/select"; -import QuestionContainer from "../questionContainer"; -import { useDefaultValue } from "../getDefaultValue"; -import addQuestion from "../addQuestion"; +import { useState } from 'react'; +import Select from '../customInputTags/select'; +import QuestionContainer from '../questionContainer'; +import { useDefaultValue } from '../getDefaultValue'; +import addQuestion from '../addQuestion'; -function SelectTemplate({ +const SelectTemplate = function ({ step, setstep, questions, setQuestions, options = [], secondOptions, - question1 = "", + question1 = '', }) { const defaultValueSelected = useDefaultValue(questions, step, 0); const defaultSecondValueSelected = useDefaultValue(questions, step, 1); @@ -21,15 +21,16 @@ function SelectTemplate({ const [secondSelected, setSecondSelected] = useState(undefined); function pageFourQuestion() { - if (secondOptions) + if (secondOptions) { addQuestion(setQuestions, step, [ { question: selected[0], answer: selected[1] }, { question: secondSelected[0], answer: secondSelected[1] }, ]); - else + } else { addQuestion(setQuestions, step, [ { question: selected[0], answer: selected[1] }, ]); + } } function shouldSave() { let bool = selected instanceof Array; @@ -90,5 +91,5 @@ function SelectTemplate({ ); -} +}; export default SelectTemplate; diff --git a/components/Consultancy/helperFiles/templates/selectTemplate.js b/components/Consultancy/helperFiles/templates/selectTemplate.js index fb9f58cb..7849cbc8 100644 --- a/components/Consultancy/helperFiles/templates/selectTemplate.js +++ b/components/Consultancy/helperFiles/templates/selectTemplate.js @@ -1,30 +1,30 @@ -import { useEffect, useState, useRef } from "react"; -import Select from "../customInputTags/select"; -import QuestionContainer from "../questionContainer"; -import { useDefaultValue } from "../getDefaultValue"; -import addQuestion from "../addQuestion"; +import { useEffect, useState, useRef } from 'react'; +import Select from '../customInputTags/select'; +import QuestionContainer from '../questionContainer'; +import { useDefaultValue } from '../getDefaultValue'; +import addQuestion from '../addQuestion'; -//structure of childRenderInfo -//--->renderWhenOptionIs = 0 -//--->answerToInput = '' -//--->validationFxn = ()=>{} +// structure of childRenderInfo +// --->renderWhenOptionIs = 0 +// --->answerToInput = '' +// --->validationFxn = ()=>{} const default_childRenderInfo = { renderWhenOptionIs: 0, - answerToInput: "", + answerToInput: '', validateChild: () => {}, onStart: () => {}, childChanged: false, }; -function SelectTemplate({ +const SelectTemplate = function ({ step, setstep, questions, setQuestions, options = [], secondOptions, - question1 = "", + question1 = '', children, childRenderInfo = default_childRenderInfo, }) { @@ -37,11 +37,11 @@ function SelectTemplate({ function childFound() { return ( - children && - Number.isInteger(childRenderInfo.renderWhenOptionIs) && - selected && - childRenderInfo.renderWhenOptionIs === - (selected[1] ? options.indexOf(selected[1]) : -1) + children + && Number.isInteger(childRenderInfo.renderWhenOptionIs) + && selected + && childRenderInfo.renderWhenOptionIs + === (selected[1] ? options.indexOf(selected[1]) : -1) ); } const childStarted = useRef(false); @@ -58,23 +58,25 @@ function SelectTemplate({ function pageFourQuestion() { function defineAnswers() { const answers = []; - //first answer + // first answer answers.push({ - question: selected ? selected[0] : "", - answer: selected ? selected[1] : "", + question: selected ? selected[0] : '', + answer: selected ? selected[1] : '', }); - //if we have a second input - if (secondOptions) + // if we have a second input + if (secondOptions) { answers.push({ - question: secondSelected ? secondSelected[0] : "", - answer: secondSelected ? secondSelected[1] : "", + question: secondSelected ? secondSelected[0] : '', + answer: secondSelected ? secondSelected[1] : '', }); - //if child, add answer of child - if (childFound()) + } + // if child, add answer of child + if (childFound()) { answers.push({ - question: selected ? selected[0] : "", + question: selected ? selected[0] : '', answer: childRenderInfo.answerToInput, }); + } return answers; } addQuestion(setQuestions, step, defineAnswers()); @@ -84,12 +86,13 @@ function SelectTemplate({ if (secondOptions) { bool = bool && secondSelected instanceof Array; } - if (childFound()) + if (childFound()) { try { bool = bool && childRenderInfo.validateChild(); } catch (e) { bool = false; } + } return bool; } @@ -121,7 +124,7 @@ function SelectTemplate({ @@ -149,7 +152,7 @@ function SelectTemplate({ : -1 } colorScheme={{ - selectedFontColor: "var(--mpa-navy)", + selectedFontColor: 'var(--mpa-navy)', }} /> ) : null} @@ -157,5 +160,5 @@ function SelectTemplate({ {childFound() ? children : null} ); -} +}; export default SelectTemplate; diff --git a/components/Consultancy/steps/step1.js b/components/Consultancy/steps/step1.js index a8f8468a..8a76a447 100644 --- a/components/Consultancy/steps/step1.js +++ b/components/Consultancy/steps/step1.js @@ -1,4 +1,4 @@ -function Page1({ setstep, setClickRegister, data }) { +const Page1 = function ({ setstep, setClickRegister, data }) { return (
@@ -27,5 +27,5 @@ function Page1({ setstep, setClickRegister, data }) {
); -} +}; export default Page1; diff --git a/components/Consultancy/steps/step10.js b/components/Consultancy/steps/step10.js index e2763639..1221fa68 100644 --- a/components/Consultancy/steps/step10.js +++ b/components/Consultancy/steps/step10.js @@ -1,15 +1,15 @@ -import { useRef, useState, useEffect, Fragment } from "react"; -import QuestionContainer from "../helperFiles/questionContainer"; -import InputWithIcon from "../helperFiles/customInputTags/inputWithIcon"; -import ErrorPrint from "../helperFiles/errorPrint"; -import addQuestion from "../helperFiles/addQuestion"; -import Axios from "axios"; +import { + useRef, useState, useEffect, Fragment, +} from 'react'; +import Axios from 'axios'; +import QuestionContainer from '../helperFiles/questionContainer'; +import InputWithIcon from '../helperFiles/customInputTags/inputWithIcon'; +import ErrorPrint from '../helperFiles/errorPrint'; +import addQuestion from '../helperFiles/addQuestion'; const getFormattedOutput = (questions, myEmail) => { - const prefix = "question"; - const getArray = (index, innerIndex) => { - return questions[prefix + index][innerIndex]; - }; + const prefix = 'question'; + const getArray = (index, innerIndex) => questions[prefix + index][innerIndex]; return { project_name: getArray(0, 0).answer, industry: getArray(1, 0).answer, @@ -33,7 +33,7 @@ const getFormattedOutput = (questions, myEmail) => { // AXIOS INSTANCE const axios = Axios.create({ - baseURL: "https://koinstreet-learn-api.herokuapp.com/api/v1/service", + baseURL: 'https://koinstreet-learn-api.herokuapp.com/api/v1/service', }); const defaultChecked = 0; @@ -45,7 +45,7 @@ class dependency { type, validationFxn, onInput = () => {}, - correctLength + correctLength, ) { this.label = label; this.placeholder = placeholder; @@ -61,7 +61,7 @@ class dependency { class Radio { constructor(label, id, dependencies = []) { this.label = label; - this.id = "page10" + id; + this.id = `page10${id}`; this.dependencies = dependencies; } } @@ -73,41 +73,40 @@ function try_catch(fxn, invalid) { } } function basic_text_validation(value) { - const invalid = "Text input is required"; + const invalid = 'Text input is required'; return try_catch(() => { - if (value && typeof value === "string" && value.length >= 0) { - return ""; - } else { - return invalid; + if (value && typeof value === 'string' && value.length >= 0) { + return ''; } + return invalid; }, invalid); } function basic_number_validation(value, correctLength) { - const invalid = "Incorrect entry"; + const invalid = 'Incorrect entry'; return try_catch(() => { - let valid_arr = value.match(/[0-9]/g); + const valid_arr = value.match(/[0-9]/g); console.log(valid_arr, correctLength); if (valid_arr) { - return valid_arr.length === correctLength ? "" : invalid; + return valid_arr.length === correctLength ? '' : invalid; } return invalid; }, invalid); } function basic_date_validation() { - return ""; + return ''; } function createEntry(e) { - var value = e.target.value; - var cursor = e.target.selectionStart; - var matches = value.substring(0, cursor).match(/[^0-9]/g); + let { value } = e.target; + let cursor = e.target.selectionStart; + const matches = value.substring(0, cursor).match(/[^0-9]/g); if (matches) cursor -= matches.length; - value = value.replace(/[^0-9]/g, "").substring(0, 16); - var formatted = ""; - for (var i = 0, n = value.length; i < n; i++) { + value = value.replace(/[^0-9]/g, '').substring(0, 16); + let formatted = ''; + for (let i = 0, n = value.length; i < n; i++) { if (i && i % 4 == 0) { if (formatted.length <= cursor) cursor += 2; - formatted += " "; + formatted += ' '; } formatted += value[i]; } @@ -116,16 +115,16 @@ function createEntry(e) { e.target.selectionEnd = cursor; } function createDateEntry(e) { - var value = e.target.value; - var cursor = e.target.selectionStart; - var matches = value.substring(0, cursor).match(/[^0-9]/g); + let { value } = e.target; + let cursor = e.target.selectionStart; + const matches = value.substring(0, cursor).match(/[^0-9]/g); if (matches) cursor -= matches.length; - value = value.replace(/[^0-9]/g, "").substring(0, 6); - var formatted = ""; - for (var i = 0, n = value.length; i < n; i++) { + value = value.replace(/[^0-9]/g, '').substring(0, 6); + let formatted = ''; + for (let i = 0, n = value.length; i < n; i++) { if (i == 2) { if (formatted.length <= cursor) cursor += 1; - formatted += "/"; + formatted += '/'; } formatted += value[i]; } @@ -133,7 +132,9 @@ function createDateEntry(e) { e.target.value = formatted; e.target.selectionEnd = cursor; } -function Page10({ step, setstep, questions, setQuestions, data }) { +const Page10 = function ({ + step, setstep, questions, setQuestions, data, +}) { const card_full_name = useRef(); const card_number = useRef(); const card_expiry_date = useRef(); @@ -146,84 +147,84 @@ function Page10({ step, setstep, questions, setQuestions, data }) { }); const [serverError, setServerError] = useState([]); const [checked, setChecked] = useState(defaultChecked); - let a = 40.0; - let b = 10.0; - let c = a + b; + const a = 40.0; + const b = 10.0; + const c = a + b; const allRadios = [ new Radio( [ - "Credit Card/Debit Card", + 'Credit Card/Debit Card',
and more...
, ], - "card", + 'card', [ new dependency( - "* Card Owner", - "Full Name", + '* Card Owner', + 'Full Name', card_full_name, - "text", - basic_text_validation + 'text', + basic_text_validation, ), new dependency( - "* Card Number", - "**** **** **** ****", + '* Card Number', + '**** **** **** ****', card_number, - "tel", + 'tel', basic_number_validation, createEntry, - 16 + 16, ), new dependency( - "* Card Expiry Date", - "mm/yyyy", + '* Card Expiry Date', + 'mm/yyyy', card_expiry_date, - "tel", + 'tel', basic_number_validation, createDateEntry, - 6 + 6, ), new dependency( - "* Card Security Code (CVV2)", - "***", + '* Card Security Code (CVV2)', + '***', card_security_code, - "tel", + 'tel', basic_number_validation, createEntry, - 3 + 3, ), - ] + ], ), new Radio( [ - "Pay Pal", + 'Pay Pal',
, ], - "paypal" + 'paypal', ), - new Radio(["Pay in $Minority"], "minority"), - new Radio(["Electronic Check"], "electronic-check"), + new Radio(['Pay in $Minority'], 'minority'), + new Radio(['Electronic Check'], 'electronic-check'), ]; useEffect(() => { if (shouldSubmit) { - console.log(window.localStorage.getItem("jwtToken")); + console.log(window.localStorage.getItem('jwtToken')); const config = { headers: { - "Content-Type": "application/json", - Accept: "application/json", - Authorization: `Bearer ${window.localStorage.getItem("jwtToken")}`, + 'Content-Type': 'application/json', + Accept: 'application/json', + Authorization: `Bearer ${window.localStorage.getItem('jwtToken')}`, }, }; axios - .post("/", getFormattedOutput(questions, data.email), config) + .post('/', getFormattedOutput(questions, data.email), config) .then(() => { setstep((prev) => prev + 1); }) @@ -232,8 +233,7 @@ function Page10({ step, setstep, questions, setQuestions, data }) { let feedback = e.response.data.data ? e.response.data.data.message : e.response.data.message; - feedback = - typeof feedback === "string" ? [feedback] : Object.values(feedback); + feedback = typeof feedback === 'string' ? [feedback] : Object.values(feedback); setServerError(feedback); }); } @@ -242,9 +242,7 @@ function Page10({ step, setstep, questions, setQuestions, data }) { setErrors((prev) => { const prevObj = { ...prev }; prevObj.inputs = [ - ...allRadios[checked].dependencies.map(() => { - return [undefined]; - }), + ...allRadios[checked].dependencies.map(() => [undefined]), ]; return prevObj; }); @@ -252,7 +250,7 @@ function Page10({ step, setstep, questions, setQuestions, data }) { function addToQuestion(paymentInfo) { addQuestion(setQuestions, step, [ { - question: "Choose your payment method and provide your payment info?", + question: 'Choose your payment method and provide your payment info?', answer: { paymentMethod: allRadios[checked].label[0], paymentInfo, @@ -272,36 +270,35 @@ function Page10({ step, setstep, questions, setQuestions, data }) { setErrors((prev) => { const prevObj = { ...prev }; prevObj.agreement[0] = agreement.current.checked - ? "" - : "This field is required"; + ? '' + : 'This field is required'; return prevObj; }); } function nextPage() { let shouldSubmit = true; - if (errors.agreement[0] !== "") { + if (errors.agreement[0] !== '') { if (errors.agreement[0] === undefined) { validateAgreement(); } shouldSubmit = agreement.current.checked; } - let dependency_arr = allRadios[checked].dependencies; + const dependency_arr = allRadios[checked].dependencies; const paymentInfo = {}; for (let i = 0; i < dependency_arr.length; i++) { if (errors.inputs[i][0] === undefined) { - let validation = dependency_arr[i].validationFxn( - dependency_arr[i].ref.current.value + const validation = dependency_arr[i].validationFxn( + dependency_arr[i].ref.current.value, ); - if (validation !== "") { + if (validation !== '') { shouldSubmit = false; } validateRegularInputs(validation, i); - } else if (errors.inputs[i][0] !== "") { + } else if (errors.inputs[i][0] !== '') { shouldSubmit = false; } else { - paymentInfo[dependency_arr[i].label.replaceAll("*", "").trim()] = - dependency_arr[i].ref.current.value; + paymentInfo[dependency_arr[i].label.replaceAll('*', '').trim()] = dependency_arr[i].ref.current.value; } } if (shouldSubmit) { @@ -314,230 +311,230 @@ function Page10({ step, setstep, questions, setQuestions, data }) { } // let pop = "popup"; function toggle() { - var popup = document.getElementById("myPopup"); - popup.classList.toggle("show"); + const popup = document.getElementById('myPopup'); + popup.classList.toggle('show'); } return ( - - -
- A MPA project manager will translate you requirements to a PROJECT - QUOTE (budget, staffing, timeline, with a complete task break down and - vesting schedule). You would be charged a fee of $40 for this! - - - - - - - - - - - - - - - -
TOTAL$ {a}
TAXES$ {b}
TOTAL$ {c}
-

- Please select your preferred payment method. -

- {serverError.length !== 0 ? ( -
+
+ A MPA project manager will translate you requirements to a PROJECT + QUOTE (budget, staffing, timeline, with a complete task break down and + vesting schedule). You would be charged a fee of $40 for this! + + + + + + + + + + + + + + + +
TOTAL + $ + {a} +
TAXES + $ + {b} +
TOTAL + $ + {c} +
+

+ Please select your preferred payment method. +

+ {serverError.length !== 0 ? ( +
+
    + {serverError.map((error, index) =>
  • {error}
  • )} +
+
{ + setServerError([]); }} > -
    - {serverError.map((error, index) => { - return
  • {error}
  • ; - })} -
-
{ - setServerError([]); - }} - > - × -
+ ×
- ) : null} - {allRadios.map((radio, index) => { - return ( -
-
- {/* checkbox input */} - { - setChecked(index); - }} - /> -
- {/* create label for the radio */} -
+ ))} + + { + if (errors.agreement[0] !== undefined) { + validateAgreement(); + } + }} + /> + */}{" "} - I have read & agree to the terms/warranty - {/* */} - - - {errors.agreement[0] !== undefined && errors.agreement[0] !== "" ? ( - - ) : null} -
-
-
-

Terms / Warranty

- -
-

- {" "} - MPA Consultancy Project Quote is for information purposes enclosed - within the dealings of its entity only. Minority Programmers - Association does not guarantee the accuracy of or the conclusions - reached in this project quote in accordance to the execution of the - project, and are entitled to monitoring and managing any disputes to - take place. Minority Programmers Association does not make and - expressly disclaims all representations and warranties, express, - implied, statutory or otherwise, whatsoever, including, but not - limited to: (i) warranties of merchantability, fitness for a - particular purpose, suitability, usage, title or non infringement; - (ii) that the contents of this white paper are free from error; and - (iii) that such contents will not infringe third-party rights. - Minority Programmers Association and its affiliates shall have no - liability for damages of any kind arising out of the use, reference - to, or reliance on this white paper or any of the content contained - herein, even if advised of the possibility of such damages. In no - event will Minority Programmers Association or its affiliates be - liable to any person or entity for any damages, losses, liabilities, - costs or expenses of any kind, whether direct or indirect, - consequential, compensatory, incidental, actual, exemplary, punitive - or special for the use of, reference to, or reliance on this white - paper or any of the content contained herein, including, without - limitation, any loss of business, revenues, profits, data, use, - goodwill or other intangible losses. -

+ > */} + {' '} + I have read & agree to the terms/warranty + {/* */} + + + {errors.agreement[0] !== undefined && errors.agreement[0] !== '' ? ( + + ) : null} +
+
+
+

Terms / Warranty

+
- - +

+ {' '} + MPA Consultancy Project Quote is for information purposes enclosed + within the dealings of its entity only. Minority Programmers + Association does not guarantee the accuracy of or the conclusions + reached in this project quote in accordance to the execution of the + project, and are entitled to monitoring and managing any disputes to + take place. Minority Programmers Association does not make and + expressly disclaims all representations and warranties, express, + implied, statutory or otherwise, whatsoever, including, but not + limited to: (i) warranties of merchantability, fitness for a + particular purpose, suitability, usage, title or non infringement; + (ii) that the contents of this white paper are free from error; and + (iii) that such contents will not infringe third-party rights. + Minority Programmers Association and its affiliates shall have no + liability for damages of any kind arising out of the use, reference + to, or reliance on this white paper or any of the content contained + herein, even if advised of the possibility of such damages. In no + event will Minority Programmers Association or its affiliates be + liable to any person or entity for any damages, losses, liabilities, + costs or expenses of any kind, whether direct or indirect, + consequential, compensatory, incidental, actual, exemplary, punitive + or special for the use of, reference to, or reliance on this white + paper or any of the content contained herein, including, without + limitation, any loss of business, revenues, profits, data, use, + goodwill or other intangible losses. +

+
+ ); -} +}; export default Page10; diff --git a/components/Consultancy/steps/step11.js b/components/Consultancy/steps/step11.js index a44b1210..460f1c01 100644 --- a/components/Consultancy/steps/step11.js +++ b/components/Consultancy/steps/step11.js @@ -1,32 +1,31 @@ -import { useEffect } from "react"; -import { Fragment } from "react"; -import BlurBackground from "../helperFiles/blurBackground"; -import NeedHelp from "../helperFiles/needHelp"; -import OverlayCard from "../helperFiles/overlayCard"; -import QuestionContainer from "../helperFiles/questionContainer"; +import { useEffect, Fragment } from 'react'; +import BlurBackground from '../helperFiles/blurBackground'; +import NeedHelp from '../helperFiles/needHelp'; +import OverlayCard from '../helperFiles/overlayCard'; +import QuestionContainer from '../helperFiles/questionContainer'; -function Page11({ +const Page11 = function ({ step, localStorageConsultancyKey, localStorageStepKey, setstep, setQuestions, }) { - const paymentReceived = "$XX.00"; - const projectId = "XXALD4"; - const transactionId = "58"; - const date = new Date().toLocaleDateString().replaceAll("/", "."); + const paymentReceived = '$XX.00'; + const projectId = 'XXALD4'; + const transactionId = '58'; + const date = new Date().toLocaleDateString().replaceAll('/', '.'); useEffect(() => { window.localStorage.removeItem(localStorageStepKey); window.localStorage.removeItem(localStorageConsultancyKey); }, []); return ( - + <>
@@ -36,30 +35,46 @@ function Page11({
- Thank you! Your payment of{" "} - {paymentReceived} has been received. + Thank you! + {' '} + Your payment of + {' '} + {paymentReceived} + {' '} + has been received.
- Project ID: {projectId} / Transaction ID: #{transactionId} / Date:{" "} + Project ID: + {' '} + {projectId} + {' '} + / Transaction ID: # + {transactionId} + {' '} + / Date: + {' '} {date}
- {" "} - Please allow upto + {' '} + Please allow upto + {' '} + 5 business days - {" "} + + {' '} for an MPA project manager to take charge of your project. You will be notified and he will be in touch with you.
- *Project Managers generally take{" "} - 1-2 weeks to prepare a quote. + *Project Managers generally take + {' '} + 1-2 weeks + {' '} + to prepare a quote.
-
+ ); -} +}; export default Page11; diff --git a/components/Consultancy/steps/step2.js b/components/Consultancy/steps/step2.js index 962b97b3..4b6efc50 100644 --- a/components/Consultancy/steps/step2.js +++ b/components/Consultancy/steps/step2.js @@ -1,23 +1,27 @@ -import { useMemo, useState, useRef, useEffect } from "react"; -import addQuestion from "../helperFiles/addQuestion"; -import Input from "../helperFiles/customInputTags/input"; -import { useDefaultValue } from "../helperFiles/getDefaultValue"; -import QuestionContainer from "../helperFiles/questionContainer"; +import { + useMemo, useState, useRef, useEffect, +} from 'react'; +import addQuestion from '../helperFiles/addQuestion'; +import Input from '../helperFiles/customInputTags/input'; +import { useDefaultValue } from '../helperFiles/getDefaultValue'; +import QuestionContainer from '../helperFiles/questionContainer'; -function Page2({ step, setstep, questions, setQuestions }) { +const Page2 = function ({ + step, setstep, questions, setQuestions, +}) { const defaultValue = useDefaultValue(questions, step, 0); console.log(defaultValue, questions); const [inputValue, setInputValue] = useState( - defaultValue ? defaultValue : undefined + defaultValue || undefined, ); - const questionText = "Tell us about your idea"; - const list_of_errors = ["You must enter an input"]; + const questionText = 'Tell us about your idea'; + const list_of_errors = ['You must enter an input']; function nextPage() { if (inputValue === undefined) { setInputValue(list_of_errors); - } else if (typeof inputValue === "string") { + } else if (typeof inputValue === 'string') { setstep((prev) => prev + 1); } } @@ -50,10 +54,10 @@ function Page2({ step, setstep, questions, setQuestions }) { handleInputChange={(e) => { handleInputChange(e); }} - placeholder={"Enter the title of this product."} + placeholder="Enter the title of this product." defaultValue={defaultValue} /> ); -} +}; export default Page2; diff --git a/components/Consultancy/steps/step3.js b/components/Consultancy/steps/step3.js index fc118944..e8bca271 100644 --- a/components/Consultancy/steps/step3.js +++ b/components/Consultancy/steps/step3.js @@ -1,46 +1,48 @@ -import { useEffect, useState } from "react"; -import Checkboxes from "../helperFiles/customInputTags/checkbox"; -import Select from "../helperFiles/customInputTags/select"; -import QuestionContainer from "../helperFiles/questionContainer"; -import { useDefaultValue } from "../helperFiles/getDefaultValue"; -import addQuestion from "../helperFiles/addQuestion"; +import { useEffect, useState } from 'react'; +import Checkboxes from '../helperFiles/customInputTags/checkbox'; +import Select from '../helperFiles/customInputTags/select'; +import QuestionContainer from '../helperFiles/questionContainer'; +import { useDefaultValue } from '../helperFiles/getDefaultValue'; +import addQuestion from '../helperFiles/addQuestion'; -function Page3({ step, setstep, questions, setQuestions }) { +const Page3 = function ({ + step, setstep, questions, setQuestions, +}) { const defaultValueSelected = useDefaultValue(questions, step, 0); const defaultValueCheckboxes = useDefaultValue(questions, step, 1); const [selected, setSelected] = useState(undefined); const [checkboxes, changeCheckboxValue] = useState(undefined); const options = [ - "Business services", - "Creative industries", - "Entertainment, Food or Events", - "Financial services", - "Health & fitness", - "Home services", - "Retail /consumer goods", - "Texhnology / software", - "other", + 'Business services', + 'Creative industries', + 'Entertainment, Food or Events', + 'Financial services', + 'Health & fitness', + 'Home services', + 'Retail /consumer goods', + 'Texhnology / software', + 'other', ]; const checkBoxLabels = [ - "Deployed Product", - "UI/UX", - "Front End", - "Back End", - "Product Strategy", - "Blockchain", + 'Deployed Product', + 'UI/UX', + 'Front End', + 'Back End', + 'Product Strategy', + 'Blockchain', ]; - const question1 = "What industry will this project operate in?"; - const question2 = "Tag your project based on type of work needed."; + const question1 = 'What industry will this project operate in?'; + const question2 = 'Tag your project based on type of work needed.'; function pageThreeQuestion() { addQuestion(setQuestions, step, [ { - question: selected ? selected[0] : "", + question: selected ? selected[0] : '', answer: selected ? selected[1] : undefined, }, { - question: checkboxes ? checkboxes[0] : "", + question: checkboxes ? checkboxes[0] : '', answer: checkboxes ? checkboxes[1] : undefined, }, ]); @@ -90,7 +92,7 @@ function Page3({ step, setstep, questions, setQuestions }) { @@ -103,5 +105,5 @@ function Page3({ step, setstep, questions, setQuestions }) { /> ); -} +}; export default Page3; diff --git a/components/Consultancy/steps/step4.js b/components/Consultancy/steps/step4.js index 48b18560..f1e615a3 100644 --- a/components/Consultancy/steps/step4.js +++ b/components/Consultancy/steps/step4.js @@ -1,6 +1,8 @@ -import SelectTemplate from "../helperFiles/templates/selectTemplate"; +import SelectTemplate from '../helperFiles/templates/selectTemplate'; -function Page4({ step, setstep, questions, setQuestions }) { +const Page4 = function ({ + step, setstep, questions, setQuestions, +}) { return ( ); -} +}; export default Page4; diff --git a/components/Consultancy/steps/step5.js b/components/Consultancy/steps/step5.js index cdb733e9..63a9a0ad 100644 --- a/components/Consultancy/steps/step5.js +++ b/components/Consultancy/steps/step5.js @@ -1,57 +1,59 @@ -import { useState, useRef, useEffect } from "react"; -import TagInput from "../helperFiles/customInputTags/tagInput"; -import QuestionContainer from "../helperFiles/questionContainer"; -import { useDefaultValue } from "../helperFiles/getDefaultValue"; -import addQuestion from "../helperFiles/addQuestion"; -import ErrorPrint from "../helperFiles/errorPrint"; +import { useState, useRef, useEffect } from 'react'; +import TagInput from '../helperFiles/customInputTags/tagInput'; +import QuestionContainer from '../helperFiles/questionContainer'; +import { useDefaultValue } from '../helperFiles/getDefaultValue'; +import addQuestion from '../helperFiles/addQuestion'; +import ErrorPrint from '../helperFiles/errorPrint'; -function Page5({ step, setstep, questions, setQuestions }) { +const Page5 = function ({ + step, setstep, questions, setQuestions, +}) { const minimumChar = 150; - //get default values + // get default values const defaultProjectDetail = useDefaultValue(questions, step, 0); const defaultInspitation = useDefaultValue(questions, step, 1); const defaultTags = useDefaultValue(questions, step, 2); console.log(defaultProjectDetail, defaultTags, defaultTags); - //all question - const question1 = "Project details"; - const question2 = "Any inspiration websites?"; - const question3 = "Any preferred tech stack?"; - const question3Placeholder1 = "Please enter to add front end tag."; - const question3Placeholder2 = "Please enter to add development tag."; - const question3Placeholder3 = "Please enter to add back end tag."; - const question3Placeholder4 = "Please enter to add UI UX tag."; - const question3Placeholder5 = "Please enter to add blockchain tag."; - //references for the inputs + // all question + const question1 = 'Project details'; + const question2 = 'Any inspiration websites?'; + const question3 = 'Any preferred tech stack?'; + const question3Placeholder1 = 'Please enter to add front end tag.'; + const question3Placeholder2 = 'Please enter to add development tag.'; + const question3Placeholder3 = 'Please enter to add back end tag.'; + const question3Placeholder4 = 'Please enter to add UI UX tag.'; + const question3Placeholder5 = 'Please enter to add blockchain tag.'; + // references for the inputs const projectDetails = useRef(); const inspirationLink = useRef(); - //should print error message? + // should print error message? const [errorMessage, setErrorMessage] = useState(undefined); - //states for my tag inputs + // states for my tag inputs const [listOfTagsA, updateListOfTagsA] = useState( - defaultTags ? defaultTags[0] : [] + defaultTags ? defaultTags[0] : [], ); const [listOfTagsB, updateListOfTagsB] = useState( - defaultTags ? defaultTags[1] : [] + defaultTags ? defaultTags[1] : [], ); const [listOfTagsC, updateListOfTagsC] = useState( - defaultTags ? defaultTags[2] : [] + defaultTags ? defaultTags[2] : [], ); const [listOfTagsD, updateListOfTagsD] = useState( - defaultTags ? defaultTags[3] : [] + defaultTags ? defaultTags[3] : [], ); const [listOfTagsE, updateListOfTagsE] = useState( - defaultTags ? defaultTags[4] : [] + defaultTags ? defaultTags[4] : [], ); function addToQuestion() { addQuestion(setQuestions, step, [ { question: question1, - answer: projectDetails.current ? projectDetails.current.value : "", + answer: projectDetails.current ? projectDetails.current.value : '', }, { question: question2, - answer: inspirationLink.current ? inspirationLink.current.value : "", + answer: inspirationLink.current ? inspirationLink.current.value : '', }, { question: question3, @@ -65,19 +67,19 @@ function Page5({ step, setstep, questions, setQuestions }) { }, ]); } - //error messsage reporting + // error messsage reporting function setInvalidMessage() { setErrorMessage([ `This field must have a minimum of ${ - minimumChar - - (projectDetails.current ? projectDetails.current.value.length : 0) + minimumChar + - (projectDetails.current ? projectDetails.current.value.length : 0) } character(s)`, ]); } function ValidateCompulsoryMessage() { return ( - projectDetails.current && - projectDetails.current.value.length >= minimumChar + projectDetails.current + && projectDetails.current.value.length >= minimumChar ); } function nextPage() { @@ -97,7 +99,7 @@ function Page5({ step, setstep, questions, setQuestions }) { } } } - //end of error message reporting + // end of error message reporting function prevPage() { addToQuestion(); setstep((prev) => prev - 1); @@ -118,18 +120,21 @@ function Page5({ step, setstep, questions, setQuestions }) { >
- + + /> {errorMessage ? : null}
@@ -140,12 +145,12 @@ function Page5({ step, setstep, questions, setQuestions }) { type="text" id="page5-input" ref={inspirationLink} - defaultValue={defaultInspitation ? defaultInspitation : ""} + defaultValue={defaultInspitation || ''} onChange={(e) => { addToQuestion(); }} /> -
); -} +}; export default Page5; diff --git a/components/Consultancy/steps/step6.js b/components/Consultancy/steps/step6.js index f610080e..42c8c910 100644 --- a/components/Consultancy/steps/step6.js +++ b/components/Consultancy/steps/step6.js @@ -1,42 +1,46 @@ -import { useRef, useState, useEffect, Fragment } from "react"; -import addQuestion from "../helperFiles/addQuestion"; -import { useDefaultValue } from "../helperFiles/getDefaultValue"; -import QuestionContainer from "../helperFiles/questionContainer"; -import ErrorPrint from "../helperFiles/errorPrint"; -import BlurBackground from "../helperFiles/blurBackground"; -import OverlayCard from "../helperFiles/overlayCard"; -import InputWithIcon from "../helperFiles/customInputTags/inputWithIcon"; +import { + useRef, useState, useEffect, Fragment, +} from 'react'; +import addQuestion from '../helperFiles/addQuestion'; +import { useDefaultValue } from '../helperFiles/getDefaultValue'; +import QuestionContainer from '../helperFiles/questionContainer'; +import ErrorPrint from '../helperFiles/errorPrint'; +import BlurBackground from '../helperFiles/blurBackground'; +import OverlayCard from '../helperFiles/overlayCard'; +import InputWithIcon from '../helperFiles/customInputTags/inputWithIcon'; const defaultRadio = 2; const options = [ - "Delegate review and approval to your representative.", - "Delegate review and approval to the MPA Project Manager.", - "No, I prefer reviewing tasks on my own.", + 'Delegate review and approval to your representative.', + 'Delegate review and approval to the MPA Project Manager.', + 'No, I prefer reviewing tasks on my own.', ]; -function Page6({ step, setstep, questions, setQuestions }) { +const Page6 = function ({ + step, setstep, questions, setQuestions, +}) { const [showConfirmation, setShowConfirmation] = useState(0); - //get default values + // get default values const defaultValue = useDefaultValue(questions, step, 0); - //inputs + // inputs const selectedOption = useRef( defaultValue.selectedOption !== undefined ? options.indexOf(defaultValue.selectedOption) - : defaultRadio + : defaultRadio, ); const fullname = useRef(); const mpa_identity = useRef(); const needs_input = useRef(); - //error + // error const errorMsgDefault = [[], []]; const [errorMsg, setErrorMsg] = useState(errorMsgDefault); - //add new question + // add new question function addToQuestion() { addQuestion(setQuestions, step, [ { - question: "Would you like to delegate review?", + question: 'Would you like to delegate review?', answer: { selectedOption: options[selectedOption.current], otherInfo: [fullname.current.value, mpa_identity.current.value], @@ -44,32 +48,31 @@ function Page6({ step, setstep, questions, setQuestions }) { }, ]); } - //create an error message based on the string in the input field + // create an error message based on the string in the input field function checksForInputs(string, errorIndex) { setErrorMsg((prev) => { const prevArr = [...prev]; - if (string.length === 0) - prevArr[errorIndex].push("This field cannot be left empty"); + if (string.length === 0) prevArr[errorIndex].push('This field cannot be left empty'); else prevArr[errorIndex] = []; return prevArr; }); } - //run a function when the needs_input reference is defined + // run a function when the needs_input reference is defined function checkInputChanges(fxn = () => {}) { if (needs_input.current.checked) { fxn(); } } - //validate the first input + // validate the first input function validateTextOne() { checksForInputs(fullname.current.value, 0); } - //validate the second input + // validate the second input function validateTextTwo() { checksForInputs(mpa_identity.current.value, 1); } - //when radio input changes + // when radio input changes function onChangeRadio(index) { selectedOption.current = index; if (needs_input.current) { @@ -82,52 +85,52 @@ function Page6({ step, setstep, questions, setQuestions }) { } } } - //when a text input changes + // when a text input changes function onChangeText(fxn) { if (needs_input.current) { checkInputChanges(fxn); } } - //navigate to next page + // navigate to next page function nextPage() { - //if inputs are invalid, submission should be voided for the first radio + // if inputs are invalid, submission should be voided for the first radio if (errorMsg[0].length === 0 && errorMsg[1].length === 0) { if (selectedOption.current === 0) { setShowConfirmation(1); } } - //add second radio to the question and submit + // add second radio to the question and submit if (selectedOption.current === 2) { addToQuestion(); setstep((prev) => prev + 1); } - //add third radio to the question and submit + // add third radio to the question and submit if (selectedOption.current === 1) { setShowConfirmation(2); } } - //return to prev page + // return to prev page function prevPage() { addToQuestion(); setstep((prev) => prev - 1); } - //remove overflow blockage on body + // remove overflow blockage on body function overflow() { - document.body.classList.remove("hide-overflow"); + document.body.classList.remove('hide-overflow'); } - //agree to the terms + // agree to the terms function agree() { overflow(); addToQuestion(); setstep((prev) => prev + 1); } - //edit choices + // edit choices function makeChanges() { overflow(); setShowConfirmation(0); } - //Ensure that using default value does not cause incorrect passage + // Ensure that using default value does not cause incorrect passage useEffect(() => { onChangeRadio(selectedOption.current); }, []); @@ -145,7 +148,7 @@ function Page6({ step, setstep, questions, setQuestions }) {
); return ( - + <> You have the option to delegate the review and approval of task - increments to the PM who send you the quote or{" "} - a representative you trust! This person would need a + increments to the + {' '} + PM who send you the quote + {' '} + or + {' '} + a representative you trust! + {' '} + This person would need a MPA account. {/* checkbox option 1 */} @@ -195,7 +205,7 @@ function Page6({ step, setstep, questions, setQuestions }) { onChangeText(e); }} defaultValue={ - defaultValue.otherInfo ? defaultValue.otherInfo[0] : "" + defaultValue.otherInfo ? defaultValue.otherInfo[0] : '' } validationMethod={validateTextOne} label="*Full Name" @@ -214,7 +224,7 @@ function Page6({ step, setstep, questions, setQuestions }) { onChangeText(e); }} defaultValue={ - defaultValue.otherInfo ? defaultValue.otherInfo[1] : "" + defaultValue.otherInfo ? defaultValue.otherInfo[1] : '' } validationMethod={validateTextTwo} marginTop @@ -276,7 +286,7 @@ function Page6({ step, setstep, questions, setQuestions }) { {showConfirmation === 1 ? ( - + <> * If you delegate the task approval and subsequent release of payment to your Project Manager -
    @@ -293,19 +303,19 @@ function Page6({ step, setstep, questions, setQuestions }) {
{buttons} -
+ ) : ( - + <> * If you delegate the task approval and subsequent release of payment to a representative of your choice, you would be at the risk of having lesser control over the outcome of your project. {buttons} - + )}
) : null} -
+ ); -} +}; export default Page6; diff --git a/components/Consultancy/steps/step7.js b/components/Consultancy/steps/step7.js index 1150490e..f734fd56 100644 --- a/components/Consultancy/steps/step7.js +++ b/components/Consultancy/steps/step7.js @@ -1,6 +1,8 @@ -import SelectTemplate from "../helperFiles/templates/selectTemplate"; +import SelectTemplate from '../helperFiles/templates/selectTemplate'; -function Page7({ step, setstep, questions, setQuestions }) { +const Page7 = function ({ + step, setstep, questions, setQuestions, +}) { return ( ); -} +}; export default Page7; diff --git a/components/Consultancy/steps/step8.js b/components/Consultancy/steps/step8.js index 97f49553..c29e56ca 100644 --- a/components/Consultancy/steps/step8.js +++ b/components/Consultancy/steps/step8.js @@ -1,6 +1,8 @@ -import SelectTemplate from "../helperFiles/templates/selectTemplate"; +import SelectTemplate from '../helperFiles/templates/selectTemplate'; -function Page8({ step, setstep, questions, setQuestions }) { +const Page8 = function ({ + step, setstep, questions, setQuestions, +}) { return ( ); -} +}; export default Page8; diff --git a/components/Consultancy/steps/step9.js b/components/Consultancy/steps/step9.js index 8dbec91c..099f5290 100644 --- a/components/Consultancy/steps/step9.js +++ b/components/Consultancy/steps/step9.js @@ -1,23 +1,25 @@ -import { useRef, useState } from "react"; -import InputWithIcon from "../helperFiles/customInputTags/inputWithIcon"; -import ErrorPrint from "../helperFiles/errorPrint"; -import { useDefaultValue } from "../helperFiles/getDefaultValue"; -import SelectTemplate from "../helperFiles/templates/selectTemplate"; +import { useRef, useState } from 'react'; +import InputWithIcon from '../helperFiles/customInputTags/inputWithIcon'; +import ErrorPrint from '../helperFiles/errorPrint'; +import { useDefaultValue } from '../helperFiles/getDefaultValue'; +import SelectTemplate from '../helperFiles/templates/selectTemplate'; -function Page8({ step, setstep, questions, setQuestions }) { +const Page8 = function ({ + step, setstep, questions, setQuestions, +}) { const inputRef = useRef(); const [errorMsg, setErrorMsg] = useState([]); const [messageChanged, setMessageChanged] = useState(0); function inputValidation() { if (!inputRef.current?.value) { - setErrorMsg(["An email address must be entered."]); + setErrorMsg(['An email address must be entered.']); } else if ( !/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test( - inputRef.current.value + inputRef.current.value, ) ) { - setErrorMsg(["Email address is invalid!"]); + setErrorMsg(['Email address is invalid!']); } else { setErrorMsg([]); } @@ -25,14 +27,12 @@ function Page8({ step, setstep, questions, setQuestions }) { const childRenderInfo = { renderWhenOptionIs: 1, answerToInput: inputRef.current?.value, - validateChild: () => { - return errorMsg.length === 0; - }, + validateChild: () => errorMsg.length === 0, onStart: inputValidation, childChanged: messageChanged, }; - //get default values + // get default values const defaultValue = useDefaultValue(questions, step, 1); console.log(defaultValue); return ( @@ -42,8 +42,8 @@ function Page8({ step, setstep, questions, setQuestions }) { questions={questions} setQuestions={setQuestions} options={[ - "Use the same email as my Sign-In", - "Use a different email from my Sign-In email", + 'Use the same email as my Sign-In', + 'Use a different email from my Sign-In email', ]} question1="Please enter your contact email." childRenderInfo={childRenderInfo} @@ -55,7 +55,7 @@ function Page8({ step, setstep, questions, setQuestions }) { setMessageChanged((prev) => prev + 1); inputValidation(e); }} - defaultValue={defaultValue ? defaultValue : ""} + defaultValue={defaultValue || ''} label="Please enter your contact email address." placeholder="E-mail Address" iconLink="/assets/images/icons/Group.svg" @@ -66,5 +66,5 @@ function Page8({ step, setstep, questions, setQuestions }) { {errorMsg ? : null} ); -} +}; export default Page8; diff --git a/components/Consultancy/wireframes/wireframe1.js b/components/Consultancy/wireframes/wireframe1.js index 2386b336..d4dc7ce5 100644 --- a/components/Consultancy/wireframes/wireframe1.js +++ b/components/Consultancy/wireframes/wireframe1.js @@ -1,32 +1,35 @@ -import { useState, Fragment } from "react"; -import BlurBackground from "../helperFiles/blurBackground"; -import Select from "../helperFiles/customInputTags/select"; -import NeedHelp from "../helperFiles/needHelp"; -import OverlayCard from "../helperFiles/overlayCard"; -import QuestionContainer from "../helperFiles/questionContainer"; -function Wireframe1({ step }) { +import { useState, Fragment } from 'react'; +import BlurBackground from '../helperFiles/blurBackground'; +import Select from '../helperFiles/customInputTags/select'; +import NeedHelp from '../helperFiles/needHelp'; +import OverlayCard from '../helperFiles/overlayCard'; +import QuestionContainer from '../helperFiles/questionContainer'; + +const Wireframe1 = function ({ step }) { const [showBlur, setShowBlur] = useState(0); - let projectId = "XXALD4"; + const projectId = 'XXALD4'; const option = 2; const [selected, setSelected] = useState(undefined); const options = [ - "5 days", - "6 days", - "7 days", - "8 days", - "9 days", - "10 days", - "11 days", - "12 days", - "no deadline", + '5 days', + '6 days', + '7 days', + '8 days', + '9 days', + '10 days', + '11 days', + '12 days', + 'no deadline', ]; return ( - + <>
- Your project ID is {projectId} + Your project ID is + {' '} + {projectId}
Due to heavy traffic of projects, no MPA project manager could @@ -41,7 +44,7 @@ function Wireframe1({ step }) { Follow Up
-
+
sad-emoji
@@ -50,26 +53,26 @@ function Wireframe1({ step }) { {showBlur ? ( - - {" "} -
+ <> + {' '} +
{showBlur === 1 - ? "You can Follow Up only once in a day!" - : "A reminder notification has been send to Project Managers to claim your project. You could select a deadline for PM’s to claim your project before you get a full refund on your project quote fees."} + ? 'You can Follow Up only once in a day!' + : 'A reminder notification has been send to Project Managers to claim your project. You could select a deadline for PM’s to claim your project before you get a full refund on your project quote fees.'}
{showBlur === 1 ? ( ) : ( -
+
-
-
- -
-
- -
- -
-
-
- -
-
- - -
- ); -}; - -export default Contact; +import React from 'react'; + +const Contact = function () { + return ( +
+
+
+
+
+
+
+ +
+

About Us

+

+ Lorem ipsum is simply free text + {' '} +
+ {' '} + available in the market + to use + {' '} +
+ deliver satisfaction. +

+
+
+
+
+
+ +
+

Our Address

+

+ 855 Road Broklyn Street, + {' '} +
+ 600 New York, United States of + {' '} +
+ {' '} + America +

+
+
+
+
+
+ +
+

Contact Info

+

+ minorityprogrammers@gmail.com + {' '} +
+
+ {' '} +  +

+
+
+
+
+
+ +
+
+

+ Get in touch + {' '} +
+ with us +

+
+
+
+ +
+
+ +
+
+ - -
-
-
-
-
-
-
-
-
-
- - ); -}; - -export default CourseDetails; +import React from 'react'; + +const CourseDetails = function () { + return ( +
+
+
+
+
+

+ + by + {' '} + Addie Walters +

+ +
+
+

+ Improve editing skills +

+
+ + + + + + + + 4.8 + 250 +
+
+ +
+
+ + +
+ + +
+
+

+ Aelltes port lacus quis enim var sed efficitur turpis gilla + sed sit Lorem Ipsum is simply dummy text of the printing and + typesetting industry. Lorem Ipsum has been the industry’s + standard dummy text ever since the 1500s, when an unknown + printer took a galley of type and scrambled it to make a + type specimen book. It has survived not only five centuries, + but also the leap into electronic typesetting, remaining + essentially unchanged. +

+
+

+ It was popularised in the 1960s with the release of Letraset + sheets containing Lorem Ipsum passages, and more recently + with desktop publishing software like Aldus PageMaker + including versions of lorem ipsum amet finibus eros. Lorem + Ipsum is simply dummy text of the printing and typesetting + industry. Lorem Ipsum has been the industry’s standard dummy + text ever since the 1500s, when an unknown printer took a + galley of type and scrambled it to make a type specimen + book. It has survived not only five centuries, but also the + leap into electronic typesetting. +

+
+
    +
  • It has survived not only five centuries
  • +
  • Lorem Ipsum is simply dummy text of the new design
  • +
  • Printng and type setting ipsum
  • +
  • Take a look at our round up of the best shows
  • +
+
+
+

+ Starting beginners level course +

+
+

+ Aelltes port lacus quis enim var sed efficitur turpis gilla + sed sit Lorem Ipsum is simply dummy text of the printing and + typesetting industry. Lorem Ipsum has been the industry’s + standard dummy text ever since. +

+
+ +
+
+

+ Intermediate Level +

+
+

+ Aelltes port lacus quis enim var sed efficitur turpis gilla + sed sit Lorem Ipsum is simply dummy text of the printing and + typesetting industry. Lorem Ipsum has been the industry’s + standard dummy text ever since. +

+
+ +
+
+
+
+
+
+

+ Excellent +

+
+ +
+

5

+
+
+

+ Very Good +

+
+ +
+

2

+
+
+

+ Average +

+
+ +
+

1

+
+
+

Poor

+
+ +
+

0

+
+
+

+ Terrible +

+
+ +
+

0

+
+
+
+
+
+

4.6

+
+ + + + + +
+

+ 30 reviews +

+
+
+
+
+
+
+
+ +
+
+

+ Steven Meyer +

+
+

+ 26 July, 2019 +

+
+ + + + + +
+
+
+
+

+ Lorem ipsum is simply free text used by copytyping + refreshing. Neque porro est qui dolorem ipsum quia quaed + inventore veritatis et quasi architecto beatae vitae + dicta sunt explicabo. +

+
+
+
+
+ +
+
+

+ Lina Kelley +

+
+

+ 26 July, 2019 +

+
+ + + + + +
+
+
+
+

+ Lorem ipsum is simply free text used by copytyping + refreshing. Neque porro est qui dolorem ipsum quia quaed + inventore veritatis et quasi architecto beatae vitae + dicta sunt explicabo. +

+
+
+
+

Add a review

+

+ Rate this Course? + {' '} + + + + + +

+
+
+ + +
+
+ - -
-
-
- - -
+ back = (e) => { + e.preventDefault(); + this.props.prevStep(); + }; - {values.step}/6 -
-
-
-
-
- ) - } + render() { + const { values, handleChange } = this.props; + this.props.values; + return ( +
+
+
+ {values.isErrorMessage ? ( +
+

Description

+ Please type in atleast 10 characters +
+ ) : ( +

Description

+ )} + +
+
+
+
+ + +
+ + + {values.step} + /6 + +
+
+
+
+
+ ); + } } -export default MentorshipQuestion5 +export default MentorshipQuestion5; diff --git a/components/MentorshipQuestion6.js b/components/MentorshipQuestion6.js index 6e6704ed..207b3b31 100644 --- a/components/MentorshipQuestion6.js +++ b/components/MentorshipQuestion6.js @@ -1,205 +1,275 @@ -import React, { Component } from 'react' - -import Link from 'next/link' +import React, { Component } from 'react'; +import Link from 'next/link'; export class MentorshipQuestion6 extends Component { - back = e => { - e.preventDefault(); - this.props.prevStep(); + back = (e) => { + e.preventDefault(); + this.props.prevStep(); + }; + + render() { + const { values } = this.props; + this.props.values; + let lookingTitle = ''; + if (values.iAMa == 'Mentor') { + lookingTitle = 'Mentee'; + } + if (values.iAMa == 'Mentee') { + lookingTitle = 'Mentor'; } - render() { - const { values } = this.props; - this.props.values - let lookingTitle = "" - if (values.iAMa == "Mentor") { - lookingTitle = "Mentee" - } - if (values.iAMa == "Mentee") { - lookingTitle = "Mentor" - } - return ( -
-
-

Preview

-
-
-

{values.iAMa}'s Registration

-
-
-
-

Personal Details

-
-
-
-
-
-
Full Name
-

{values.firstName} {values.lastName}

-
-
-
Level of Education
-

{values.levelOfEducation[0].label}

-
-
-
Date of Birth
-

{values.DOB}

-
+ return ( +
+ +

Preview

+
+
+

+ {values.iAMa} + 's Registration +

+
+
+
+

Personal Details

+
+
+
+
+
+
Full Name
+

+ {values.firstName} + {' '} + {values.lastName} +

+
+
+
Level of Education
+

{values.levelOfEducation[0].label}

+
+
+
Date of Birth
+

{values.DOB}

+
-
-
-
-
Passions:
-

- {values.passions.map((passion) => ( - {passion.label} - ))} -

-
-
-
-
-
Country
-

-

{values.country[0].label}

-

-
-
-
Ocupation
-

-

{values.occupation}

-

-
-
-
Place I work/study in
-

-

{values.occupationPlace}

-

-
-
-
-
-
Interest:
-

- {values.interest.map((item) => ( - {item.label} - ))} -

-
-
-
-
-
Learning Style
-

- {values.learningStyle.map((item) => ( -

{item.label}

- ))} -

-
-
-
Personality Type
-

- {values.personlityType.map((item) => ( -

{item.label}

- ))} -

-
-
-
Languages
-

- {values.primaryLang.map((item) => ( -

{item.label}

- ))} -

-
-
-
-
-
My description
-

- {values.description} -

-
-
+
+
+
+
Passions:
+

+ {values.passions.map((passion) => ( + + {passion.label} + {' '} + + ))} +

+
+
+
+
+
Country
+

+

+ {values.country[0].label} + {' '} +

+

+
+
+
Ocupation
+

+

+ {values.occupation} + {' '} +

+

+
+
+
Place I work/study in
+

+

+ {values.occupationPlace} + {' '} +

+

+
+
+
+
+
Interest:
+

+ {values.interest.map((item) => ( + + {item.label} + {' '} + + ))} +

+
+
+
+
+
Learning Style
+

+ {values.learningStyle.map((item) => ( +

+ {item.label} + {' '} +

+ ))} +

+
+
+
Personality Type
+

+ {values.personlityType.map((item) => ( +

+ {item.label} + {' '} +

+ ))} +

+
+
+
Languages
+

+ {values.primaryLang.map((item) => ( +

+ {item.label} + {' '} +

+ ))} +

+
+
+
+
+
My description
+

+ {values.description} +

+
+
-
-
-

I am looking for

-
-
-
-
-
-
{lookingTitle}'s Education
-

- {values.lookingForEdu.map((item) => ( -

{item.label}

- ))} -

-
-
-
{lookingTitle}'s Experience
-

- {values.lookingForExp.map((item) => ( -

{item.label}

- ))} -

-
-
-
{lookingTitle}'s Gender
-

- {values.lookingForGender.map((item) => ( -

{item.label}

- ))} -

-
-
-
-
-
{lookingTitle}'s Availability
-

- {values.lookingForAvailability.map((item) => ( -

{item.label}

- ))} -

-
-
-
{lookingTitle}'s Language
-

- {values.lookingForLang.map((item) => ( -

{item.label}

- ))} -

-
-
-
{lookingTitle}'s Ethnicity
-

- {values.lookingForEthnicity.map((item) => ( -

{item.label}

- ))} -

-
-
-
- -
-
- - - +
+
+

I am looking for

+
+
+
+
+
+
+ {lookingTitle} + 's Education +
+

+ {values.lookingForEdu.map((item) => ( +

+ {item.label} + {' '} +

+ ))} +

+
+
+
+ {lookingTitle} + 's Experience +
+

+ {values.lookingForExp.map((item) => ( +

+ {item.label} + {' '} +

+ ))} +

+
+
+
+ {lookingTitle} + 's Gender +
+

+ {values.lookingForGender.map((item) => ( +

+ {item.label} + {' '} +

+ ))} +

+
+
+
+
+
+ {lookingTitle} + 's Availability +
+

+ {values.lookingForAvailability.map((item) => ( +

+ {item.label} + {' '} +

+ ))} +

+
+
+
+ {lookingTitle} + 's Language +
+

+ {values.lookingForLang.map((item) => ( +

+ {item.label} + {' '} +

+ ))} +

+
+
+
+ {lookingTitle} + 's Ethnicity +
+

+ {values.lookingForEthnicity.map((item) => ( +

+ {item.label} + {' '} +

+ ))} +

+
+
+
+ +
+
+ + + - -
+ +
- {values.step}/6 -
-
-
-
-
- ) - } + + {values.step} + /6 + +
+
+
+
+
+ ); + } } -export default MentorshipQuestion6 +export default MentorshipQuestion6; diff --git a/components/MentorshipRegister.js b/components/MentorshipRegister.js index 2fc2c8b3..61666fcf 100644 --- a/components/MentorshipRegister.js +++ b/components/MentorshipRegister.js @@ -1,209 +1,215 @@ -import React, { Component } from 'react' +import React, { Component } from 'react'; -import MentorshipQuestion1 from "./MentorshipQuestion1"; -import MentorshipQuestion2 from "./MentorshipQuestion2"; -import MentorshipQuestion3 from "./MentorshipQuestion3"; -import MentorshipQuestion4 from "./MentorshipQuestion4"; -import MentorshipQuestion5 from "./MentorshipQuestion5"; -import MentorshipQuestion6 from "./MentorshipQuestion6"; +import MentorshipQuestion1 from './MentorshipQuestion1'; +import MentorshipQuestion2 from './MentorshipQuestion2'; +import MentorshipQuestion3 from './MentorshipQuestion3'; +import MentorshipQuestion4 from './MentorshipQuestion4'; +import MentorshipQuestion5 from './MentorshipQuestion5'; +import MentorshipQuestion6 from './MentorshipQuestion6'; export class MentorshipRegister extends Component { - state = { - // starts at 0 - step: 0, - isErrorMessage: false, - - firstName: '', - lastName: '', - DOB: '', - country: [{ "label": "", "value": "" }], - levelOfEducation: [{ "label": "", "value": "" }], - passions: [], + state = { + // starts at 0 + step: 0, + isErrorMessage: false, - iAMa: '', - interest: [], - learningStyle: [], - personlityType: [], - occupation: '', - occupationPlace: '', - primaryLang: [], - lookingForEdu: [], - lookingForExp: [], - lookingForAvailability: [], - lookingForGender: [], - lookingForLang: [], - lookingForEthnicity: [], - description: '' - } + firstName: '', + lastName: '', + DOB: '', + country: [{ label: '', value: '' }], + levelOfEducation: [{ label: '', value: '' }], + passions: [], - // Proceed to next step - nextStep = () => { - const { step } = this.state; - if (step == 0) { - this.setState({ - isErrorMessage: false, - step: step + 1 - }); - } - // Validation for step 1 - else if (step == 1 && - this.state.firstName.length > 0 && - this.state.lastName.length > 0 && - this.state.DOB.length > 0 && - this.state.DOB.length < 11 && - this.state.levelOfEducation[0].label.length > 0 && - this.state.country[0].label.length > 0 && - this.state.passions.length > 0) { - this.setState({ - isErrorMessage: false, - step: step + 1 - }); - } - // Validation for step 2 - else if (step == 2 && - this.state.iAMa.length > 0) { - this.setState({ - isErrorMessage: false, - step: step + 1 - }); - } - // Validation for step 3 - else if (step == 3 && - this.state.interest.length > 0 && - this.state.learningStyle.length > 0 && - this.state.personlityType.length > 0 && - this.state.occupationPlace.length > 0 && - this.state.primaryLang.length > 0 && - this.state.occupation.length > 0) { - this.setState({ - isErrorMessage: false, - step: step + 1 - }); - } - // Validation for step 4 - else if (step == 4 && - this.state.lookingForEdu.length > 0 && - this.state.lookingForExp.length > 0 && - this.state.lookingForAvailability.length > 0 && - this.state.lookingForGender.length > 0 && - this.state.lookingForLang.length > 0 && - this.state.lookingForEthnicity.length > 0) { - this.setState({ - isErrorMessage: false, - step: step + 1 - }); - } - // Validation for step 5 - else if (step == 5 && - this.state.description.length > 9) { - this.setState({ - isErrorMessage: false, - step: step + 1 - }); - - } - else { - this.setState({ - isErrorMessage: true - }); - } + iAMa: '', + interest: [], + learningStyle: [], + personlityType: [], + occupation: '', + occupationPlace: '', + primaryLang: [], + lookingForEdu: [], + lookingForExp: [], + lookingForAvailability: [], + lookingForGender: [], + lookingForLang: [], + lookingForEthnicity: [], + description: '', + }; + // Proceed to next step + nextStep = () => { + const { step } = this.state; + if (step == 0) { + this.setState({ + isErrorMessage: false, + step: step + 1, + }); } - // Proceed to Prev step - prevStep = () => { - const { step } = this.state; - this.setState({ - step: step - 1, - isErrorMessage: false - }); + // Validation for step 1 + else if (step == 1 + && this.state.firstName.length > 0 + && this.state.lastName.length > 0 + && this.state.DOB.length > 0 + && this.state.DOB.length < 11 + && this.state.levelOfEducation[0].label.length > 0 + && this.state.country[0].label.length > 0 + && this.state.passions.length > 0) { + this.setState({ + isErrorMessage: false, + step: step + 1, + }); } - continue = e => { - e.preventDefault(); - this.nextStep(); + // Validation for step 2 + else if (step == 2 + && this.state.iAMa.length > 0) { + this.setState({ + isErrorMessage: false, + step: step + 1, + }); } - - // Handle fields change - handleChange = input => e => { - this.setState({ [input]: e.target.value }) + // Validation for step 3 + else if (step == 3 + && this.state.interest.length > 0 + && this.state.learningStyle.length > 0 + && this.state.personlityType.length > 0 + && this.state.occupationPlace.length > 0 + && this.state.primaryLang.length > 0 + && this.state.occupation.length > 0) { + this.setState({ + isErrorMessage: false, + step: step + 1, + }); } - - // Handle Multi or Single DropDown change - handleDropDown = e => selected => { - this.setState({ [e]: selected }) + // Validation for step 4 + else if (step == 4 + && this.state.lookingForEdu.length > 0 + && this.state.lookingForExp.length > 0 + && this.state.lookingForAvailability.length > 0 + && this.state.lookingForGender.length > 0 + && this.state.lookingForLang.length > 0 + && this.state.lookingForEthnicity.length > 0) { + this.setState({ + isErrorMessage: false, + step: step + 1, + }); + } + // Validation for step 5 + else if (step == 5 + && this.state.description.length > 9) { + this.setState({ + isErrorMessage: false, + step: step + 1, + }); + } else { + this.setState({ + isErrorMessage: true, + }); } + }; - render() { - const { step } = this.state; - const { firstName, lastName, DOB, country, levelOfEducation, passions, iAMa, interest, learningStyle, personlityType, occupation, occupationPlace, primaryLang, lookingForEdu, lookingForExp, lookingForAvailability, lookingForGender, lookingForLang, lookingForEthnicity, description, isErrorMessage } = this.state + // Proceed to Prev step + prevStep = () => { + const { step } = this.state; + this.setState({ + step: step - 1, + isErrorMessage: false, + }); + }; - const values = { step, firstName, lastName, DOB, country, levelOfEducation, passions, iAMa, interest, learningStyle, personlityType, occupation, occupationPlace, primaryLang, lookingForEdu, lookingForExp, lookingForAvailability, lookingForGender, lookingForLang, lookingForEthnicity, description, isErrorMessage } + continue = (e) => { + e.preventDefault(); + this.nextStep(); + }; - switch (step) { - case 0: - return ( -
-
-
-

Register for Mentorship Program

-
-

You Must Be Logged Into MPA for Mentorship Program

- -
-
- ); - case 1: - return ( - - ); - case 2: - return ( - - ); - case 3: - return ( - - ); - case 4: - return ( - - ); - case 5: - return ( - - ); - case 6: - return ( - - ); - } - } -} + // Handle fields change + handleChange = (input) => (e) => { + this.setState({ [input]: e.target.value }); + }; -export default MentorshipRegister + // Handle Multi or Single DropDown change + handleDropDown = (e) => (selected) => { + this.setState({ [e]: selected }); + }; + render() { + const { step } = this.state; + const { + firstName, lastName, DOB, country, levelOfEducation, passions, iAMa, interest, learningStyle, personlityType, occupation, occupationPlace, primaryLang, lookingForEdu, lookingForExp, lookingForAvailability, lookingForGender, lookingForLang, lookingForEthnicity, description, isErrorMessage, + } = this.state; + + const values = { + step, firstName, lastName, DOB, country, levelOfEducation, passions, iAMa, interest, learningStyle, personlityType, occupation, occupationPlace, primaryLang, lookingForEdu, lookingForExp, lookingForAvailability, lookingForGender, lookingForLang, lookingForEthnicity, description, isErrorMessage, + }; + + switch (step) { + case 0: + return ( +
+
+
+

Register for Mentorship Program

+
+

You Must Be Logged Into MPA for Mentorship Program

+ +
+
+ ); + case 1: + return ( + + ); + case 2: + return ( + + ); + case 3: + return ( + + ); + case 4: + return ( + + ); + case 5: + return ( + + ); + case 6: + return ( + + ); + } + } +} +export default MentorshipRegister; diff --git a/components/Mission.js b/components/Mission.js index 409947dc..8c786609 100644 --- a/components/Mission.js +++ b/components/Mission.js @@ -2,49 +2,53 @@ import React, { Component } from 'react'; import ModalVideo from 'react-modal-video'; export default class Mission extends Component { - constructor(){ - super() - this.state = { - isOpen: false - } - } + constructor() { + super(); + this.state = { + isOpen: false, + }; + } - openModal = () => { - this.setState({isOpen: true}) - } + openModal = () => { + this.setState({ isOpen: true }); + }; - render() { - return ( -
-
- - + render() { + return ( +
+
+ +
+
+
+

+ Minority Programmers +
+ mission is to bring diversity through STEM education and innovation. +

+ +
+

+ {' '} + We aim to help marginalized communities access opportunities through events, incubation, education, and capital. +
+
+ Minority Programmers is an international network of community activists, students, professionals, and developers, unifying together to develop socially impactful software solutions and empower underrepresented communities through STEM education. +

+
+ Learn More +
+
+
+ this.setState({ isOpen: false })} /> +
+
-
- ); - } -} \ No newline at end of file +
+
+
+
+
+ ); + } +} diff --git a/components/Moderator/ElectProposals/ElectProposals.js b/components/Moderator/ElectProposals/ElectProposals.js index 3c9f7e9a..e5db3e1b 100644 --- a/components/Moderator/ElectProposals/ElectProposals.js +++ b/components/Moderator/ElectProposals/ElectProposals.js @@ -1,270 +1,292 @@ -import React from "react"; -import { useEffect } from "react"; -import { useState } from "react"; -import { FaSortUp } from "react-icons/fa"; -import { FaSortDown } from "react-icons/fa"; -import Moment from "react-moment"; +import React, { useEffect, useState } from 'react'; +import { FaSortUp, FaSortDown } from 'react-icons/fa'; +import Moment from 'react-moment'; import Pagination from './Pagination'; import Loader from '../../Loader'; -import ComingSoon from "../../ComingSoon"; -import TenPercentile from "./TenPercentile"; +import ComingSoon from '../../ComingSoon'; +import TenPercentile from './TenPercentile'; -const ElectProposals = () => { +const ElectProposals = function () { const [proposals, setProposals] = useState([]); - const [actions, setActions] = useState([]) - const [currentPage, setCurrentPage] = useState(1) - const [actionsPerPage] = useState(4) - const [sortType, setSortType] = useState('Sort By') - const [filter, setFilter] = useState('all') - const [categories, setCategories] = useState([]) - const [allData, setAllData] = useState([]) - const [loading, setLoading] = useState(false) + const [actions, setActions] = useState([]); + const [currentPage, setCurrentPage] = useState(1); + const [actionsPerPage] = useState(4); + const [sortType, setSortType] = useState('Sort By'); + const [filter, setFilter] = useState('all'); + const [categories, setCategories] = useState([]); + const [allData, setAllData] = useState([]); + const [loading, setLoading] = useState(false); useEffect(() => { - filterArray() - }, [filter]) + filterArray(); + }, [filter]); useEffect(() => { - sortArray(sortType) - }, [sortType]) + sortArray(sortType); + }, [sortType]); useEffect(() => { - - let uniqueCategories = [] - const allCategories = [] + let uniqueCategories = []; + const allCategories = []; // Fetch the action data. Set loading state to true before fetch, back to false after the fetch is complete const fetchData = () => { - - setLoading(true) - fetch("https://koinstreet-learn-api.herokuapp.com/api/v1/proposal/") - .then(response => response.json()) + setLoading(true); + fetch('https://koinstreet-learn-api.herokuapp.com/api/v1/proposal/') + .then((response) => response.json()) .then((response) => { - setProposals(response.data) - setAllData(response.data.reverse()) - setActions(response.data) - setLoading(false) - + setProposals(response.data); + setAllData(response.data.reverse()); + setActions(response.data); + setLoading(false); // Set unique categories for filter dropdown response.data.map((action) => { - allCategories.push(action.category) - }) - uniqueCategories = [...new Set(allCategories)] - setCategories(uniqueCategories) - }) - } - - fetchData() + allCategories.push(action.category); + }); + uniqueCategories = [...new Set(allCategories)]; + setCategories(uniqueCategories); + }); + }; - }, []) + fetchData(); + }, []); // Function to sort the actions by amount or date - const sortArray = type => { + const sortArray = (type) => { const types = { amountAsc: 'amount', amountDesc: 'amount', - date: 'date' - } + date: 'date', + }; - const sortProperty = types[type] + const sortProperty = types[type]; if (sortType == 'amountAsc') { - const sorted = [...actions].sort((a, b) => a[sortProperty] - b[sortProperty]) - setActions(sorted) + const sorted = [...actions].sort((a, b) => a[sortProperty] - b[sortProperty]); + setActions(sorted); } else if (sortType == 'amountDesc') { - const sorted = [...actions].sort((a, b) => b[sortProperty] - a[sortProperty]) - setActions(sorted) + const sorted = [...actions].sort((a, b) => b[sortProperty] - a[sortProperty]); + setActions(sorted); } else if (sortType == 'date') { - const sorted = [...actions].sort((a, b) => new Date(a[sortProperty]) - new Date(b[sortProperty])) - setActions(sorted) + const sorted = [...actions].sort((a, b) => new Date(a[sortProperty]) - new Date(b[sortProperty])); + setActions(sorted); } else { - setActions(allData) + setActions(allData); } - } + }; // Filter the array, sets current page back to 1 after filtering const filterArray = () => { - setCurrentPage(1) + setCurrentPage(1); if (filter != 'all') { for (let i = 0; i < categories.length; i++) { if (filter == categories[i]) { - const filtered = [...allData].filter(action => action.category == categories[i]) - setActions(filtered) + const filtered = [...allData].filter((action) => action.category == categories[i]); + setActions(filtered); } } } else { - setActions(allData) + setActions(allData); } - } + }; // Get current actions const indexOfLastAction = currentPage * actionsPerPage; const indexOfFirstAction = indexOfLastAction - actionsPerPage; - const currentActions = actions.slice(indexOfFirstAction, indexOfLastAction) + const currentActions = actions.slice(indexOfFirstAction, indexOfLastAction); // Change page const paginate = (pageNumber) => setCurrentPage(pageNumber); const nextPage = (currentPage) => { if (currentPage === Math.ceil(actions.length / actionsPerPage)) { - return + return; } - setCurrentPage(currentPage + 1) - } + setCurrentPage(currentPage + 1); + }; const previousPage = () => { if (currentPage === 1) { - return + return; } - setCurrentPage(currentPage - 1) - } - console.log("proposal Data", proposals) - console.log("all data", allData) - console.log("actions", actions) + setCurrentPage(currentPage - 1); + }; + console.log('proposal Data', proposals); + console.log('all data', allData); + console.log('actions', actions); if (loading) { return ( -
+
- ) + ); } return (
- {allData.length >= 1 && loading != true ? -
+ {allData.length >= 1 && loading != true + ? (
-
-
-
- moderator -

Choose proposals to be elected

-

- You can elect upto 3 proposals a again day from the
proposals - that made it to the 10 % percentile. -

-
-
- bg -
-
- -
-
-

- Other proposals below 10% percentile -

-

- Learn more about other proposals. Ban Users who post abusive - comments. -

+
+
+
+ moderator +

Choose proposals to be elected

+

+ You can elect upto 3 proposals a again day from the + {' '} +
+ {' '} + proposals + that made it to the 10 % percentile. +

+
+
+ bg +
+
+
+

+ Other proposals below 10% percentile +

+

+ Learn more about other proposals. Ban Users who post abusive + comments. +

+
- {currentActions.map((proposal) => ( -
-
-

{proposal.title ? proposal.title : "event proposal test"}

-

- - Type: {proposal.type} + {currentActions.map((proposal) => ( +

+
+

+ {' '} + {proposal.title ? proposal.title : 'event proposal test'} +

+

+ + Type: + {' '} + {proposal.type} - - Category: {proposal.Category ? proposal.Category : "Incubator"} + + Category: + {' '} + {proposal.Category ? proposal.Category : 'Incubator'} -

-
-
-
-
-
+

+
+
+
+
+
user
-
+

- Created by
{proposal.userId.userName} + Created by + {' '} +
+ {' '} + {proposal.userId.userName}

-
+

- Created on
+ Created on + {' '} +
+ {' '} + {proposal.createdAt} -

+ + {' '} + +

-
-
-
+
+
+

- {proposal.replies ? proposal.replies : "58"}
Replies + {proposal.replies ? proposal.replies : '58'} + {' '} +
+ {' '} + Replies

-
+

- {proposal.views ? proposal.views : "75"}
Views + {proposal.views ? proposal.views : '75'} + {' '} +
+ {' '} + Views

-
+

- {proposal.count ? proposal.count : "250"} + {proposal.count ? proposal.count : '250'}

+
-
-
-
-
-

{proposal.description}

-
-
-

+


+
+
+

{proposal.description}

+
+
+

-

+

+
-
- ))} - -
+ ))} + +
- + -
: +
+ ) - - } + : }
); }; -export default ElectProposals; \ No newline at end of file +export default ElectProposals; diff --git a/components/Moderator/ElectProposals/Pagination.js b/components/Moderator/ElectProposals/Pagination.js index ff97ce1e..744ab651 100644 --- a/components/Moderator/ElectProposals/Pagination.js +++ b/components/Moderator/ElectProposals/Pagination.js @@ -1,33 +1,35 @@ -import React from 'react' +import React from 'react'; -const Pagination = ({actionsPerPage, totalActions, paginate, currentPage, nextPage, previousPage}) => { +const Pagination = function ({ + actionsPerPage, totalActions, paginate, currentPage, nextPage, previousPage, +}) { const pageNumbers = []; - for(let i = 1; i <= Math.ceil(totalActions / actionsPerPage); i++) { - pageNumbers.push(i) + for (let i = 1; i <= Math.ceil(totalActions / actionsPerPage); i++) { + pageNumbers.push(i); } - let maxPage = Math.ceil(totalActions / actionsPerPage); + const maxPage = Math.ceil(totalActions / actionsPerPage); return ( -
- ) -} + ); +}; -export default Proposal; \ No newline at end of file +export default Proposal; diff --git a/components/Moderator/ElectProposals/TenPercentile.js b/components/Moderator/ElectProposals/TenPercentile.js index 4235fec6..3ca830e8 100644 --- a/components/Moderator/ElectProposals/TenPercentile.js +++ b/components/Moderator/ElectProposals/TenPercentile.js @@ -1,158 +1,150 @@ -import React from "react"; -import { useEffect } from "react"; -import { useState } from "react"; -import { FaSortUp } from "react-icons/fa"; -import { FaSortDown } from "react-icons/fa"; -import Moment from "react-moment"; +import React, { useEffect, useState } from 'react'; +import { FaSortUp, FaSortDown } from 'react-icons/fa'; +import Moment from 'react-moment'; import Pagination from './Pagination'; import Loader from '../../Loader'; -import Proposal from "./Proposal"; - -const TenPercentile = () => { - - const [actions, setActions] = useState([]) - const [currentPage, setCurrentPage] = useState(1) - const [actionsPerPage] = useState(4) - const [sortType, setSortType] = useState('Sort By') - const [filter, setFilter] = useState('all') - const [categories, setCategories] = useState([]) - const [allData, setAllData] = useState([]) - const [loading, setLoading] = useState(false) +import Proposal from './Proposal'; + +const TenPercentile = function () { + const [actions, setActions] = useState([]); + const [currentPage, setCurrentPage] = useState(1); + const [actionsPerPage] = useState(4); + const [sortType, setSortType] = useState('Sort By'); + const [filter, setFilter] = useState('all'); + const [categories, setCategories] = useState([]); + const [allData, setAllData] = useState([]); + const [loading, setLoading] = useState(false); useEffect(() => { - filterArray() - }, [filter]) + filterArray(); + }, [filter]); useEffect(() => { - sortArray(sortType) - }, [sortType]) + sortArray(sortType); + }, [sortType]); useEffect(() => { - - let uniqueCategories = [] - const allCategories = [] + let uniqueCategories = []; + const allCategories = []; // Fetch the action data. Set loading state to true before fetch, back to false after the fetch is complete const fetchData = () => { - - setLoading(true) - fetch ("https://koinstreet-learn-api.herokuapp.com/api/v1/proposal/") - .then(response => response.json()) - .then((response) => { - setAllData(response.data.reverse()) - setActions(response.data) - setLoading(false) - - // Set unique categories for filter dropdown - response.data.map((action) => { - allCategories.push(action.category) - }) - uniqueCategories = [...new Set(allCategories)] - setCategories(uniqueCategories) - }) + setLoading(true); + fetch('https://koinstreet-learn-api.herokuapp.com/api/v1/proposal/') + .then((response) => response.json()) + .then((response) => { + setAllData(response.data.reverse()); + setActions(response.data); + setLoading(false); + + // Set unique categories for filter dropdown + response.data.map((action) => { + allCategories.push(action.category); + }); + uniqueCategories = [...new Set(allCategories)]; + setCategories(uniqueCategories); + }); + }; + + fetchData(); + }, []); + + // Function to sort the actions by amount or date + const sortArray = (type) => { + const types = { + amountAsc: 'amount', + amountDesc: 'amount', + date: 'date', + }; + + const sortProperty = types[type]; + + if (sortType == 'amountAsc') { + const sorted = [...actions].sort((a, b) => a[sortProperty] - b[sortProperty]); + setActions(sorted); + } else if (sortType == 'amountDesc') { + const sorted = [...actions].sort((a, b) => b[sortProperty] - a[sortProperty]); + setActions(sorted); + } else if (sortType == 'date') { + const sorted = [...actions].sort((a, b) => new Date(a[sortProperty]) - new Date(b[sortProperty])); + setActions(sorted); + } else { + setActions(allData); } - - fetchData() - - }, []) - -// Function to sort the actions by amount or date -const sortArray = type => { - const types = { - amountAsc: 'amount', - amountDesc: 'amount', - date: 'date' - } - - const sortProperty = types[type] - - if (sortType == 'amountAsc') { - const sorted = [...actions].sort((a,b) => a[sortProperty] - b[sortProperty]) - setActions(sorted) - } else if (sortType == 'amountDesc') { - const sorted = [...actions].sort((a,b) => b[sortProperty] - a[sortProperty]) - setActions(sorted) - } else if (sortType == 'date') { - const sorted = [...actions].sort((a,b) => new Date(a[sortProperty]) - new Date(b[sortProperty])) - setActions(sorted) - } else { - setActions(allData) - } -} - -// Filter the array, sets current page back to 1 after filtering -const filterArray = () => { - setCurrentPage(1) - if (filter != 'all') { - for(let i = 0; i < categories.length; i++) { - if(filter == categories[i]) { - const filtered = [...allData].filter(action => action.category == categories[i]) - setActions(filtered) - } + }; + + // Filter the array, sets current page back to 1 after filtering + const filterArray = () => { + setCurrentPage(1); + if (filter != 'all') { + for (let i = 0; i < categories.length; i++) { + if (filter == categories[i]) { + const filtered = [...allData].filter((action) => action.category == categories[i]); + setActions(filtered); + } + } + } else { + setActions(allData); } - } else { - setActions(allData) - } -} + }; -// Get current actions -const indexOfLastAction = currentPage * actionsPerPage; -const indexOfFirstAction = indexOfLastAction - actionsPerPage; -const currentActions = actions.slice(indexOfFirstAction, indexOfLastAction) -// Change page + // Get current actions + const indexOfLastAction = currentPage * actionsPerPage; + const indexOfFirstAction = indexOfLastAction - actionsPerPage; + const currentActions = actions.slice(indexOfFirstAction, indexOfLastAction); + // Change page -const paginate = (pageNumber) => setCurrentPage(pageNumber); + const paginate = (pageNumber) => setCurrentPage(pageNumber); -const nextPage = (currentPage) => { - if(currentPage === Math.ceil(actions.length / actionsPerPage)) { - return - } - setCurrentPage(currentPage + 1) -} + const nextPage = (currentPage) => { + if (currentPage === Math.ceil(actions.length / actionsPerPage)) { + return; + } + setCurrentPage(currentPage + 1); + }; -const previousPage = () => { - if(currentPage === 1) { - return + const previousPage = () => { + if (currentPage === 1) { + return; + } + setCurrentPage(currentPage - 1); + }; + + if (loading) { + return ( +
+ +
+ ); } - setCurrentPage(currentPage - 1) -} - - -if (loading) { - return ( -
- -
- ) -} return ( -
-
-

- Proposals that made it to the 10% percentile -

-

- Please choose the proposals to be elected. -

-
- - {currentActions.map((proposal) => ( - - - - ))} - - -
+
+
+

+ Proposals that made it to the 10% percentile +

+

+ Please choose the proposals to be elected. +

+
+ + {currentActions.map((proposal) => ( + + + + ))} + + +
); }; diff --git a/components/Moderator/Proposal.js b/components/Moderator/Proposal.js index f8d19150..708764d7 100644 --- a/components/Moderator/Proposal.js +++ b/components/Moderator/Proposal.js @@ -1,164 +1,172 @@ -import axios from "axios"; -import React from "react"; -import { useEffect } from "react"; -import { useState } from "react"; -import { FaSortUp } from "react-icons/fa"; -import { FaSortDown } from "react-icons/fa"; -import Moment from "react-moment"; - -const Proposal = ({proposal}) => { - - const [reply, setReply] = useState (); - const [views, setViews] = useState ({data: {data: []}}); - const [upVotes, setUpVotes] = useState ({data: {data: 0}}); - const [downVotes, setDownVotes] = useState ({data: {data: 0}}); - - const [votes, setVotes] = useState (null); - - const defaultVotes = downVotes.data.data.length; - - - const token = window.localStorage.getItem('jwtToken'); - - // Replies ___________________ - useEffect(() => { - fetch (`https://koinstreet-learn-api.herokuapp.com/api/v1/proposal/${proposal._id}/reply`) - .then(response => response.json()) - .then((response) => setReply (response.data.length)) - }, [proposal._id]) - - // Replies ___________________ - - // Views _______________ - - useEffect(() => { - const res = axios.get("https://koinstreet-learn-api.herokuapp.com/api/v1/proposalViews/userProposalView", { - headers: { - 'Authorization': `Bearer ${token}` - } - }) - res.then (data => setViews(data)) - - }, [proposal._id]) - - // Views _______________ - - // upVotes _______________ - - - useEffect(() => { - const res = axios.get(`https://koinstreet-learn-api.herokuapp.com/api/v1/upVotes/proposalUpvote/${proposal._id}`, { - headers: { - 'Authorization': `Bearer ${token}` - } - }) - res.then (data =>setUpVotes(data)) - - }, []) - - // upVotes _______________ - - - // downVotes _______________ - - - useEffect(() => { - const res = axios.get(`https://koinstreet-learn-api.herokuapp.com/api/v1/downVotes/proposalDownvote/${proposal._id}`, { - headers: { - 'Authorization': `Bearer ${token}` - } - }) - res.then (data => setDownVotes (data)) - - }, []) - - //downVotes _______________ +import axios from 'axios'; +import React, { useEffect, useState } from 'react'; +import { FaSortUp, FaSortDown } from 'react-icons/fa'; +import Moment from 'react-moment'; + +const Proposal = function ({ proposal }) { + const [reply, setReply] = useState(); + const [views, setViews] = useState({ data: { data: [] } }); + const [upVotes, setUpVotes] = useState({ data: { data: 0 } }); + const [downVotes, setDownVotes] = useState({ data: { data: 0 } }); + + const [votes, setVotes] = useState(null); + + const defaultVotes = downVotes.data.data.length; + + const token = window.localStorage.getItem('jwtToken'); + + // Replies ___________________ + useEffect(() => { + fetch(`https://koinstreet-learn-api.herokuapp.com/api/v1/proposal/${proposal._id}/reply`) + .then((response) => response.json()) + .then((response) => setReply(response.data.length)); + }, [proposal._id]); + + // Replies ___________________ + + // Views _______________ + + useEffect(() => { + const res = axios.get('https://koinstreet-learn-api.herokuapp.com/api/v1/proposalViews/userProposalView', { + headers: { + Authorization: `Bearer ${token}`, + }, + }); + res.then((data) => setViews(data)); + }, [proposal._id]); + + // Views _______________ + + // upVotes _______________ + + useEffect(() => { + const res = axios.get(`https://koinstreet-learn-api.herokuapp.com/api/v1/upVotes/proposalUpvote/${proposal._id}`, { + headers: { + Authorization: `Bearer ${token}`, + }, + }); + res.then((data) => setUpVotes(data)); + }, []); + + // upVotes _______________ + + // downVotes _______________ + + useEffect(() => { + const res = axios.get(`https://koinstreet-learn-api.herokuapp.com/api/v1/downVotes/proposalDownvote/${proposal._id}`, { + headers: { + Authorization: `Bearer ${token}`, + }, + }); + res.then((data) => setDownVotes(data)); + }, []); + + // downVotes _______________ return (
-
-
-

- {proposal.title} -

-

- - Type: {proposal.type} - - - - Category: {proposal.Category ? proposal.Category : "Incubator" } - -

-
-
-
-
-
-
-

- - Unapproved -

+ className="elected-proposal tw-bg-white d-flex-wrp tw-justify-between tw-p-4 tw-mb-10" + key={proposal.id} + > +
+
+

+ {proposal.title} +

- - Planned + + Type: + {' '} + {proposal.type} + + + + Category: + {' '} + {proposal.Category ? proposal.Category : 'Incubator' } +

-

- - In Progress +

+
+
+
+
+
+

+ + Unapproved +

+

+ + Planned +

+

+ + In Progress +

+

+ + Completed +

+
+
+
+
+
+

+ {reply} + {' '} +
+ {' '} + Replies

-

- - Completed +

+ {views.data.data.length} + {' '} +
+ {' '} + Views +

+
+ +
+

+ You + {' '} + Elected + {' '} + this + proposal on + {' '} +
+ + + {proposal.createdAt} + +

-
-
-
-

- {reply}
Replies -

-

- {views.data.data.length}
Views +

+

+

- -
-

- You Elected this - proposal on
- - - {proposal.createdAt} - +

+

+ setVotes(upVotes.data.data.length)} /> + {votes || defaultVotes} + setVotes(downVotes.data.data.length)} />

-
-

- -

-
-
-

- setVotes(upVotes.data.data.length)} /> - {votes ? votes : defaultVotes} - setVotes(downVotes.data.data.length)} /> -

-
-
- ) -} + ); +}; -export default Proposal; \ No newline at end of file +export default Proposal; diff --git a/components/Moderator/ProposalNotification/ApprovedRejected.js b/components/Moderator/ProposalNotification/ApprovedRejected.js index 3a15bab4..eeb0bfe1 100644 --- a/components/Moderator/ProposalNotification/ApprovedRejected.js +++ b/components/Moderator/ProposalNotification/ApprovedRejected.js @@ -1,175 +1,166 @@ -import React from 'react'; -import axios from "axios"; -import { useEffect } from "react"; -import { useState } from "react"; -import Loader from './../../Loader'; -import Proposal from "./Proposal"; -import Pagination from './../ElectProposals/Pagination'; - -const ApprovedRejected = (props) => { - -const {api, status} = props; - -// _________________________________________________________________________________________ - - -const [actions, setActions] = useState([]); -const [currentPage, setCurrentPage] = useState(1); -const [actionsPerPage] = useState(2); -const [sortType, setSortType] = useState('Sort By'); -const [filter, setFilter] = useState('all'); -const [categories, setCategories] = useState([]); -const [allData, setAllData] = useState([]); -const [loading, setLoading] = useState(false); - -useEffect(() => { - filterArray() -}, [filter]) - -useEffect(() => { - sortArray(sortType) -}, [sortType]) +import React, { useEffect, useState } from 'react'; +import axios from 'axios'; +import Loader from '../../Loader'; +import Proposal from './Proposal'; +import Pagination from '../ElectProposals/Pagination'; + +const ApprovedRejected = function (props) { + const { api, status } = props; + + // _________________________________________________________________________________________ + + const [actions, setActions] = useState([]); + const [currentPage, setCurrentPage] = useState(1); + const [actionsPerPage] = useState(2); + const [sortType, setSortType] = useState('Sort By'); + const [filter, setFilter] = useState('all'); + const [categories, setCategories] = useState([]); + const [allData, setAllData] = useState([]); + const [loading, setLoading] = useState(false); + useEffect(() => { + filterArray(); + }, [filter]); useEffect(() => { - let uniqueCategories = [] - const allCategories = [] - -const token = window.localStorage.getItem('jwtToken'); - setLoading(true) - const res = axios.get(api , { - headers: { - 'Authorization': `Bearer ${token}` - } - }) - - res.then (response => { - setAllData(response.data.data.reverse()) - setActions(response.data.data) - setLoading(false) - - response.data.data.map((action) => { - allCategories.push(action.category) - }) - setCategories(uniqueCategories) - }) - -}, []) - - - - -// Function to sort the actions by amount or date -const sortArray = type => { -const types = { - amountAsc: 'amount', - amountDesc: 'amount', - date: 'date' -} - -const sortProperty = types[type] - -if (sortType == 'amountAsc') { - const sorted = [...actions].sort((a,b) => a[sortProperty] - b[sortProperty]) - setActions(sorted) -} else if (sortType == 'amountDesc') { - const sorted = [...actions].sort((a,b) => b[sortProperty] - a[sortProperty]) - setActions(sorted) -} else if (sortType == 'date') { - const sorted = [...actions].sort((a,b) => new Date(a[sortProperty]) - new Date(b[sortProperty])) - setActions(sorted) -} else { - setActions(allData) -} -} - -// Filter the array, sets current page back to 1 after filtering -const filterArray = () => { -setCurrentPage(1) -if (filter != 'all') { - for(let i = 0; i < categories.length; i++) { - if(filter == categories[i]) { - const filtered = [...allData].filter(action => action.category == categories[i]) - setActions(filtered) - } - } -} else { - setActions(allData) -} -} - -// Get current actions -const indexOfLastAction = currentPage * actionsPerPage; -const indexOfFirstAction = indexOfLastAction - actionsPerPage; -const currentActions = actions.slice(indexOfFirstAction, indexOfLastAction) -// Change page - -const paginate = (pageNumber) => setCurrentPage(pageNumber); - -const nextPage = (currentPage) => { -if(currentPage === Math.ceil(actions.length / actionsPerPage)) { - return -} -setCurrentPage(currentPage + 1) -} - -const previousPage = () => { -if(currentPage === 1) { - return -} -setCurrentPage(currentPage - 1) -} - - -if (loading) { -return ( -
- -
-) -} + sortArray(sortType); + }, [sortType]); + useEffect(() => { + const uniqueCategories = []; + const allCategories = []; + + const token = window.localStorage.getItem('jwtToken'); + setLoading(true); + const res = axios.get(api, { + headers: { + Authorization: `Bearer ${token}`, + }, + }); + + res.then((response) => { + setAllData(response.data.data.reverse()); + setActions(response.data.data); + setLoading(false); + + response.data.data.map((action) => { + allCategories.push(action.category); + }); + setCategories(uniqueCategories); + }); + }, []); + + // Function to sort the actions by amount or date + const sortArray = (type) => { + const types = { + amountAsc: 'amount', + amountDesc: 'amount', + date: 'date', + }; + + const sortProperty = types[type]; + + if (sortType == 'amountAsc') { + const sorted = [...actions].sort((a, b) => a[sortProperty] - b[sortProperty]); + setActions(sorted); + } else if (sortType == 'amountDesc') { + const sorted = [...actions].sort((a, b) => b[sortProperty] - a[sortProperty]); + setActions(sorted); + } else if (sortType == 'date') { + const sorted = [...actions].sort((a, b) => new Date(a[sortProperty]) - new Date(b[sortProperty])); + setActions(sorted); + } else { + setActions(allData); + } + }; + + // Filter the array, sets current page back to 1 after filtering + const filterArray = () => { + setCurrentPage(1); + if (filter != 'all') { + for (let i = 0; i < categories.length; i++) { + if (filter == categories[i]) { + const filtered = [...allData].filter((action) => action.category == categories[i]); + setActions(filtered); + } + } + } else { + setActions(allData); + } + }; + + // Get current actions + const indexOfLastAction = currentPage * actionsPerPage; + const indexOfFirstAction = indexOfLastAction - actionsPerPage; + const currentActions = actions.slice(indexOfFirstAction, indexOfLastAction); + // Change page + + const paginate = (pageNumber) => setCurrentPage(pageNumber); + + const nextPage = (currentPage) => { + if (currentPage === Math.ceil(actions.length / actionsPerPage)) { + return; + } + setCurrentPage(currentPage + 1); + }; + + const previousPage = () => { + if (currentPage === 1) { + return; + } + setCurrentPage(currentPage - 1); + }; + + if (loading) { return ( -
- { allData.length >= 1 && loading != true ? - -
- - - - {currentActions.map((proposal) => ( - - - ))} - - - -
- - : -
-

Nothing rejected by core team yet.

-
} -
+
+ +
); + } + + return ( +
+ { allData.length >= 1 && loading != true + + ? ( +
+ + {currentActions.map((proposal) => ( + + + ))} + + + +
+ ) + + : ( +
+

Nothing rejected by core team yet.

+
+ )} +
+ ); }; -export default ApprovedRejected; \ No newline at end of file +export default ApprovedRejected; diff --git a/components/Moderator/ProposalNotification/PaginationData.js b/components/Moderator/ProposalNotification/PaginationData.js index 5deda063..2a5e3e25 100644 --- a/components/Moderator/ProposalNotification/PaginationData.js +++ b/components/Moderator/ProposalNotification/PaginationData.js @@ -1,14 +1,9 @@ -import React from 'react'; -import { useEffect } from "react"; -import { useState } from "react"; -import Pagination from './../ElectProposals/Pagination'; -import Loader from './../../Loader'; -import Proposal from "./Proposal"; - - -const PaginationData = ({api}) => { - +import React, { useEffect, useState } from 'react'; +import Pagination from '../ElectProposals/Pagination'; +import Loader from '../../Loader'; +import Proposal from './Proposal'; +const PaginationData = function ({ api }) { const [actions, setActions] = useState([]); const [currentPage, setCurrentPage] = useState(1); const [actionsPerPage] = useState(2); @@ -18,150 +13,143 @@ const PaginationData = ({api}) => { const [allData, setAllData] = useState([]); const [loading, setLoading] = useState(false); - - useEffect(() => { - filterArray() - }, [filter]) + filterArray(); + }, [filter]); useEffect(() => { - sortArray(sortType) - }, [sortType]) + sortArray(sortType); + }, [sortType]); useEffect(() => { - - let uniqueCategories = [] - const allCategories = [] + let uniqueCategories = []; + const allCategories = []; // Fetch the action data. Set loading state to true before fetch, back to false after the fetch is complete const fetchData = () => { - - setLoading(true) - fetch ("https://koinstreet-learn-api.herokuapp.com/api/v1/proposal/") - .then(response => response.json()) - .then((response) => { - setAllData(response.data.reverse()) - setActions(response.data) - setLoading(false) - - // Set unique categories for filter dropdown - response.data.map((action) => { - allCategories.push(action.category) - }) - uniqueCategories = [...new Set(allCategories)] - setCategories(uniqueCategories) - }) + setLoading(true); + fetch('https://koinstreet-learn-api.herokuapp.com/api/v1/proposal/') + .then((response) => response.json()) + .then((response) => { + setAllData(response.data.reverse()); + setActions(response.data); + setLoading(false); + + // Set unique categories for filter dropdown + response.data.map((action) => { + allCategories.push(action.category); + }); + uniqueCategories = [...new Set(allCategories)]; + setCategories(uniqueCategories); + }); + }; + + fetchData(); + }, []); + + // Function to sort the actions by amount or date + const sortArray = (type) => { + const types = { + amountAsc: 'amount', + amountDesc: 'amount', + date: 'date', + }; + + const sortProperty = types[type]; + + if (sortType == 'amountAsc') { + const sorted = [...actions].sort((a, b) => a[sortProperty] - b[sortProperty]); + setActions(sorted); + } else if (sortType == 'amountDesc') { + const sorted = [...actions].sort((a, b) => b[sortProperty] - a[sortProperty]); + setActions(sorted); + } else if (sortType == 'date') { + const sorted = [...actions].sort((a, b) => new Date(a[sortProperty]) - new Date(b[sortProperty])); + setActions(sorted); + } else { + setActions(allData); } + }; + + // Filter the array, sets current page back to 1 after filtering + const filterArray = () => { + setCurrentPage(1); + if (filter != 'all') { + for (let i = 0; i < categories.length; i++) { + if (filter == categories[i]) { + const filtered = [...allData].filter((action) => action.category == categories[i]); + setActions(filtered); + } + } + } else { + setActions(allData); + } + }; - fetchData() - - }, []) - + // Get current actions + const indexOfLastAction = currentPage * actionsPerPage; + const indexOfFirstAction = indexOfLastAction - actionsPerPage; + const currentActions = actions.slice(indexOfFirstAction, indexOfLastAction); + // Change page -// Function to sort the actions by amount or date -const sortArray = type => { - const types = { - amountAsc: 'amount', - amountDesc: 'amount', - date: 'date' - } + const paginate = (pageNumber) => setCurrentPage(pageNumber); - const sortProperty = types[type] - - if (sortType == 'amountAsc') { - const sorted = [...actions].sort((a,b) => a[sortProperty] - b[sortProperty]) - setActions(sorted) - } else if (sortType == 'amountDesc') { - const sorted = [...actions].sort((a,b) => b[sortProperty] - a[sortProperty]) - setActions(sorted) - } else if (sortType == 'date') { - const sorted = [...actions].sort((a,b) => new Date(a[sortProperty]) - new Date(b[sortProperty])) - setActions(sorted) - } else { - setActions(allData) - } -} - -// Filter the array, sets current page back to 1 after filtering -const filterArray = () => { - setCurrentPage(1) - if (filter != 'all') { - for(let i = 0; i < categories.length; i++) { - if(filter == categories[i]) { - const filtered = [...allData].filter(action => action.category == categories[i]) - setActions(filtered) - } + const nextPage = (currentPage) => { + if (currentPage === Math.ceil(actions.length / actionsPerPage)) { + return; } - } else { - setActions(allData) - } -} + setCurrentPage(currentPage + 1); + }; -// Get current actions -const indexOfLastAction = currentPage * actionsPerPage; -const indexOfFirstAction = indexOfLastAction - actionsPerPage; -const currentActions = actions.slice(indexOfFirstAction, indexOfLastAction) -// Change page - -const paginate = (pageNumber) => setCurrentPage(pageNumber); - -const nextPage = (currentPage) => { - if(currentPage === Math.ceil(actions.length / actionsPerPage)) { - return - } - setCurrentPage(currentPage + 1) -} + const previousPage = () => { + if (currentPage === 1) { + return; + } + setCurrentPage(currentPage - 1); + }; -const previousPage = () => { - if(currentPage === 1) { - return + if (loading) { + return ( +
+ +
+ ); } - setCurrentPage(currentPage - 1) -} - -if (loading) { return ( -
- +
+ { allData.length >= 1 && loading != true + + ? ( +
+ {currentActions.map((proposal) => ( + + ))} + + +
+ ) + + : ''}
- ) -} - - - return ( -
- { allData.length >= 1 && loading != true ? - -
- {currentActions.map((proposal) => ( - - ))} - - -
- - : ""} -
- ); + ); }; -export default PaginationData; \ No newline at end of file +export default PaginationData; diff --git a/components/Moderator/ProposalNotification/Proposal.js b/components/Moderator/ProposalNotification/Proposal.js index 35bd56e4..72d1aab3 100644 --- a/components/Moderator/ProposalNotification/Proposal.js +++ b/components/Moderator/ProposalNotification/Proposal.js @@ -1,168 +1,178 @@ -import React from 'react'; -import Moment from "react-moment"; -import { FaSortUp } from "react-icons/fa"; -import { FaSortDown } from "react-icons/fa"; -import { useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; +import Moment from 'react-moment'; +import { FaSortUp, FaSortDown } from 'react-icons/fa'; import axios from 'axios'; -import { useState } from 'react'; - -const Proposal = (props) => { - - const {title, type, Category, proposal, createdAt, description, userName, _id, image} = props; - - const [reply, setReply] = useState (); - - const [views, setViews] = useState ({data: {data: []}}); - - const [upVotes, setUpVotes] = useState ({data: {data: 0}}); - const [downVotes, setDownVotes] = useState ({data: {data: 0}}); - - const [votes, setVotes] = useState (null); - - const defaultVotes = downVotes.data.data.length; - - const token = window.localStorage.getItem('jwtToken'); - - - // Views _______________ - - useEffect(() => { - const res = axios.get("https://koinstreet-learn-api.herokuapp.com/api/v1/proposalViews", { - headers: { - 'Authorization': `Bearer ${token}` - } - }) - res.then (data => setViews(data)) - - }, []) - // Views _______________ - -// Replies ___________________ - useEffect(() => { - fetch (`https://koinstreet-learn-api.herokuapp.com/api/v1/proposal/${_id}/reply`) - .then(response => response.json()) - .then((response) => setReply (response.data.length)) - }, [_id]) - - // Replies ___________________ - - - - // upVotes _______________ - - useEffect(() => { - const res = axios.get(`https://koinstreet-learn-api.herokuapp.com/api/v1/upVotes/proposalUpvote/${_id}`, { - headers: { - 'Authorization': `Bearer ${token}` - } - }) - res.then (data =>setUpVotes(data)) - - }, []) - - // upVotes _______________ - - - // downVotes _______________ - - - useEffect(() => { - const res = axios.get(`https://koinstreet-learn-api.herokuapp.com/api/v1/downVotes/proposalDownvote/${_id}`, { - headers: { - 'Authorization': `Bearer ${token}` - } - }) - res.then (data => setDownVotes (data)) - - }, []) - - //downVotes _______________ - return ( -
-
-
-

- {title} -

-

- - Type: {type} - - - Category: {Category} - -

-
-
-

- - {proposal} -

-
+const Proposal = function (props) { + const { + title, type, Category, proposal, createdAt, description, userName, _id, image, + } = props; + + const [reply, setReply] = useState(); + + const [views, setViews] = useState({ data: { data: [] } }); + + const [upVotes, setUpVotes] = useState({ data: { data: 0 } }); + const [downVotes, setDownVotes] = useState({ data: { data: 0 } }); + + const [votes, setVotes] = useState(null); + + const defaultVotes = downVotes.data.data.length; + + const token = window.localStorage.getItem('jwtToken'); + + // Views _______________ + + useEffect(() => { + const res = axios.get('https://koinstreet-learn-api.herokuapp.com/api/v1/proposalViews', { + headers: { + Authorization: `Bearer ${token}`, + }, + }); + res.then((data) => setViews(data)); + }, []); + // Views _______________ + + // Replies ___________________ + useEffect(() => { + fetch(`https://koinstreet-learn-api.herokuapp.com/api/v1/proposal/${_id}/reply`) + .then((response) => response.json()) + .then((response) => setReply(response.data.length)); + }, [_id]); + + // Replies ___________________ + + // upVotes _______________ + + useEffect(() => { + const res = axios.get(`https://koinstreet-learn-api.herokuapp.com/api/v1/upVotes/proposalUpvote/${_id}`, { + headers: { + Authorization: `Bearer ${token}`, + }, + }); + res.then((data) => setUpVotes(data)); + }, []); + + // upVotes _______________ + + // downVotes _______________ + + useEffect(() => { + const res = axios.get(`https://koinstreet-learn-api.herokuapp.com/api/v1/downVotes/proposalDownvote/${_id}`, { + headers: { + Authorization: `Bearer ${token}`, + }, + }); + res.then((data) => setDownVotes(data)); + }, []); + + // downVotes _______________ + return ( +
+
+
+

+ {title} +

+

+ + Type: + {' '} + {type} + + + + Category: + {' '} + {Category} + +

+
+
+

+ + {proposal} +

-
-
-
-
- user -
- -
-

- Created by
{userName} -

-
- -
-

- Created on
- - {createdAt} - - -

-
+
+
+
+
+
+ user
-
-
-

- {reply}
Replies -

-
- -
-

- {views.data.data.length}
Views -

-
-
-

- setVotes(upVotes.data.data.length)} /> - {votes ? votes : defaultVotes} - setVotes(downVotes.data.data.length)} /> -

-
+ +
+

+ Created by + {' '} +
+ {' '} + {userName} +

+
+ +
+

+ Created on + {' '} +
+ {' '} + + + {createdAt} + + +

-
-
-
-

{description}

+
+
+

+ {reply} + {' '} +
+ {' '} + Replies +

-
+ +

- + {views.data.data.length} + {' '} +
+ {' '} + Views

+
+

+ setVotes(upVotes.data.data.length)} /> + {votes || defaultVotes} + setVotes(downVotes.data.data.length)} /> +

+
+
+
+
+
+
+

{description}

+
+
+

+ +

- ); +
+ ); }; -export default Proposal; \ No newline at end of file +export default Proposal; diff --git a/components/Moderator/ProposalNotification/ProposalNotification.js b/components/Moderator/ProposalNotification/ProposalNotification.js index d09734ae..64257943 100644 --- a/components/Moderator/ProposalNotification/ProposalNotification.js +++ b/components/Moderator/ProposalNotification/ProposalNotification.js @@ -1,34 +1,24 @@ -import React from "react"; -import { useEffect } from "react"; -import { useState } from "react"; -import axios from "axios"; +import React, { useEffect, useState } from 'react'; +import axios from 'axios'; import PaginationData from './PaginationData'; -import ApprovedRejected from "./ApprovedRejected.js"; -import Proposal from "./Proposal"; -import Loader from './../../Loader'; -import Pagination from './../ElectProposals/Pagination'; -import electProposal from "../electProposal.json"; +import ApprovedRejected from './ApprovedRejected.js'; +import Proposal from './Proposal'; +import Loader from '../../Loader'; +import Pagination from '../ElectProposals/Pagination'; +import electProposal from '../electProposal.json'; -const ProposalNotification = () => { +const ProposalNotification = function () { + const [approvedProposal, setApprovedProposal] = useState({ status: null, data: { data: 0 } }); - const [approvedProposal, setApprovedProposal] = useState ({status: null, data: {data: 0}}); - - const [deniedProposal, setDenied] = useState ({status: null, data: {data: 0}}); - - // userDeniedProposal ___________________ - - - + const [deniedProposal, setDenied] = useState({ status: null, data: { data: 0 } }); // userDeniedProposal ___________________ - - //______________________________________________________________________________________________________________________________________________________________________ - -// // Function to sort the actions by amount or date - + // userDeniedProposal ___________________ + // ______________________________________________________________________________________________________________________________________________________________________ + // // Function to sort the actions by amount or date return ( @@ -57,7 +47,7 @@ const ProposalNotification = () => { -{/* */} + {/* */}
@@ -70,27 +60,27 @@ const ProposalNotification = () => { team.

- {/*approvedProposal ______________________ */} + {/* approvedProposal ______________________ */} + + + + {/* approvedProposal ______________________ */} - - -{/*approvedProposal ______________________ */} -

- Proposals rejected by core team. + Proposals rejected by core team.

- The following proposals you elected, were rejected by the core team. + The following proposals you elected, were rejected by the core team.

- +
); }; -export default ProposalNotification; \ No newline at end of file +export default ProposalNotification; diff --git a/components/Moderator/TaskStatus.js b/components/Moderator/TaskStatus.js index 799fd197..37b60a2c 100644 --- a/components/Moderator/TaskStatus.js +++ b/components/Moderator/TaskStatus.js @@ -1,11 +1,9 @@ -import React from "react"; -import { useEffect } from "react"; -import { useState } from "react"; -import electProposal from "./electProposal.json"; -import { RiFlag2Fill } from "react-icons/ri"; -import { BsThreeDotsVertical } from "react-icons/bs"; +import React, { useEffect, useState } from 'react'; +import { RiFlag2Fill } from 'react-icons/ri'; +import { BsThreeDotsVertical } from 'react-icons/bs'; +import electProposal from './electProposal.json'; -const TaskStatus = () => { +const TaskStatus = function () { const [proposals, setProposals] = useState([]); useEffect(() => { @@ -76,7 +74,7 @@ const TaskStatus = () => { ); }; -const ProposalList = ({ id, sDes, flag }) => { +const ProposalList = function ({ id, sDes, flag }) { return (
diff --git a/components/Moderator/TaskStatusDragNdrop.js b/components/Moderator/TaskStatusDragNdrop.js index 81064ac3..04aa6d9b 100644 --- a/components/Moderator/TaskStatusDragNdrop.js +++ b/components/Moderator/TaskStatusDragNdrop.js @@ -1,24 +1,22 @@ - import React from "react"; -import { useEffect } from "react"; -import { useState } from "react"; -import electProposal from "./electProposal.json"; -import { RiFlag2Fill } from "react-icons/ri"; -import { BsThreeDotsVertical } from "react-icons/bs"; -import { useDrag, useDrop } from "react-dnd"; +import React, { useEffect, useState } from 'react'; +import { RiFlag2Fill } from 'react-icons/ri'; +import { BsThreeDotsVertical } from 'react-icons/bs'; +import { useDrag, useDrop } from 'react-dnd'; +import electProposal from './electProposal.json'; -const TaskStatusDnD = () => { +const TaskStatusDnD = function () { const [proposals, setProposals] = useState(() => electProposal); const [list, setList] = useState([]); const [{ isOver }, addToListRef] = useDrop({ - accept: "proposal", + accept: 'proposal', collect: (monitor) => ({ isOver: !!monitor.isOver(), }), }); const [{ isOver: isProposalOver }, removeFromListRef] = useDrop({ - accept: "list", + accept: 'list', collect: (monitor) => ({ isOver: !!monitor.isOver(), }), @@ -26,11 +24,9 @@ const TaskStatusDnD = () => { const movePlayer = (item) => { console.log(item); - if (item && item.type === "proposal") { + if (item && item.type === 'proposal') { setList((_list) => [...list, proposals[item.index]]); - setProposals((_proposals) => - _proposals.filter((_, idx) => idx !== item.index) - ); + setProposals((_proposals) => _proposals.filter((_, idx) => idx !== item.index)); } else { setProposals((_proposals) => [..._proposals, list[item.index]]); setList((_list) => _list.filter((_, idx) => idx !== item.index)); @@ -103,7 +99,7 @@ const TaskStatusDnD = () => {

Completed Task

-
+
@@ -111,7 +107,9 @@ const TaskStatusDnD = () => { ); }; -const ProposalList = ({ id, sDes, flag, index, boardType, onDropPlayer }) => { +const ProposalList = function ({ + id, sDes, flag, index, boardType, onDropPlayer, +}) { const [{ isDragging }, dragRef] = useDrag({ item: { type: boardType, diff --git a/components/Moderator/myElectedProposal.js b/components/Moderator/myElectedProposal.js index 1f6bea03..bee80a43 100644 --- a/components/Moderator/myElectedProposal.js +++ b/components/Moderator/myElectedProposal.js @@ -1,167 +1,157 @@ -import React from "react"; -import { useEffect } from "react"; -import { useState } from "react"; -import ComingSoon from "../ComingSoon"; -import Loader from "../Loader"; -import Proposal from "./Proposal"; +import React, { useEffect, useState } from 'react'; +import ComingSoon from '../ComingSoon'; +import Loader from '../Loader'; +import Proposal from './Proposal'; import Pagination from './ElectProposals/Pagination'; -const MyElectedProposal = () => { - - - const [actions, setActions] = useState([]); - const [currentPage, setCurrentPage] = useState(1); - const [actionsPerPage] = useState(4); - const [sortType, setSortType] = useState('Sort By'); - const [filter, setFilter] = useState('all'); - const [categories, setCategories] = useState([]); - const [allData, setAllData] = useState([]); - const [loading, setLoading] = useState(false); - - - - useEffect(() => { - filterArray() - }, [filter]) - - useEffect(() => { - sortArray(sortType) - }, [sortType]) - - useEffect(() => { - - let uniqueCategories = [] - const allCategories = [] - - // Fetch the action data. Set loading state to true before fetch, back to false after the fetch is complete - const fetchData = () => { - - fetch ("https://koinstreet-learn-api.herokuapp.com/api/v1/proposal/") - .then(response => response.json()) - .then((response) => { - // setProposals (response.data) - setAllData(response.data.reverse()) - setActions(response.data) - setLoading(false) - console.log (response) - - // Set unique categories for filter dropdown - response.data.map((action) => { - allCategories.push(action.category) - }) - uniqueCategories = [...new Set(allCategories)] - setCategories(uniqueCategories) - }) - } - - fetchData() - - }, []) - - - // Function to sort the actions by amount or date - const sortArray = type => { - const types = { - amountAsc: 'amount', - amountDesc: 'amount', - date: 'date' - } - - const sortProperty = types[type] - - if (sortType == 'amountAsc') { - const sorted = [...actions].sort((a,b) => a[sortProperty] - b[sortProperty]) - setActions(sorted) - } else if (sortType == 'amountDesc') { - const sorted = [...actions].sort((a,b) => b[sortProperty] - a[sortProperty]) - setActions(sorted) - } else if (sortType == 'date') { - const sorted = [...actions].sort((a,b) => new Date(a[sortProperty]) - new Date(b[sortProperty])) - setActions(sorted) - } else { - setActions(allData) - } - } - - // Filter the array, sets current page back to 1 after filtering - const filterArray = () => { - setCurrentPage(1) - if (filter != 'all') { - for(let i = 0; i < categories.length; i++) { - if(filter == categories[i]) { - const filtered = [...allData].filter(action => action.category == categories[i]) - setActions(filtered) - } - } - } else { - setActions(allData) - } - } - - // Get current actions - const indexOfLastAction = currentPage * actionsPerPage; - const indexOfFirstAction = indexOfLastAction - actionsPerPage; - const currentActions = actions.slice(indexOfFirstAction, indexOfLastAction) - // Change page - - const paginate = (pageNumber) => setCurrentPage(pageNumber); - - const nextPage = (currentPage) => { - if(currentPage === Math.ceil(actions.length / actionsPerPage)) { - return - } - setCurrentPage(currentPage + 1) - } - - const previousPage = () => { - if(currentPage === 1) { - return - } - setCurrentPage(currentPage - 1) - } - - - if (loading) { - return ( -
- -
- ) - } +const MyElectedProposal = function () { + const [actions, setActions] = useState([]); + const [currentPage, setCurrentPage] = useState(1); + const [actionsPerPage] = useState(4); + const [sortType, setSortType] = useState('Sort By'); + const [filter, setFilter] = useState('all'); + const [categories, setCategories] = useState([]); + const [allData, setAllData] = useState([]); + const [loading, setLoading] = useState(false); + + useEffect(() => { + filterArray(); + }, [filter]); + + useEffect(() => { + sortArray(sortType); + }, [sortType]); + + useEffect(() => { + let uniqueCategories = []; + const allCategories = []; + + // Fetch the action data. Set loading state to true before fetch, back to false after the fetch is complete + const fetchData = () => { + fetch('https://koinstreet-learn-api.herokuapp.com/api/v1/proposal/') + .then((response) => response.json()) + .then((response) => { + // setProposals (response.data) + setAllData(response.data.reverse()); + setActions(response.data); + setLoading(false); + console.log(response); + + // Set unique categories for filter dropdown + response.data.map((action) => { + allCategories.push(action.category); + }); + uniqueCategories = [...new Set(allCategories)]; + setCategories(uniqueCategories); + }); + }; + + fetchData(); + }, []); + + // Function to sort the actions by amount or date + const sortArray = (type) => { + const types = { + amountAsc: 'amount', + amountDesc: 'amount', + date: 'date', + }; + + const sortProperty = types[type]; + + if (sortType == 'amountAsc') { + const sorted = [...actions].sort((a, b) => a[sortProperty] - b[sortProperty]); + setActions(sorted); + } else if (sortType == 'amountDesc') { + const sorted = [...actions].sort((a, b) => b[sortProperty] - a[sortProperty]); + setActions(sorted); + } else if (sortType == 'date') { + const sorted = [...actions].sort((a, b) => new Date(a[sortProperty]) - new Date(b[sortProperty])); + setActions(sorted); + } else { + setActions(allData); + } + }; + + // Filter the array, sets current page back to 1 after filtering + const filterArray = () => { + setCurrentPage(1); + if (filter != 'all') { + for (let i = 0; i < categories.length; i++) { + if (filter == categories[i]) { + const filtered = [...allData].filter((action) => action.category == categories[i]); + setActions(filtered); + } + } + } else { + setActions(allData); + } + }; + + // Get current actions + const indexOfLastAction = currentPage * actionsPerPage; + const indexOfFirstAction = indexOfLastAction - actionsPerPage; + const currentActions = actions.slice(indexOfFirstAction, indexOfLastAction); + // Change page + + const paginate = (pageNumber) => setCurrentPage(pageNumber); + + const nextPage = (currentPage) => { + if (currentPage === Math.ceil(actions.length / actionsPerPage)) { + return; + } + setCurrentPage(currentPage + 1); + }; + + const previousPage = () => { + if (currentPage === 1) { + return; + } + setCurrentPage(currentPage - 1); + }; + + if (loading) { + return ( +
+ +
+ ); + } return (
- {allData.length >= 1 && loading != true ? -
-
-
- moderator -

My elected proposals

-

- Check the status of proposals you are elected. -

-
-
- bg -
-
+ {allData.length >= 1 && loading != true + ? ( +
+
+
+ moderator +

My elected proposals

+

+ Check the status of proposals you are elected. +

+
+
+ bg +
+
-
- {currentActions.slice(0, 4).map((proposal) => ( - - ))} - -
-
- : - } +
+ {currentActions.slice(0, 4).map((proposal) => ( + + ))} + +
+
+ ) + : }
); diff --git a/components/NativeBalance.jsx b/components/NativeBalance.jsx index f605474e..adcb8e7b 100644 --- a/components/NativeBalance.jsx +++ b/components/NativeBalance.jsx @@ -1,14 +1,16 @@ -import { useNativeBalance } from "../helpers/useNativeBalance"; -import { n4 } from "../helpers/formatters"; +import { useNativeBalance } from '../helpers/useNativeBalance'; +import { n4 } from '../helpers/formatters'; -function NativeBalance(props) { +const NativeBalance = function (props) { const { balance, nativeName } = useNativeBalance(props); return ( -
{`${n4.format( - balance.formatted - )} ${nativeName}`}
+
+ {`${n4.format( + balance.formatted, + )} ${nativeName}`} +
); -} +}; export default NativeBalance; diff --git a/components/NavOne.js b/components/NavOne.js index 3776b412..f71929e3 100644 --- a/components/NavOne.js +++ b/components/NavOne.js @@ -1,7 +1,7 @@ -import React, { Component } from "react"; -import Link from "next/link"; -import { useRouter } from "next/router"; -import Modal from "../components/login-signup/modal/index"; +import React, { Component } from 'react'; +import Link from 'next/link'; +import { useRouter } from 'next/router'; +import Modal from './login-signup/modal/index'; class NavOne extends Component { constructor() { @@ -11,18 +11,19 @@ class NavOne extends Component { displayModal: false, }; } + componentDidMount() { - window.addEventListener("scroll", this.handleScroll); + window.addEventListener('scroll', this.handleScroll); - //Mobile Menu + // Mobile Menu this.mobileMenu(); - //Search Toggle + // Search Toggle this.serachButton(); } componentWillUnmount() { - window.removeEventListener("scroll", this.handleScroll); + window.removeEventListener('scroll', this.handleScroll); } handleScroll = () => { @@ -38,32 +39,31 @@ class NavOne extends Component { }; mobileMenu = () => { - //Mobile Menu Toggle - let mainNavToggler = document.querySelector(".menu-toggler"); - let mainNav = document.querySelector(".main-navigation"); + // Mobile Menu Toggle + const mainNavToggler = document.querySelector('.menu-toggler'); + const mainNav = document.querySelector('.main-navigation'); - mainNavToggler.addEventListener("click", function () { - mainNav.style.display = - mainNav.style.display != "block" ? "block" : "none"; + mainNavToggler.addEventListener('click', () => { + mainNav.style.display = mainNav.style.display != 'block' ? 'block' : 'none'; }); }; serachButton = () => { - let searchToggle = document.querySelector(".search-toggle"); - let searchPopup = document.querySelector(".search-popup"); - let searchClose = document.querySelector(".cancel"); - let searchOverlay = document.querySelector(".search-overlay"); + const searchToggle = document.querySelector('.search-toggle'); + const searchPopup = document.querySelector('.search-popup'); + const searchClose = document.querySelector('.cancel'); + const searchOverlay = document.querySelector('.search-overlay'); // searchToggle.addEventListener("click", function () { // searchPopup.classList.add('active'); // }); - searchClose.addEventListener("click", function () { - searchPopup.classList.remove("active"); + searchClose.addEventListener('click', () => { + searchPopup.classList.remove('active'); }); - searchOverlay.addEventListener("click", function () { - searchPopup.classList.remove("active"); + searchOverlay.addEventListener('click', () => { + searchPopup.classList.remove('active'); }); }; @@ -72,7 +72,7 @@ class NavOne extends Component {
@@ -201,13 +202,13 @@ class NavOne extends Component {
-
+
-
+
-
+
diff --git a/components/NavThree.js b/components/NavThree.js index 6c4dce72..4231e551 100644 --- a/components/NavThree.js +++ b/components/NavThree.js @@ -1,141 +1,144 @@ -import React, {Component} from 'react'; -import Link from "next/link"; - -class NavThree extends Component { - constructor(){ - super() - this.state = { - sticky: false - }; - } - componentDidMount(){ - window.addEventListener('scroll', this.handleScroll); - - //Mobile Menu - this.mobileMenu(); - } - - componentWillUnmount() { - window.removeEventListener('scroll', this.handleScroll); - } - - handleScroll = () => { - - if (window.scrollY > 70) { - this.setState({ - sticky: true - }); - } else if (window.scrollY < 70) { - this.setState({ - sticky: false - }); - } - - } - - mobileMenu = () => { - //Mobile Menu Toggle - let mainNavToggler = document.querySelector(".menu-toggler"); - let mainNav = document.querySelector(".main-navigation"); - - mainNavToggler.addEventListener("click", function () { - mainNav.style.display = ( (mainNav.style.display != "block" ? "block" : "none" ) ); - }); - } - render() { - return ( -
- - -
- ); - } -} - -export default NavThree; \ No newline at end of file +import React, { Component } from 'react'; +import Link from 'next/link'; + +class NavThree extends Component { + constructor() { + super(); + this.state = { + sticky: false, + }; + } + + componentDidMount() { + window.addEventListener('scroll', this.handleScroll); + + // Mobile Menu + this.mobileMenu(); + } + + componentWillUnmount() { + window.removeEventListener('scroll', this.handleScroll); + } + + handleScroll = () => { + if (window.scrollY > 70) { + this.setState({ + sticky: true, + }); + } else if (window.scrollY < 70) { + this.setState({ + sticky: false, + }); + } + }; + + mobileMenu = () => { + // Mobile Menu Toggle + const mainNavToggler = document.querySelector('.menu-toggler'); + const mainNav = document.querySelector('.main-navigation'); + + mainNavToggler.addEventListener('click', () => { + mainNav.style.display = ((mainNav.style.display != 'block' ? 'block' : 'none')); + }); + }; + + render() { + return ( +
+ + +
+ ); + } +} + +export default NavThree; diff --git a/components/NavTwo.js b/components/NavTwo.js index 65d7e79f..8650e9e1 100644 --- a/components/NavTwo.js +++ b/components/NavTwo.js @@ -1,141 +1,144 @@ -import React, {Component} from 'react'; -import Link from 'next/link'; - -class NavTwo extends Component { - constructor(){ - super() - this.state = { - sticky: false - }; - } - componentDidMount(){ - window.addEventListener('scroll', this.handleScroll); - - //Mobile Menu - this.mobileMenu(); - } - - componentWillUnmount() { - window.removeEventListener('scroll', this.handleScroll); - } - - handleScroll = () => { - - if (window.scrollY > 70) { - this.setState({ - sticky: true - }); - } else if (window.scrollY < 70) { - this.setState({ - sticky: false - }); - } - - } - - mobileMenu = () => { - //Mobile Menu Toggle - let mainNavToggler = document.querySelector(".menu-toggler"); - let mainNav = document.querySelector(".main-navigation"); - - mainNavToggler.addEventListener("click", function () { - mainNav.style.display = ( (mainNav.style.display != "block" ? "block" : "none" ) ); - }); - } - render() { - return ( -
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
- ); - } -} -export default NavTwo; \ No newline at end of file +import React, { Component } from 'react'; +import Link from 'next/link'; + +class NavTwo extends Component { + constructor() { + super(); + this.state = { + sticky: false, + }; + } + + componentDidMount() { + window.addEventListener('scroll', this.handleScroll); + + // Mobile Menu + this.mobileMenu(); + } + + componentWillUnmount() { + window.removeEventListener('scroll', this.handleScroll); + } + + handleScroll = () => { + if (window.scrollY > 70) { + this.setState({ + sticky: true, + }); + } else if (window.scrollY < 70) { + this.setState({ + sticky: false, + }); + } + }; + + mobileMenu = () => { + // Mobile Menu Toggle + const mainNavToggler = document.querySelector('.menu-toggler'); + const mainNav = document.querySelector('.main-navigation'); + + mainNavToggler.addEventListener('click', () => { + mainNav.style.display = ((mainNav.style.display != 'block' ? 'block' : 'none')); + }); + }; + + render() { + return ( +
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ); + } +} +export default NavTwo; diff --git a/components/News.js b/components/News.js index 69ef48a4..c7ec3fa0 100644 --- a/components/News.js +++ b/components/News.js @@ -1,179 +1,281 @@ -import React from 'react'; -import Link from 'next/link'; - -const News = () => { - return ( -
-
-
-
-
-
- - - -
-
-
- - - -
-

- Why diversity matters in STEM? -

-

Why diversity matters in stem.

- Read More -
-
-
-
-
-
- - - -
-
-
- - - -
-

- How to Develop Community Online -

-

The pandemic has made it hard for to develop a community online, however these are the proven ways to make friends as

- Read More -
-
-
-
-
-
- - - -
-
-
- - - -
-

- What will get you a job in 2021 -

-

Where are industry trends going.

- Read More -
-
-
-
-
-
- - - -
-
-
- - - -
-

- How Mentorship Benefits Minorities -

-

Aelltes port lacus quis enim var sed efficitur turpis - gilla sed sit - amet finibus eros.

- Read More -
-
-
-
-
-
- - - -
-
-
- - - -
-

- Subject that fits your busy life styles -

-

Aelltes port lacus quis enim var sed efficitur turpis - gilla sed sit - amet finibus eros.

- Read More -
-
-
-
-
-
- - - -
-
-
- - - -
-

- Are you ready to become a best student -

-

Aelltes port lacus quis enim var sed efficitur turpis - gilla sed sit - amet finibus eros.

- Read More -
-
-
-
-
- - 1 - 2 - 3 - 4 - -
-
-
- ); -}; - -export default News; +import React from 'react'; +import Link from 'next/link'; + +const News = function () { + return ( +
+
+
+
+
+
+ + + + + + +
+
+ +

+ Why diversity matters in STEM? +

+

Why diversity matters in stem.

+ Read More +
+
+
+
+
+
+ + + + + + +
+
+ +

+ How to Develop Community Online +

+

The pandemic has made it hard for to develop a community online, however these are the proven ways to make friends as

+ Read More +
+
+
+
+
+
+ + + + + + +
+
+ +

+ What will get you a job in 2021 +

+

Where are industry trends going.

+ Read More +
+
+
+
+
+
+ + + + + + +
+
+ +

+ How Mentorship Benefits Minorities +

+

+ Aelltes port lacus quis enim var sed efficitur turpis + gilla sed sit + amet finibus eros. +

+ Read More +
+
+
+
+
+
+ + + + + + +
+
+ +

+ Subject that fits your busy life styles +

+

+ Aelltes port lacus quis enim var sed efficitur turpis + gilla sed sit + amet finibus eros. +

+ Read More +
+
+
+
+
+
+ + + + + + +
+
+ +

+ Are you ready to become a best student +

+

+ Aelltes port lacus quis enim var sed efficitur turpis + gilla sed sit + amet finibus eros. +

+ Read More +
+
+
+
+
+ + 1 + 2 + 3 + 4 + +
+
+
+ ); +}; + +export default News; diff --git a/components/NewsDetails.js b/components/NewsDetails.js index ad26eecd..e023326b 100644 --- a/components/NewsDetails.js +++ b/components/NewsDetails.js @@ -1,226 +1,297 @@ -import React from 'react'; +import React from 'react'; + +const NewsDetails = function () { + return ( +
+
+
+
+
+
+ + +
+
+ +

+ Are you ready to become a best student -const NewsDetails = () => { - return ( -
-
-
-
-
-
- - -
-
-
- - - -
-

Are you ready to become a best student - -

-

Aelltes port lacus quis enim var sed efficitur turpis - gilla sed sit - Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem - Ipsum has - been the industry’s standard dummy text ever since the 1500s, when an unknown - printer took a - galley of type and scrambled it to make a type specimen book. It has survived not - only five - centuries, but also the leap into electronic typesetting, remaining essentially - unchanged. -

-

It was popularised in the 1960s with the release of - Letraset sheets - containing Lorem Ipsum passages, and more recently with desktop publishing software - like - Aldus PageMaker including versions of lorem ipsum amet finibus eros. Lorem Ipsum is - simply - dummy text of the printing and typesetting industry. Lorem Ipsum has been the - industry’s - standard dummy text ever since the 1500s, when an unknown printer took a galley of - type and - scrambled it to make a type specimen book. It has survived not only five centuries, - but also - the leap into electronic typesetting.

-

It was popularised in the 1960s with the release of - Letraset sheets - containing Lorem Ipsum passages, and more recently with desktop publishing software - like - Aldus PageMaker including versions of lorem ipsum.

-
-
-
- -
- - - - -
-
-
-
- Awesome Image -
-
-

Christine Eve

-

Lorem Ipsum is simply dummy text of the rinting and typesetting been the industry - standard - dummy text ever sincer condimentum purus. In non ex at ligula fringilla lobortis et - not the - aliquet.

-
-
-

2 - Comments

-
-
-
-
- Awesome Image -
-
-
-
-
-

Laquanda Bachmeier

-

20 April, 2019 - 4:00 pm

-

Lorem Ipsum is simply dummy text of the - rinting and - typesetting been the industry standard dummy text ever sincer - condimentum purus. - In non ex at ligula fringilla lobortis et not the aliquet.

-
-
- Reply -
-
-
-
-
-
-
- Awesome Image -
-
-
-
-
-

Vicente - Elmore

-

20 April, 2019 - 4:00 pm

-

Lorem Ipsum is simply dummy text of the - rinting and - typesetting been the industry standard dummy text ever sincer - condimentum purus. - In non ex at ligula fringilla lobortis et not the aliquet.

-
-
- Reply -
-
-
-
-
-

Leave a - Comment

-
-
-
- -
-
- -
-
- - -
-
-
-
- -
-
-
- ); -}; - -export default NewsDetails; +

+

+ Aelltes port lacus quis enim var sed efficitur turpis + gilla sed sit + Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem + Ipsum has + been the industry’s standard dummy text ever since the 1500s, when an unknown + printer took a + galley of type and scrambled it to make a type specimen book. It has survived not + only five + centuries, but also the leap into electronic typesetting, remaining essentially + unchanged. +

+

+ It was popularised in the 1960s with the release of + Letraset sheets + containing Lorem Ipsum passages, and more recently with desktop publishing software + like + Aldus PageMaker including versions of lorem ipsum amet finibus eros. Lorem Ipsum is + simply + dummy text of the printing and typesetting industry. Lorem Ipsum has been the + industry’s + standard dummy text ever since the 1500s, when an unknown printer took a galley of + type and + scrambled it to make a type specimen book. It has survived not only five centuries, + but also + the leap into electronic typesetting. +

+

+ It was popularised in the 1960s with the release of + Letraset sheets + containing Lorem Ipsum passages, and more recently with desktop publishing software + like + Aldus PageMaker including versions of lorem ipsum. +

+
+
+
+
+

+ Tags:Business, + {' '} + Agency, + {' '} + Technology +

+
+
+ + + + +
+
+
+
+ Awesome Image +
+
+

Christine Eve

+

+ Lorem Ipsum is simply dummy text of the rinting and typesetting been the industry + standard + dummy text ever sincer condimentum purus. In non ex at ligula fringilla lobortis et + not the + aliquet. +

+
+
+

+ 2 + Comments +

+
+
+
+
+ Awesome Image +
+
+
+
+
+

Laquanda Bachmeier

+

+ 20 April, 2019- + + {' '} + 4:00 pm +

+

+ Lorem Ipsum is simply dummy text of the + rinting and + typesetting been the industry standard dummy text ever sincer + condimentum purus. + In non ex at ligula fringilla lobortis et not the aliquet. +

+
+
+ Reply +
+
+
+
+
+
+
+ Awesome Image +
+
+
+
+
+

+ Vicente + Elmore +

+

+ 20 April, 2019- + + {' '} + 4:00 pm +

+

+ Lorem Ipsum is simply dummy text of the + rinting and + typesetting been the industry standard dummy text ever sincer + condimentum purus. + In non ex at ligula fringilla lobortis et not the aliquet. +

+
+
+ Reply +
+
+
+
+
+

+ Leave a + Comment +

+
+
+
+ +
+
+ +
+
+ -
-
- - { - setNewProfileImage(e.target.files[0]); - }} - /> -
-
-
- +
+ + { + setNewProfileImage(e.target.files[0]); + }} + />
- - -
+
+
+ +
+ +
- +
); }; diff --git a/components/UpdateProfileTwo.js b/components/UpdateProfileTwo.js index b0829b33..64e48bc5 100644 --- a/components/UpdateProfileTwo.js +++ b/components/UpdateProfileTwo.js @@ -1,30 +1,32 @@ -import React, { useContext, useState, useEffect } from "react"; -import { AiOutlineClose } from "react-icons/ai"; -import { RiArrowDropDownLine } from "react-icons/ri"; -import { storeThree, storeTwo, storeOne } from "../contexts/utils/fields"; -import { updateProfile } from "../contexts/actions/profile/updateProfile"; -import { GlobalContext } from "../contexts/provider"; -import FormData from "form-data"; -import "react-toastify/dist/ReactToastify.css"; +import React, { useContext, useState, useEffect } from 'react'; +import { AiOutlineClose } from 'react-icons/ai'; +import { RiArrowDropDownLine } from 'react-icons/ri'; +import FormData from 'form-data'; +import { storeThree, storeTwo, storeOne } from '../contexts/utils/fields'; +import { updateProfile } from '../contexts/actions/profile/updateProfile'; +import { GlobalContext } from '../contexts/provider'; +import 'react-toastify/dist/ReactToastify.css'; -const UpdateProfileTwo = ({ open = true, setOpen = () => {}, userData }) => { +const UpdateProfileTwo = function ({ open = true, setOpen = () => {}, userData }) { const { profileDispatch, profileState: { - profile: { profileLoading, profileError, profileData, profileIsUpdated }, + profile: { + profileLoading, profileError, profileData, profileIsUpdated, + }, }, } = useContext(GlobalContext); useEffect(() => { if (open == true) { - document.getElementById("up-modal").classList.add("up-modal"); - document.getElementById("up-modal").classList.remove("up-hide-modal"); - document.getElementById("up-overlay").classList.add("up-overlay"); - document.getElementById("up-overlay").classList.remove("up-hide-overlay"); + document.getElementById('up-modal').classList.add('up-modal'); + document.getElementById('up-modal').classList.remove('up-hide-modal'); + document.getElementById('up-overlay').classList.add('up-overlay'); + document.getElementById('up-overlay').classList.remove('up-hide-overlay'); } else { - document.getElementById("up-modal").classList.add("up-hide-modal"); - document.getElementById("up-modal").classList.remove("up-modal"); - document.getElementById("up-overlay").classList.add("up-hide-overlay"); - document.getElementById("up-overlay").classList.remove("up-overlay"); + document.getElementById('up-modal').classList.add('up-hide-modal'); + document.getElementById('up-modal').classList.remove('up-modal'); + document.getElementById('up-overlay').classList.add('up-hide-overlay'); + document.getElementById('up-overlay').classList.remove('up-overlay'); } }); useEffect(() => { @@ -44,51 +46,51 @@ const UpdateProfileTwo = ({ open = true, setOpen = () => {}, userData }) => { setNewBio(userData.bio); }, [userData]); - const [newFirstName, setNewFirstName] = useState(userData.firstName || ""); - const [newlastName, setNewLastName] = useState(userData.lastName || ""); - const [newEmail, setNewEmail] = useState(userData.email || ""); + const [newFirstName, setNewFirstName] = useState(userData.firstName || ''); + const [newlastName, setNewLastName] = useState(userData.lastName || ''); + const [newEmail, setNewEmail] = useState(userData.email || ''); const [newPhoneNumber, setNewPhoneNumber] = useState( - userData.phoneNumber || "" + userData.phoneNumber || '', ); - const [newLocation, setNewLocation] = useState(userData.location || ""); - const [newBirthDate, setNewBirthDate] = useState(userData.birthday || ""); + const [newLocation, setNewLocation] = useState(userData.location || ''); + const [newBirthDate, setNewBirthDate] = useState(userData.birthday || ''); const [newNationality, setNewNationality] = useState( - userData.Nationality || "" + userData.Nationality || '', ); - const [newEthnicity, setNewEthnicity] = useState(userData.Ethnicity || ""); - const [newGender, setNewGender] = useState(userData.Gender || ""); + const [newEthnicity, setNewEthnicity] = useState(userData.Ethnicity || ''); + const [newGender, setNewGender] = useState(userData.Gender || ''); - const [newGithub, setNewGithub] = useState(userData.GithubLink || ""); - const [newLinkedin, setNewLinkedin] = useState(userData.LinkedinLink || ""); - const [newMedium, setNewMedium] = useState(userData.MediumLink || ""); - const [newFacebook, setNewFacebook] = useState(userData.FacebookLink || ""); + const [newGithub, setNewGithub] = useState(userData.GithubLink || ''); + const [newLinkedin, setNewLinkedin] = useState(userData.LinkedinLink || ''); + const [newMedium, setNewMedium] = useState(userData.MediumLink || ''); + const [newFacebook, setNewFacebook] = useState(userData.FacebookLink || ''); const [newBio, setNewBio] = useState(userData.bio); const formData = new FormData(); - formData.append("firstName", newFirstName || userData.firstName || ""); - formData.append("lastName", newlastName || userData.lastName || ""); - formData.append("email", newEmail || userData.email || ""); - formData.append("phoneNumber", newPhoneNumber || userData.phoneNumber || ""); - formData.append("location", newLocation || userData.location || ""); - formData.append("birthday", newBirthDate || ""); - formData.append("Nationality", newNationality || userData.Nationality || ""); - formData.append("Ethnicity", newEthnicity || userData.Ethnicity || ""); - formData.append("Gender", newGender || userData.Gender || ""); + formData.append('firstName', newFirstName || userData.firstName || ''); + formData.append('lastName', newlastName || userData.lastName || ''); + formData.append('email', newEmail || userData.email || ''); + formData.append('phoneNumber', newPhoneNumber || userData.phoneNumber || ''); + formData.append('location', newLocation || userData.location || ''); + formData.append('birthday', newBirthDate || ''); + formData.append('Nationality', newNationality || userData.Nationality || ''); + formData.append('Ethnicity', newEthnicity || userData.Ethnicity || ''); + formData.append('Gender', newGender || userData.Gender || ''); - formData.append("GithubLink", newGithub || userData.GithubLink || ""); - formData.append("LinkedinLink", newLinkedin || userData.LinkedinLink || ""); - formData.append("MediumLink", newMedium || userData.MediumLink || ""); - formData.append("FacebookLink", newFacebook || userData.FacebookLink || ""); + formData.append('GithubLink', newGithub || userData.GithubLink || ''); + formData.append('LinkedinLink', newLinkedin || userData.LinkedinLink || ''); + formData.append('MediumLink', newMedium || userData.MediumLink || ''); + formData.append('FacebookLink', newFacebook || userData.FacebookLink || ''); - formData.append("bio", newBio || userData.bio || ""); + formData.append('bio', newBio || userData.bio || ''); const [submit, setSubmit] = useState(false); useEffect(() => { if (profileData && submit && !profileError) { setTimeout(() => { - window.location.href = "/dashboard/user/singleProfile"; + window.location.href = '/dashboard/user/singleProfile'; setSubmit(false); }, 3000); } @@ -121,75 +123,75 @@ const UpdateProfileTwo = ({ open = true, setOpen = () => {}, userData }) => { const personalInfo = [ { - name: "firstName", - label: "First Name", - type: "text", + name: 'firstName', + label: 'First Name', + type: 'text', value: newFirstName, setValue: setNewFirstName, edit: true, }, { - name: "lastName", - label: "Last Name", - type: "text", + name: 'lastName', + label: 'Last Name', + type: 'text', value: newlastName, setValue: setNewLastName, edit: true, }, { - name: "email", - label: "Email", - type: "email", + name: 'email', + label: 'Email', + type: 'email', value: newEmail, setValue: setNewEmail, edit: true, }, { - name: "phone", - label: "Phone", - type: "text", + name: 'phone', + label: 'Phone', + type: 'text', value: newPhoneNumber, setValue: setNewPhoneNumber, edit: true, }, { - name: "location", - label: "Location", - type: "text", + name: 'location', + label: 'Location', + type: 'text', value: newLocation, setValue: setNewLocation, edit: true, }, { - name: "birthdate", - label: "Birthdate", - type: "date", + name: 'birthdate', + label: 'Birthdate', + type: 'date', value: newBirthDate, setValue: setNewBirthDate, edit: false, }, { - name: "nationality", - label: "Nationality", - type: "list", + name: 'nationality', + label: 'Nationality', + type: 'list', list: storeTwo(), value: newNationality, setValue: setNewNationality, edit: true, }, { - name: "ethnicity", - label: "Ethnicity", - type: "list", + name: 'ethnicity', + label: 'Ethnicity', + type: 'list', list: storeOne(), value: newEthnicity, setValue: setNewEthnicity, edit: true, }, { - name: "gender", - label: "Gender", - type: "list", + name: 'gender', + label: 'Gender', + type: 'list', list: storeThree(), value: newGender, setValue: setNewGender, @@ -199,25 +201,25 @@ const UpdateProfileTwo = ({ open = true, setOpen = () => {}, userData }) => { const socialMedia = [ { - name: "linkedin", - label: "Linkedin", - type: "text", + name: 'linkedin', + label: 'Linkedin', + type: 'text', value: newLinkedin, setValue: setNewLinkedin, edit: true, }, { - name: "github", - label: "Github", - type: "text", + name: 'github', + label: 'Github', + type: 'text', value: newGithub, setValue: setNewGithub, edit: true, }, { - name: "facebook", - label: "Facebook", - type: "text", + name: 'facebook', + label: 'Facebook', + type: 'text', value: newFacebook, setValue: setNewFacebook, edit: true, @@ -242,12 +244,12 @@ const UpdateProfileTwo = ({ open = true, setOpen = () => {}, userData }) => {
- {field.type == "list" ? ( + {field.type == 'list' ? (
-
- ) - }): '' - - function makeResumeName (e) { - changeUploadtext(e.target.files[0].name); - } - - - return ( -
{ - closeModal() - document.body.style.overflow = "auto" - }}> - - - {job != null ?
- -
{ - closeModal() - document.body.style.overflow = "auto" - }}> +export var ApplyModal = function ({ + job, open, closeModal, loadingReq, +}) { + const [uploadText, changeUploadtext] = useState(''); + + const requirements = loadingReq == true && job != null && job.min_requirements ? job.min_requirements.map((skill, idx) => ( +
+ + +
+ )) : ''; + + function makeResumeName(e) { + changeUploadtext(e.target.files[0].name); + } + + return ( +
{ + closeModal(); + document.body.style.overflow = 'auto'; + }} + > + + {job != null ? ( +
+ +
{ + closeModal(); + document.body.style.overflow = 'auto'; + }} + > X
@@ -48,37 +54,42 @@ export const ApplyModal = ({job,open,closeModal,loadingReq}) => {
-
- -
{user.first_name} {user.last_name}
+
+ +
+ {user.first_name} + {' '} + {user.last_name}
- -
-

Required Skills

- {requirements} +
+ +
+

Required Skills

+ {requirements} +
+
+ + makeResumeName(e)} /> +
+ {uploadText}
-
- - makeResumeName(e)}/> -
- {uploadText} -
-
+
-
: ''} -
- ) -} + ) : ''} + +
+ ); +}; diff --git a/components/career-components/CareerExplainer.js b/components/career-components/CareerExplainer.js index c733a16b..e37c3bfc 100644 --- a/components/career-components/CareerExplainer.js +++ b/components/career-components/CareerExplainer.js @@ -1,10 +1,10 @@ -import Link from "next/link"; -import { useEffect, useState, Fragment } from "react"; -import classes from "../../public/assets/css/career.module.css"; -import LoginPage from "../consultancy/helperFiles/login-page"; -import Category from "./careerExplainerHelper/category"; +import Link from 'next/link'; +import { useEffect, useState, Fragment } from 'react'; +import classes from '../../public/assets/css/career.module.css'; +import LoginPage from '../consultancy/helperFiles/login-page'; +import Category from './careerExplainerHelper/category'; -function CareerExplainer({ +const CareerExplainer = function ({ data, setClickRegister, active, @@ -14,40 +14,37 @@ function CareerExplainer({ const allSections = [ { innerText: - "Find the company that better fit for you according to your skills, passions,experience, etc", - header: "Search Companies", - src: "/assets/images/icons/career_landing/search_companies.png", - redirectTo: "/careers/companies", + 'Find the company that better fit for you according to your skills, passions,experience, etc', + header: 'Search Companies', + src: '/assets/images/icons/career_landing/search_companies.png', + redirectTo: '/careers/companies', }, { innerText: "Diversity & Inclusion are more important than ever. The Minority Programmers Association uses a metric that lets future employees know companies' organization and which actionable items to improve their diversity & inclusion practices. As an employee of a company you can rate and provide us the Diversity Score information.", - header: "Improve Diversity Score", - src: "/assets/images/icons/career_landing/improve_diversity_score.png", - redirectTo: "/careers", + header: 'Improve Diversity Score', + src: '/assets/images/icons/career_landing/improve_diversity_score.png', + redirectTo: '/careers', }, { innerText: - "Apply for the perfect job for you based on title, location, remote vs in-person, etc. check the recommendations based on your interests.", - header: "Apply for Jobs", - src: "/assets/images/icons/career_landing/apply_for_jobs.png", - redirectTo: "/careers", + 'Apply for the perfect job for you based on title, location, remote vs in-person, etc. check the recommendations based on your interests.', + header: 'Apply for Jobs', + src: '/assets/images/icons/career_landing/apply_for_jobs.png', + redirectTo: '/careers', }, ]; const [marginTop, setMarginTop] = useState(0); useEffect(() => { if (navBarRef.current && window) { - let currHeight = parseInt( - window.getComputedStyle(navBarRef.current).height + const currHeight = parseInt( + window.getComputedStyle(navBarRef.current).height, ); - if (typeof currHeight === "number" && currHeight > marginTop) - setMarginTop((prev) => { - return currHeight + "px"; - }); + if (typeof currHeight === 'number' && currHeight > marginTop) setMarginTop((prev) => `${currHeight}px`); } }, []); return ( - + <>
- {allSections.map((category, index) => { - return ( - - ); - })} + {allSections.map((category, index) => ( + + ))}
{data === null ? ( +import { useState } from 'react'; + +const SkillsDiv = function (props) { + return ( +
+ + {props.skill_order} + . + +
+
+ Skill +
- ) -} - -const JobCreation = () => { - const [skillsArray,changeSkillsArray]=useState([]); - const [skillsKey,changeSkillsKey]=useState(0); - - function removeSkill(i) { - //let nodeIndex=[...document.querySelector(".jobSkills-input").querySelectorAll(".job-skill")].indexOf(e.target.parentNode) - //console.log(nodeIndex) - - - changeSkillsArray(skillsArray.filter((_,index)=>i!==index)) +
+ Years + +
+
+ +
+ ); +}; + +const JobCreation = function () { + const [skillsArray, changeSkillsArray] = useState([]); + const [skillsKey, changeSkillsKey] = useState(0); + + function removeSkill(i) { + // let nodeIndex=[...document.querySelector(".jobSkills-input").querySelectorAll(".job-skill")].indexOf(e.target.parentNode) + // console.log(nodeIndex) + + changeSkillsArray(skillsArray.filter((_, index) => i !== index)); + } + + function addSkill(e) { + if (skillsArray.length < 15) { + const newSkillsArray = [...skillsArray, { id: skillsKey }]; + changeSkillsKey(skillsKey + 1); + changeSkillsArray((prevState) => [...newSkillsArray]); } + } + + const jobSkills = skillsArray.map((item, index, array) => ); + + return ( +
+ + + + + + +
+
+
Create a New Job
+
+ + +
+
+ + +
- function addSkill(e) { - if(skillsArray.length<15){ - let newSkillsArray=[...skillsArray,{id:skillsKey}] - changeSkillsKey(skillsKey+1) - changeSkillsArray((prevState)=>[...newSkillsArray]) - - } - - } +
+ + Job Remote? + * + +
+ + +
+
+
+ +
+ +
+
- let jobSkills = skillsArray.map((item,index,array)=> - - ) - - - return ( -
- - - - - - -
- -
Create a New Job
-
- - -
-
- - -
- -
- Job Remote? * -
- - -
-
- -
- -
- -
-
- -
- Job Type * - {/*
+
+ + Job Type + * + + {/*
@@ -106,69 +121,84 @@ const JobCreation = () => { -
*/} -
- -
-
- -
- - -
- {jobSkills} -
- - -
- - -
- - -
-
- - -
- - -
- - -
- - -
-
- -
- - -
- -
- - -
- -
- - -
- - +
*/} +
+ +
+
+ +
+ + +
+ {jobSkills} +
+ + +
+ +
+ + -
-
- -
- - {/*
+
*/} - {/*
*/} -
-
*/} +
+ -
-
- setSubTaskOpen(!subtaskOpen)} - className="tw-cursor-pointer" - width="23" - height="23" - viewBox="0 0 26 26" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > - - -

Add Subtask

- - -
+
+
+ setSubTaskOpen(!subtaskOpen)} + className="tw-cursor-pointer" + width="23" + height="23" + viewBox="0 0 26 26" + fill="none" + xmlns="http://www.w3.org/2000/svg" + > + + +

Add Subtask

- {todos?.map((todo, index) => ( -
- - {/*

{todo.todo}

*/} -
- ))} +
- { - subtaskText.map((singleSubTask, index) =>
+ {todos?.map((todo, index) => ( +
+ + {/*

{todo.todo}

*/} +
+ ))} + + { + subtaskText.map((singleSubTask, index) => ( +
{ // singleSubTask.data.id && - userCart.map(u => (
( +
HandleRemoveUser(u.id)} - data-tip={u.name}> + data-tip={u.name} + > -
)) +
+ )) } -
- +
+
-

{singleSubTask.name}

+

{singleSubTask.name}

{ - newUser && ) +
+ )) } - { - subtaskOpen && + { + subtaskOpen + && (
{ - handleAdd(e); - inputRef.current?.blur(); - }} + onSubmit={(e) => { + handleAdd(e); + inputRef.current?.blur(); + }} - className=" tw-ml-2 tw-pl-3 tw-rounded tw-my-3 tw-mr-3 tw-bg-gray-200 w-full tw-px-4 tw-py-3" > + className=" tw-ml-2 tw-pl-3 tw-rounded tw-my-3 tw-mr-3 tw-bg-gray-200 w-full tw-px-4 tw-py-3" + > - setTodo(e.target.value)} + setTodo(e.target.value)} - className=" tw-w-1/2 tw-bg-gray-200 tw-rounded-lg tw-text-black tw-px-4 tw-py-1 focus:tw-outline-none text-lg" placeholder="Sub Task description here" /> - {/* */} - + className=" tw-w-1/2 tw-bg-gray-200 tw-rounded-lg tw-text-black tw-px-4 tw-py-1 focus:tw-outline-none text-lg" + placeholder="Sub Task description here" + /> + {/* */} +
+ ) } - -
-
- {/* Right Site--------- */} -
-
-

Definition Of Done Checklist

-
-
-
- -
- -
- -
-
-
- {/*
+
+
+ {/* Right Site--------- */} +
+
+

Definition Of Done Checklist

+
+
+
+ + +
+ + +
+ + +
+
+
+ {/*
@@ -280,78 +291,80 @@ const TaskNameDescription = () => {
*/} -
-
+
+
+
+ {/* Down part ------------ */} +
+
+
+
+
+

Task Status Updates

+
+
+
+

Lorem created this task

+

Yesterday at 11:02 am

+
+
+
+ {/* Right Site--------- */} +
+
+

Definition Of Done Checklist

- {/* Down part ------------ */} -
-
-
-
-
-

Task Status Updates

-
-
-
-

Lorem created this task

-

Yesterday at 11:02 am

-
-
-
- {/* Right Site--------- */} -
-
-

Definition Of Done Checklist

-
-
-
-

Add Comments Or Email

-
-
-
- - -
-
- - - - -

- Comment +
+
+

Add Comments Or Email

+
+
+
+ + +
+
+ + + + +

+ Comment

-
-
-
-

-
+
+
-
-
-

- MOVE TASK TO In-Progress -

-

- Claim task and notify project manager that the task is being done. -

-
- -
-
-
+
+
+
+
+
+

+ MOVE TASK TO + {' '} + In-Progress +

+

+ Claim task and notify project manager that the task is being done. +

+
+ +
- ); +
+
+ ); }; export default TaskNameDescription; diff --git a/components/coreteam/TaskNameHeader.js b/components/coreteam/TaskNameHeader.js index f8b41567..b7af0341 100644 --- a/components/coreteam/TaskNameHeader.js +++ b/components/coreteam/TaskNameHeader.js @@ -1,249 +1,281 @@ -import React, { useState } from 'react'; +import React, { useState, useEffect } from 'react'; import ReactTooltip from 'react-tooltip'; -import { useEffect } from 'react'; -import { RiArrowRightSLine, RiUserAddLine } from 'react-icons/ri'; -import { RiFlag2Fill } from "react-icons/ri"; -import userinfo from '../../components/coreteam/User.json'; -import editTagsData from '../../components/coreteam/editTagsData.json'; -import piorityflagData from '../../components/coreteam/piorityflagData.json' +import { RiArrowRightSLine, RiUserAddLine, RiFlag2Fill } from 'react-icons/ri'; +import userinfo from './User.json'; +import editTagsData from './editTagsData.json'; +import piorityflagData from './piorityflagData.json'; import ModalComp from './ModalComp'; -const TaskNameHeader = () => { - const [newUser, setNewUser] = useState(false); - const [editTags, setEditTags] = useState(false); - const [users, setUsers] = useState({}); - const [allEditTags, setAllEditTags] = useState({}); - const [piority, setPiority] = useState(false) - const [allPiorityFlag, setAllPiorityFlag] = useState({}); - const [userCart, setUserCart] = useState([]); - const [editTagCart, setEditTagCart] = useState([]); - const [piorityFlagCart, setPiorityFlagCart] = useState([]) - useEffect(() => { - setUsers(userinfo); - setAllEditTags(editTagsData); - setAllPiorityFlag(piorityflagData) - - }, []); - // add---------selected------user - const handleUserCart = (addnew) => { - const newUsers = [...userCart, addnew]; - setUserCart(newUsers) - } - console.log(userCart); - // remove---------selected------user - const HandleRemoveUser = (id) => { - const afterRemoveUsers = userCart.filter(remo => remo.id !== id); - setUserCart(afterRemoveUsers) - } - //add--------selected-----tags +const TaskNameHeader = function () { + const [newUser, setNewUser] = useState(false); + const [editTags, setEditTags] = useState(false); + const [users, setUsers] = useState({}); + const [allEditTags, setAllEditTags] = useState({}); + const [piority, setPiority] = useState(false); + const [allPiorityFlag, setAllPiorityFlag] = useState({}); + const [userCart, setUserCart] = useState([]); + const [editTagCart, setEditTagCart] = useState([]); + const [piorityFlagCart, setPiorityFlagCart] = useState([]); + useEffect(() => { + setUsers(userinfo); + setAllEditTags(editTagsData); + setAllPiorityFlag(piorityflagData); + }, []); + // add---------selected------user + const handleUserCart = (addnew) => { + const newUsers = [...userCart, addnew]; + setUserCart(newUsers); + }; + console.log(userCart); - const handleEditTagsCat = (newtag) => { - const newEditTags = [...editTagCart, newtag]; - setEditTagCart(newEditTags); - // if (newtag.tagName === "bug") { + // remove---------selected------user + const HandleRemoveUser = (id) => { + const afterRemoveUsers = userCart.filter((remo) => remo.id !== id); + setUserCart(afterRemoveUsers); + }; + // add--------selected-----tags - // document.querySelector('.feature').style.backgroundColor = 'red'; - // } - console.log(newtag.tagName); - } - console.log(editTagCart); - // remove---------selected------editTag - const HandleRemoveEditTag = (id) => { - const afterRemoveEditTags = editTagCart.filter(remo => remo.id !== id); - setEditTagCart(afterRemoveEditTags) - } - //add--------selected-----piority----flag + const handleEditTagsCat = (newtag) => { + const newEditTags = [...editTagCart, newtag]; + setEditTagCart(newEditTags); + // if (newtag.tagName === "bug") { - const handlePiorityflagCart = (newFlag) => { - const newFlagCat = [...piorityFlagCart, newFlag] - setPiorityFlagCart(newFlagCat); - setPiority(!piority) - if (piorityFlagCart) { - alert("hello") - document.querySelector('#check').style.display = "none"; + // document.querySelector('.feature').style.backgroundColor = 'red'; + // } + console.log(newtag.tagName); + }; + console.log(editTagCart); + // remove---------selected------editTag + const HandleRemoveEditTag = (id) => { + const afterRemoveEditTags = editTagCart.filter((remo) => remo.id !== id); + setEditTagCart(afterRemoveEditTags); + }; + // add--------selected-----piority----flag - } - - } - console.log(piorityFlagCart); - // remove---------selected------Flag - const HandleRemoveFlag = (id) => { - const afterRemoveFlagCat = piorityFlagCart.filter(remo => remo.id !== id); - setPiorityFlagCart(afterRemoveFlagCat); - document.querySelector('#check').style.display = "inline-block"; + const handlePiorityflagCart = (newFlag) => { + const newFlagCat = [...piorityFlagCart, newFlag]; + setPiorityFlagCart(newFlagCat); + setPiority(!piority); + if (piorityFlagCart) { + alert('hello'); + document.querySelector('#check').style.display = 'none'; } - // Modal Functionality-------- - let subtitle; - const [modalIsOpen, setIsOpen] = useState(false); + }; + console.log(piorityFlagCart); + // remove---------selected------Flag + const HandleRemoveFlag = (id) => { + const afterRemoveFlagCat = piorityFlagCart.filter((remo) => remo.id !== id); + setPiorityFlagCart(afterRemoveFlagCat); + document.querySelector('#check').style.display = 'inline-block'; + }; + // Modal Functionality-------- + let subtitle; + const [modalIsOpen, setIsOpen] = useState(false); - function openModal() { - setIsOpen(true); - } - return ( -
-
-
-

In

-

Category

Sub Category

For

- user -
LA
- { - userCart.length && - userCart.map(u => (
+
+
+

In

+

Category

+ + {' '} +

Sub Category

+ {' '} +

For

+ user +
LA
+ { + userCart.length + && userCart.map((u) => ( +
HandleRemoveUser(u.id)} - data-tip={u.name}> + data-tip={u.name} + > -
)) +
+ )) } -
setNewUser(!newUser)} className="tw-cursor-pointer" /> - { - newUser && -
- - - - - - -
-
-
-
-

Task Name Here

-
- {/* ANOTHER PART----------- */} -
-
- -
Feature
-
Feature
- { - editTagCart.map(addtag =>
HandleRemoveEditTag(addtag.id)} className="feature tw-mt-3 tw-cursor-pointer">{addtag.tagName}
) +
+
+
+ + + + + + +
+
+
+
+

Task Name Here

+
+ {/* ANOTHER PART----------- */} +
+
+ +
Feature
+
Feature
+ { + editTagCart.map((addtag) =>
HandleRemoveEditTag(addtag.id)} className="feature tw-mt-3 tw-cursor-pointer">{addtag.tagName}
) } -
-
setEditTags(!editTags)} data-tip=" edit tags" className="tw-bg-indigo-400 tw-rounded-full tw-h-8 tw-flex tw-w-8 tw-items-center tw-justify-center tw-btn tw-cursor-pointer" > - - - - -
- { - editTags &&
- { - allEditTags.map(tag => -

handleEditTagsCat(tag)} className="tw-gap-x-3 tw-cursor-pointer tw-capitalize" >{tag.tagName}

+
-
- - - - - - -
- { - modalIsOpen && - - } - { - piorityFlagCart.map(flag =>
HandleRemoveFlag(flag.id)} className="tw-bg-indigo-400 tw-rounded-full tw-h-8 tw-flex tw-w-8 tw-items-center tw-justify-center tw-btn tw-cursor-pointer" data-tip={flag.flagName}> - - - - +
+
+ + + + + -
) +
+ { + modalIsOpen + && } - -
-
setPiority(!piority)} id="check" className="tw-bg-indigo-400 tw-rounded-full tw-h-8 tw-flex tw-w-8 tw-items-center tw-justify-center tw-btn tw-cursor-pointer" data-tip="set piority"> + { + piorityFlagCart.map((flag) => ( +
HandleRemoveFlag(flag.id)} className="tw-bg-indigo-400 tw-rounded-full tw-h-8 tw-flex tw-w-8 tw-items-center tw-justify-center tw-btn tw-cursor-pointer" data-tip={flag.flagName}> - + -
- { - piority &&
- { - allPiorityFlag.map(flag => handlePiorityflagCart(flag)}> +
+ )) + } - -
-
-

CREATED

-

Jun 11th, 3:00 pm

-
-
-

TIME TRACKED

-

-
- - - -
- 0:00:00

-
-
-

ESTIMATE

-

- - - - 15 h

-
-
-

START DATE

-

Jun 12

-
-
-

DUE DATE

-

Jun 15

-
- - - - - - -
-
+
+
+
+
+

CREATED

+

+ {' '} + Jun 11th, 3:00 pm +

+
+
+

TIME TRACKED

+

+
+ + + +
+ 0:00:00 +

+
+
+

ESTIMATE

+

+ + + + 15 h +

+
+
+

START DATE

+

+ {' '} + Jun 12 +

+
+
+

DUE DATE

+

+ {' '} + Jun 15 +

+
+ + + + + +
- ); +
+
+ ); }; export default TaskNameHeader; diff --git a/components/coreteam/TestTaskCard.js b/components/coreteam/TestTaskCard.js index de487913..4a78ec7b 100644 --- a/components/coreteam/TestTaskCard.js +++ b/components/coreteam/TestTaskCard.js @@ -1,123 +1,122 @@ -import React from 'react'; +import React, { useState, createContext } from 'react'; import ReactTooltip from 'react-tooltip'; -import { RiFlag2Fill } from "react-icons/ri"; -import { BsThreeDotsVertical } from "react-icons/bs"; -import { useState, createContext } from 'react'; -import userinfo from '../../components/coreteam/User.json'; -export const UserContext = createContext(); -const TestTaskCard = ({ item, handlePriority }) => { - // priority-----flag - const [open, setOpen] = useState(false); - const [priority, setPriority] = useState("gray"); - // for-----------user - const [newUser, setNewUser] = useState(false); - const [users, setUsers] = useState(userinfo); - const [userCart, setUserCart] = useState([]); - // add---------selected------user - const handleUserCart = (addnew) => { - const newUsers = [...userCart, addnew]; - setUserCart(newUsers) - } - console.log(userCart); +import { RiFlag2Fill } from 'react-icons/ri'; +import { BsThreeDotsVertical } from 'react-icons/bs'; +import userinfo from './User.json'; - // remove---------selected------user - const HandleRemoveUser = (id) => { - const afterRemoveUsers = userCart.filter(remo => remo.id !== id); - setUserCart(afterRemoveUsers) - } - return ( - -
+export const UserContext = createContext(); +const TestTaskCard = function ({ item, handlePriority }) { + // priority-----flag + const [open, setOpen] = useState(false); + const [priority, setPriority] = useState('gray'); + // for-----------user + const [newUser, setNewUser] = useState(false); + const [users, setUsers] = useState(userinfo); + const [userCart, setUserCart] = useState([]); + // add---------selected------user + const handleUserCart = (addnew) => { + const newUsers = [...userCart, addnew]; + setUserCart(newUsers); + }; + console.log(userCart); -
+ // remove---------selected------user + const HandleRemoveUser = (id) => { + const afterRemoveUsers = userCart.filter((remo) => remo.id !== id); + setUserCart(afterRemoveUsers); + }; + return ( + +
+
-

{item.Description}

+

{item.Description}

-
- user setNewUser(!newUser)} className="tw-h-6 tw-w-6 tw-block" /> - { - newUser && -
-
-
- setOpen(!open)} - /> - {open && ( -
- - handlePriority(setPriority("red"), setOpen(!open)) - } - /> - - handlePriority(setPriority("pink"), setOpen(!open)) - } - /> - - handlePriority(setPriority("yellow"), setOpen(!open)) - } - /> - - handlePriority(setPriority("gray"), setOpen(!open)) - } - /> -
- )} -
-

- {item.createdOn} -

-
-
-
-

Design

-

Develop

-
-
-

More Options

- - - -
-
+
+
+
+
+ setOpen(!open)} + /> + {open && ( +
+ handlePriority(setPriority('red'), setOpen(!open))} + /> + handlePriority(setPriority('pink'), setOpen(!open))} + /> + handlePriority(setPriority('yellow'), setOpen(!open))} + /> + handlePriority(setPriority('gray'), setOpen(!open))} + /> +
+ )} +
+

+ {item.createdOn} +

+
+
+
+

Design

+

Develop

+
+
+

More Options

+ +
+
-
- - ); +
+
+ ); }; -export default TestTaskCard; \ No newline at end of file +export default TestTaskCard; diff --git a/components/coreteam/ViewTask.js b/components/coreteam/ViewTask.js index 4a611b03..9c224ffe 100644 --- a/components/coreteam/ViewTask.js +++ b/components/coreteam/ViewTask.js @@ -1,20 +1,19 @@ -import React from "react"; -import { useEffect } from "react"; -import { useState } from "react"; +import React, { useEffect, useState } from 'react'; +import { RiFlag2Fill } from 'react-icons/ri'; +import { BsThreeDotsVertical } from 'react-icons/bs'; import coreteamInfo from './coreteamInfo.json'; -import { RiFlag2Fill } from "react-icons/ri"; -import { BsThreeDotsVertical } from "react-icons/bs"; -import TaskNotificationHeader from "../ProjectManager/TaskNotificationHeader"; -import TaskCard from "./TaskCard"; -const ViewTask = () => { - const [proposals, setProposals] = useState([]); +import TaskNotificationHeader from '../ProjectManager/TaskNotificationHeader'; +import TaskCard from './TaskCard'; - useEffect(() => { - setProposals(coreteamInfo); - }, []); - return ( -
- {/*
+const ViewTask = function () { + const [proposals, setProposals] = useState([]); + + useEffect(() => { + setProposals(coreteamInfo); + }, []); + return ( +
+ {/*
star

View Tasks

@@ -24,123 +23,123 @@ const ViewTask = () => { bg
*/} - {/* change------ */} -
-
- {/* star */} -

- - View Tasks -

-

- View, organize and access your tasks here. -

-
-
- bg -
-
+ {/* change------ */} +
+
+ {/* star */} +

+ + View Tasks +

+

+ View, organize and access your tasks here. +

+
+
+ bg +
+
- {/* Part----------one */} -
-
-
-

- - - + {/* Part----------one */} +

+
+
+

+ + + -

-

Planned Task

-
-
- {proposals.slice(0, 4).map((proposal) => ( - - ))} -
-
-
-
-

- - - -

-

In-Progress Tasks

-
-
- {proposals.slice(0, 3).map((proposal) => ( - - ))} -
-
-
-
-

- - - -

-

Ready for review tasks

-
-
- {proposals.slice(0, 4).map((proposal) => ( - - ))} -
+

+

Planned Task

+
+
+ {proposals.slice(0, 4).map((proposal) => ( + + ))} +
+
+
+
+

+ + + +

+

In-Progress Tasks

+
+
+ {proposals.slice(0, 3).map((proposal) => ( + + ))} +
+
+
+
+

+ + + +

+

Ready for review tasks

+
+
+ {proposals.slice(0, 4).map((proposal) => ( + + ))} +
-
-
- {/* part-------------two */} -
-
-
-

- - - -

-

In Review Tasks

-
-
- {proposals.slice(0, 4).map((proposal) => ( - - ))} -
-
-
-
-

- - - -

-

Revision Required Tasks

-
-
- {proposals.slice(0, 3).map((proposal) => ( - - ))} -
-
-
-
-

- - - -

-

Completed Tasks

-
-
- {proposals.slice(0, 4).map((proposal) => ( - - ))} -
-
-
-
- ); +
+
+ {/* part-------------two */} +
+
+
+

+ + + +

+

In Review Tasks

+
+
+ {proposals.slice(0, 4).map((proposal) => ( + + ))} +
+
+
+
+

+ + + +

+

Revision Required Tasks

+
+
+ {proposals.slice(0, 3).map((proposal) => ( + + ))} +
+
+
+
+

+ + + +

+

Completed Tasks

+
+
+ {proposals.slice(0, 4).map((proposal) => ( + + ))} +
+
+
+
+ ); }; export default ViewTask; diff --git a/components/defisummer.js b/components/defisummer.js index 855fa0a9..daeaa19b 100644 --- a/components/defisummer.js +++ b/components/defisummer.js @@ -1,13 +1,15 @@ -import { useEffect, useState } from "react"; -import classes from "../public/assets/css/defisummer.module.css"; +import { useEffect, useState } from 'react'; +import classes from '../public/assets/css/defisummer.module.css'; -const Defisummer = ({ navBarRef }) => { - let { day, month, date, startTime, endTime } = { - day: "Thursday", - month: "August", +const Defisummer = function ({ navBarRef }) { + const { + day, month, date, startTime, endTime, + } = { + day: 'Thursday', + month: 'August', date: 26, - startTime: "11am", - endTime: "4pm", + startTime: '11am', + endTime: '4pm', }; const [margin, setMargin] = useState(0); useEffect(() => { @@ -15,23 +17,21 @@ const Defisummer = ({ navBarRef }) => { setMargin(parseInt(window.getComputedStyle(navBarRef.current).height)); } }, [navBarRef]); - const keynotes = (big_header, small_header, time) => { - return ( -
-
-
{big_header}
-
{small_header}
-
-
-
{time}
-
EST
-
+ const keynotes = (big_header, small_header, time) => ( +
+
+
{big_header}
+
{small_header}
- ); - }; +
+
{time}
+
EST
+
+
+ ); return (
-
+
{ href="https://forms.gle/P9acazhZEzGh3apDA" target="_blank" referrerPolicy="no-referrer" + rel="noreferrer" > @@ -69,6 +70,7 @@ const Defisummer = ({ navBarRef }) => { href="https://forms.gle/P9acazhZEzGh3apDA" target="_blank" referrerPolicy="no-referrer" + rel="noreferrer" > @@ -77,6 +79,7 @@ const Defisummer = ({ navBarRef }) => { href="https://forms.gle/P9acazhZEzGh3apDA" target="_blank" referrerPolicy="no-referrer" + rel="noreferrer" > @@ -98,9 +101,9 @@ const Defisummer = ({ navBarRef }) => { {/* second section */}
-
+

[Panels]

-
+
@@ -127,25 +130,25 @@ const Defisummer = ({ navBarRef }) => { {/* third section */}
-
+

Keynotes

{keynotes( - "Future of Asset Management", - "w/ Founder of Enzyme, Finance Mona El Isa", - "3:00PM" + 'Future of Asset Management', + 'w/ Founder of Enzyme, Finance Mona El Isa', + '3:00PM', )} {keynotes( - "Future of Yield Maximizing", - "w/ Founder of Idle, Finance", - "3:20PM" + 'Future of Yield Maximizing', + 'w/ Founder of Idle, Finance', + '3:20PM', )} {keynotes( - "Future of Global Banking", - "w/ Founder of Steller Development Foundation", - "3:40PM" + 'Future of Global Banking', + 'w/ Founder of Steller Development Foundation', + '3:40PM', )}
@@ -180,7 +183,7 @@ const Defisummer = ({ navBarRef }) => {
-
+
); }; diff --git a/components/employers-page/home/Card/CandidateCard.js b/components/employers-page/home/Card/CandidateCard.js index 6cc10352..c50bcca6 100644 --- a/components/employers-page/home/Card/CandidateCard.js +++ b/components/employers-page/home/Card/CandidateCard.js @@ -1,6 +1,6 @@ -import styles from "./candidate_card.module.css"; +import styles from './candidate_card.module.css'; -const CandidateCard = ({ name, description, image }) => { +const CandidateCard = function ({ name, description, image }) { return (
@@ -11,7 +11,7 @@ const CandidateCard = ({ name, description, image }) => {
{name}
diff --git a/components/employers-page/home/Card/Card.js b/components/employers-page/home/Card/Card.js index 43da8738..2de5a3d2 100644 --- a/components/employers-page/home/Card/Card.js +++ b/components/employers-page/home/Card/Card.js @@ -1,16 +1,24 @@ -import styles from "./card.module.css"; +import styles from './card.module.css'; -const Card = ({ title, status, date, progress }) => { +const Card = function ({ + title, status, date, progress, +}) { return (

{title}

- Applied ({status}) + + Applied ( + {status} + ) +

- Posted: {date && date.substring(0, 10)} + Posted: + {' '} + {date && date.substring(0, 10)} {progress}
diff --git a/components/employers-page/home/Card/InterviewCard.js b/components/employers-page/home/Card/InterviewCard.js index 2dc3fab5..5c9fcf52 100644 --- a/components/employers-page/home/Card/InterviewCard.js +++ b/components/employers-page/home/Card/InterviewCard.js @@ -1,11 +1,13 @@ -import styles from "./interview_card.module.css"; +import styles from './interview_card.module.css'; -const InterviewCard = ({ date, time, name, description, image }) => { +const InterviewCard = function ({ + date, time, name, description, image, +}) { return (
- +

{name}

{description} diff --git a/components/employers-page/home/content/candidates/Candidates.js b/components/employers-page/home/content/candidates/Candidates.js index ad9b2372..f2021645 100644 --- a/components/employers-page/home/content/candidates/Candidates.js +++ b/components/employers-page/home/content/candidates/Candidates.js @@ -1,30 +1,30 @@ -import { useEffect, useState } from "react"; -import styles from "./candidate.module.css"; -import CandidateCard from "../../../home/Card/CandidateCard"; -import axios from "axios"; +import { useEffect, useState } from 'react'; +import axios from 'axios'; +import styles from './candidate.module.css'; +import CandidateCard from '../../Card/CandidateCard'; const candidate = [ - { name: "Michael Montgometry", description: "Front End Developer" }, - { name: "Michael Montgometry", description: "Front End Developer" }, - { name: "Michael Montgometry", description: "Front End Developer" }, - { name: "Michael Montgometry", description: "Front End Developer" } + { name: 'Michael Montgometry', description: 'Front End Developer' }, + { name: 'Michael Montgometry', description: 'Front End Developer' }, + { name: 'Michael Montgometry', description: 'Front End Developer' }, + { name: 'Michael Montgometry', description: 'Front End Developer' }, ]; -const Candidates = ({ load }) => { +const Candidates = function ({ load }) { const [candidates, setCandidates] = useState([]); useEffect(() => { - const userToken = window.localStorage.getItem("jwtToken"); + const userToken = window.localStorage.getItem('jwtToken'); if (userToken !== null) { axios .get( - "https://koinstreet-learn-api.herokuapp.com/api/v1/job/candidates", + 'https://koinstreet-learn-api.herokuapp.com/api/v1/job/candidates', { headers: { - Authorization: `Bearer ${userToken}` - } - } + Authorization: `Bearer ${userToken}`, + }, + }, ) - .then(res => setCandidates(res.data.data)); + .then((res) => setCandidates(res.data.data)); } }, []); diff --git a/components/employers-page/home/content/index.js b/components/employers-page/home/content/index.js index 93247832..5bc66e06 100644 --- a/components/employers-page/home/content/index.js +++ b/components/employers-page/home/content/index.js @@ -1,10 +1,10 @@ -import { useState } from "react"; -import styles from "./content.module.css"; -import Jobs from "./jobs/Jobs"; -import Candidates from "./candidates/Candidates"; -import Interview from "./interview/Interview"; +import { useState } from 'react'; +import styles from './content.module.css'; +import Jobs from './jobs/Jobs'; +import Candidates from './candidates/Candidates'; +import Interview from './interview/Interview'; -const EmployerContent = () => { +const EmployerContent = function () { const [load, setLoad] = useState(3); const loadmore = () => { diff --git a/components/employers-page/home/content/interview/Interview.js b/components/employers-page/home/content/interview/Interview.js index cf561d25..84d292d2 100644 --- a/components/employers-page/home/content/interview/Interview.js +++ b/components/employers-page/home/content/interview/Interview.js @@ -1,39 +1,43 @@ -import styles from "./candidate_interview.module.css"; -import InterviewCard from "../../Card/InterviewCard"; +import styles from './candidate_interview.module.css'; +import InterviewCard from '../../Card/InterviewCard'; const interviewItem = [ { - name: "Michael Montgometry", - description: "Front End Developer", - date: "Mon, August 9", - time: "11:30am EST" + name: 'Michael Montgometry', + description: 'Front End Developer', + date: 'Mon, August 9', + time: '11:30am EST', }, { - name: "Michael Montgometry", - description: "Front End Developer", - date: "Mon, August 9", - time: "11:30am EST" + name: 'Michael Montgometry', + description: 'Front End Developer', + date: 'Mon, August 9', + time: '11:30am EST', }, { - name: "Michael Montgometry", - description: "Front End Developer", - date: "Mon, August 9", - time: "11:30am EST" + name: 'Michael Montgometry', + description: 'Front End Developer', + date: 'Mon, August 9', + time: '11:30am EST', }, { - name: "Michael Montgometry", - description: "Front End Developer", - date: "Mon, August 9", - time: "11:30am EST" - } + name: 'Michael Montgometry', + description: 'Front End Developer', + date: 'Mon, August 9', + time: '11:30am EST', + }, ]; -const Interview = ({ scheduled }) => { +const Interview = function ({ scheduled }) { return (

Interview schedule

- ({scheduled}) scheduled + + ( + {scheduled} + ) scheduled +

diff --git a/components/employers-page/home/content/jobs/Jobs.js b/components/employers-page/home/content/jobs/Jobs.js index fcce2f2a..cc5c58b8 100644 --- a/components/employers-page/home/content/jobs/Jobs.js +++ b/components/employers-page/home/content/jobs/Jobs.js @@ -1,48 +1,48 @@ -import { useEffect, useState } from "react"; -import axios from "axios"; +import { useEffect, useState } from 'react'; +import axios from 'axios'; -import styles from "./jobs.module.css"; -import Card from "../../Card/Card"; +import styles from './jobs.module.css'; +import Card from '../../Card/Card'; const contents = [ { - title: "Front End Developer", - status: "21", - date: "4/12/2021", - progress: "in Progress" + title: 'Front End Developer', + status: '21', + date: '4/12/2021', + progress: 'in Progress', }, { - title: "Front End Developer", - status: "21", - date: "4/12/2021", - progress: "in Progress" + title: 'Front End Developer', + status: '21', + date: '4/12/2021', + progress: 'in Progress', }, { - title: "Front End Developer", - status: "21", - date: "4/12/2021", - progress: "in Progress" + title: 'Front End Developer', + status: '21', + date: '4/12/2021', + progress: 'in Progress', }, { - title: "Front End Developer", - status: "21", - date: "4/12/2021", - progress: "in Progress" - } + title: 'Front End Developer', + status: '21', + date: '4/12/2021', + progress: 'in Progress', + }, ]; -const Jobs = ({ load }) => { +const Jobs = function ({ load }) { const [jobs, setJobs] = useState([]); useEffect(() => { - const userToken = window.localStorage.getItem("jwtToken"); + const userToken = window.localStorage.getItem('jwtToken'); if (userToken !== null) { axios - .get("https://koinstreet-learn-api.herokuapp.com/api/v1/job/userJobs", { + .get('https://koinstreet-learn-api.herokuapp.com/api/v1/job/userJobs', { headers: { - Authorization: `Bearer ${userToken}` - } + Authorization: `Bearer ${userToken}`, + }, }) - .then(res => setJobs(res.data.data)); + .then((res) => setJobs(res.data.data)); } }, []); @@ -60,7 +60,7 @@ const Jobs = ({ load }) => { title={item.job_title} status={item.job_title.length} date={item.createdAt} - progress={"in Progress"} + progress="in Progress" />
)) diff --git a/components/employers-page/home/header/Header.js b/components/employers-page/home/header/Header.js index 802bfd76..5497aaa5 100644 --- a/components/employers-page/home/header/Header.js +++ b/components/employers-page/home/header/Header.js @@ -1,13 +1,13 @@ -import styles from "./header.module.css"; +import styles from './header.module.css'; -const Header = () => { +const Header = function () { return (

EMPLOYERS DASHBOARD

- +
diff --git a/components/employers-page/sidenav/index.js b/components/employers-page/sidenav/index.js index a19d9e53..27bf8ebd 100644 --- a/components/employers-page/sidenav/index.js +++ b/components/employers-page/sidenav/index.js @@ -1,32 +1,32 @@ -import React, { useState } from "react"; -import styles from "./sidenav.module.css"; -import Link from "next/link"; -import { useRouter } from "next/router"; +import React, { useState } from 'react'; +import Link from 'next/link'; +import { useRouter } from 'next/router'; +import styles from './sidenav.module.css'; const menu = [ { - title: "HOME", - path: "/careers/employers-page/dashboard", - class: "fas fa-home" + title: 'HOME', + path: '/careers/employers-page/dashboard', + class: 'fas fa-home', }, { - title: "JOBS", - path: "/careers/employers-page/employer-jobs", - class: "fas fa-suitcase" + title: 'JOBS', + path: '/careers/employers-page/employer-jobs', + class: 'fas fa-suitcase', }, { - title: "INBOX", - path: "/careers/employers-page/employer", - class: "fas fa-comment-alt" + title: 'INBOX', + path: '/careers/employers-page/employer', + class: 'fas fa-comment-alt', }, { - title: "CANDIDATES", - path: "/careers/employers-page/employer", - class: "fas fa-user-friends" - } + title: 'CANDIDATES', + path: '/careers/employers-page/employer', + class: 'fas fa-user-friends', + }, ]; -const Content = props => { +const Content = function (props) { const router = useRouter(); return (
@@ -34,8 +34,8 @@ const Content = props => { {menu.map((item, index) => ( diff --git a/components/events-proposal/events-card/events-card.jsx b/components/events-proposal/events-card/events-card.jsx index 44f6c9ed..85b28c50 100644 --- a/components/events-proposal/events-card/events-card.jsx +++ b/components/events-proposal/events-card/events-card.jsx @@ -1,14 +1,16 @@ -import styles from './events-card.module.css'; import Moment from 'moment'; import { useState } from 'react'; +import styles from './events-card.module.css'; import EventsPopup from '../events-popup/events-popup'; Moment.locale('en'); -const EventsCard = ({ pastEvent, event, token }) => { +const EventsCard = function ({ pastEvent, event, token }) { const [popup, togglePopup] = useState(false); - const { EventPicture, eventName, time, catName, host, eventStatus } = event; + const { + EventPicture, eventName, time, catName, host, eventStatus, + } = event; return (
@@ -34,21 +36,38 @@ const EventsCard = ({ pastEvent, event, token }) => {
{Moment(time).format('LL')}
{ eventStatus === 'pending' - ?
Host: {host && (host.firstName + " " + host.lastName)}
+ ? ( +
+ Host: + {host && (`${host.firstName} ${host.lastName}`)} +
+ ) :
{event.attendance}
} -
togglePopup(true)} className={styles.info}> More Info
+
togglePopup(true)} className={styles.info}> + {' '} + + {' '} + More Info +
{ eventStatus !== 'pending' - && + && (
-
Approved by: {'Shot'}
-
Date: {Moment(Date.now()).format('LL')}
+
+ Approved by: + Shot +
+
+ Date: + {Moment(Date.now()).format('LL')} +
+ ) }
- ) -} + ); +}; -export default EventsCard; \ No newline at end of file +export default EventsCard; diff --git a/components/events-proposal/events-component/events-component.jsx b/components/events-proposal/events-component/events-component.jsx index 362b9393..b71636ac 100644 --- a/components/events-proposal/events-component/events-component.jsx +++ b/components/events-proposal/events-component/events-component.jsx @@ -1,21 +1,21 @@ -import styles from './events-component.module.css'; import { useState, useEffect } from 'react'; +import axios from 'axios'; +import Select from 'react-select'; +import styles from './events-component.module.css'; import EventsOverview from '../events-overview/events-overview'; import EventsMenu from '../events-menu/events-menu'; -import axios from 'axios'; import MpaLoader from '../../mpa-loader/loader'; -import Select from "react-select"; -const Events = ({ token }) => { +const Events = function ({ token }) { const [status, setStatus] = useState(); - const [eventsCopy, setEventsCopy] = useState(null) + const [eventsCopy, setEventsCopy] = useState(null); const [events, setEvents] = useState(null); const [showOverview, setShow] = useState(true); const [value, setValue] = useState(''); const options = [ - { label: "Virtual Event", value: "Virtual Event" }, - { label: "In-person Event", value: "In-person Event" } + { label: 'Virtual Event', value: 'Virtual Event' }, + { label: 'In-person Event', value: 'In-person Event' }, ]; const selectStyles = { @@ -28,7 +28,7 @@ const Events = ({ token }) => { ...provided, padding: 0, height: 50, - minHeight: 50 + minHeight: 50, }), container: (provided) => ({ ...provided, @@ -43,12 +43,12 @@ const Events = ({ token }) => { ...provided, padding: 0, height: 50, - minHeight: 50 + minHeight: 50, }), valueContainer: (provided) => ({ ...provided, height: 50, - minHeight: 50 + minHeight: 50, }), control: (base, state) => ({ ...base, @@ -57,7 +57,7 @@ const Events = ({ token }) => { boxShadow: 'none', // no box-shadow padding: 0, height: 50, - minHeight: 50 + minHeight: 50, }), option: (provided, state) => ({ ...provided, @@ -68,64 +68,61 @@ const Events = ({ token }) => { cursor: 'pointer', padding: 10, }), - placeholder: base => ({ + placeholder: (base) => ({ ...base, fontSize: '1em', color: '#151371', fontWeight: 500, }), - indicatorSeparator: base => ({ + indicatorSeparator: (base) => ({ ...base, - display: "none", + display: 'none', }), - groupHeading: base => ({ + groupHeading: (base) => ({ ...base, fontSize: '1.02em', color: '#888', fontWeight: 700, }), - } + }; const fetchEvents = () => { axios.get('https://koinstreet-learn-api.herokuapp.com/api/v1/event') - .then(res => res.data.data) - .then(data => { setEvents(data); setEventsCopy(data) }) - .catch(err => { console.log(err) }) - } + .then((res) => res.data.data) + .then((data) => { setEvents(data); setEventsCopy(data); }) + .catch((err) => { console.log(err); }); + }; - const filter = (key, val) => { - return eventsCopy.filter(ev => ev[key] === val); - } + const filter = (key, val) => eventsCopy.filter((ev) => ev[key] === val); const onChangeInput = (obj) => { - setValue('') + setValue(''); if (obj) { - if (obj.value == 'Virtual Event') setEvents(filter("Virtual", true)) - if (obj.value == 'In-person Event') setEvents(filter("Virtual", false)) + if (obj.value == 'Virtual Event') setEvents(filter('Virtual', true)); + if (obj.value == 'In-person Event') setEvents(filter('Virtual', false)); } else { - setEvents(eventsCopy) + setEvents(eventsCopy); } - } + }; - const getSearch = e => { + const getSearch = (e) => { if (e.target.value) { - let searchValue = e.target.value - const newEvents = events.filter(event => event.eventName.toLowerCase().includes(searchValue.toLowerCase())) - setEvents(newEvents) + const searchValue = e.target.value; + const newEvents = events.filter((event) => event.eventName.toLowerCase().includes(searchValue.toLowerCase())); + setEvents(newEvents); } else { - fetchEvents() + fetchEvents(); } - } + }; - const handleChange = e => { - setValue(e.target.value) - getSearch(e) - } + const handleChange = (e) => { + setValue(e.target.value); + getSearch(e); + }; useEffect(() => { fetchEvents(); - }, []) - + }, []); return (
@@ -134,7 +131,7 @@ const Events = ({ token }) => {
Event Proposals
-
+
@@ -146,18 +143,18 @@ const Events = ({ token }) => { onChange={handleChange} placeholder="What event are you looking for?" /> -
+
-
- -
- -
- - -
- -
- - -
- -
- - -
- -
- -
-
LinkedIn*
- -
- - -
- Facebook - -
- -
- Twitter - -
- -
-
- -
- -
- - - - -
-
-
-