diff --git a/src/features/Profiles/pages/EditProfilePage/RolesSkillsTab/RolesSkillsTab.tsx b/src/features/Profiles/pages/EditProfilePage/RolesSkillsTab/RolesSkillsTab.tsx index b60c2bb..6234bcc 100644 --- a/src/features/Profiles/pages/EditProfilePage/RolesSkillsTab/RolesSkillsTab.tsx +++ b/src/features/Profiles/pages/EditProfilePage/RolesSkillsTab/RolesSkillsTab.tsx @@ -6,7 +6,7 @@ import { Controller, SubmitHandler, useForm } from 'react-hook-form'; import SaveChangesCard from '../SaveChangesCard/SaveChangesCard'; import { toast } from 'react-toastify'; import { NotificationsService } from 'src/services'; -import { gql, NetworkStatus, useApolloClient } from '@apollo/client'; +import { NetworkStatus, useApolloClient } from '@apollo/client'; import { usePrompt } from 'src/utils/hooks'; import { UpdateUserRolesSkillsMutationVariables, useMyProfileRolesSkillsQuery, useUpdateUserRolesSkillsMutation, UserRolesSkillsFragmentDoc } from 'src/graphql' import UpdateRolesCard from "./UpdateRolesCard/UpdateRolesCard"; diff --git a/src/features/Profiles/pages/EditProfilePage/RolesSkillsTab/UpdateRolesCard/UpdateRolesCard.tsx b/src/features/Profiles/pages/EditProfilePage/RolesSkillsTab/UpdateRolesCard/UpdateRolesCard.tsx index 1b15db3..e09d904 100644 --- a/src/features/Profiles/pages/EditProfilePage/RolesSkillsTab/UpdateRolesCard/UpdateRolesCard.tsx +++ b/src/features/Profiles/pages/EditProfilePage/RolesSkillsTab/UpdateRolesCard/UpdateRolesCard.tsx @@ -1,8 +1,6 @@ import React from 'react' -import { Control, useFieldArray } from 'react-hook-form' import Card from 'src/Components/Card/Card' import { GenericMakerRole, MakerRole, RoleLevelEnum } from 'src/graphql' -import { IRolesSkillsForm } from '../RolesSkillsTab' type Value = Pick diff --git a/src/features/Profiles/pages/ProfilePage/TournamentsCard/TournamentsCard.tsx b/src/features/Profiles/pages/ProfilePage/TournamentsCard/TournamentsCard.tsx index ef96f2e..1bf1cfc 100644 --- a/src/features/Profiles/pages/ProfilePage/TournamentsCard/TournamentsCard.tsx +++ b/src/features/Profiles/pages/ProfilePage/TournamentsCard/TournamentsCard.tsx @@ -1,6 +1,5 @@ import Card from 'src/Components/Card/Card' -import Button from 'src/Components/Button/Button' -import { RoleLevelEnum, User } from 'src/graphql'; +import { User } from 'src/graphql'; diff --git a/src/features/Tournaments/pages/MakersPage/ConnectToMakerModal/ConnectToMakerModal.tsx b/src/features/Tournaments/pages/MakersPage/ConnectToMakerModal/ConnectToMakerModal.tsx index 16e58eb..14e802a 100644 --- a/src/features/Tournaments/pages/MakersPage/ConnectToMakerModal/ConnectToMakerModal.tsx +++ b/src/features/Tournaments/pages/MakersPage/ConnectToMakerModal/ConnectToMakerModal.tsx @@ -1,6 +1,6 @@ import { motion } from 'framer-motion' import { ModalCard, modalCardVariants } from 'src/Components/Modals/ModalsContainer/ModalsContainer' -import { FiGithub, FiLinkedin, FiTwitter } from "react-icons/fi"; +import { FiGithub, FiLinkedin, FiMail, FiTwitter } from "react-icons/fi"; import { IoClose } from 'react-icons/io5'; import { GetMakersInTournamentQuery } from 'src/graphql'; import Avatar from 'src/features/Profiles/Components/Avatar/Avatar'; @@ -15,25 +15,28 @@ export default function LinkingAccountModal({ onClose, direction, maker, ...prop const links = [ + { + hasValue: maker.email, + text: maker.email, + icon: FiMail, + url: maker.email && `mailto:${maker.email}` + }, { hasValue: maker.twitter, text: maker.twitter, icon: FiTwitter, - colors: "bg-blue-100 text-blue-500", url: `https://twitter.com/@${maker.twitter}` }, { hasValue: maker.github, text: maker.github, icon: FiGithub, - colors: "bg-pink-100 text-pink-600", url: `https://github.com/${maker.github}` }, { hasValue: maker.linkedin, text: "LinkedIn", icon: FiLinkedin, - colors: "bg-sky-100 text-cyan-600", url: maker.linkedin && withHttp(maker.linkedin), } ]; @@ -66,7 +69,7 @@ export default function LinkingAccountModal({ onClose, direction, maker, ...prop diff --git a/src/features/Tournaments/pages/MakersPage/MakerCard/MakerCard.tsx b/src/features/Tournaments/pages/MakersPage/MakerCard/MakerCard.tsx index 5fce987..013d14e 100644 --- a/src/features/Tournaments/pages/MakersPage/MakerCard/MakerCard.tsx +++ b/src/features/Tournaments/pages/MakersPage/MakerCard/MakerCard.tsx @@ -18,10 +18,12 @@ export default function MakerCard({ maker, isMe }: Props) { const dispatch = useAppDispatch(); + const contactLinksAvailable = maker.github || maker.email || maker.linkedin || maker.twitter; + let actionBtn = if (isMe) actionBtn = ; - else actionBtn = + else if (contactLinksAvailable) actionBtn = return ( diff --git a/src/features/Tournaments/pages/MakersPage/ParticipantsSection/MakersList.tsx b/src/features/Tournaments/pages/MakersPage/ParticipantsSection/MakersList.tsx index bb281b4..e59d470 100644 --- a/src/features/Tournaments/pages/MakersPage/ParticipantsSection/MakersList.tsx +++ b/src/features/Tournaments/pages/MakersPage/ParticipantsSection/MakersList.tsx @@ -9,9 +9,10 @@ interface Props { tournamentId: number searchFilter: string, roleFilter: number | null + onlyLookingToTeam?: boolean } -const ITEMS_PER_PAGE = 3; +const ITEMS_PER_PAGE = 15; export default function MakersList(props: Props) { diff --git a/src/features/Tournaments/pages/MakersPage/ParticipantsSection/ParticipantsSection.tsx b/src/features/Tournaments/pages/MakersPage/ParticipantsSection/ParticipantsSection.tsx index f00f83e..3ef5805 100644 --- a/src/features/Tournaments/pages/MakersPage/ParticipantsSection/ParticipantsSection.tsx +++ b/src/features/Tournaments/pages/MakersPage/ParticipantsSection/ParticipantsSection.tsx @@ -1,6 +1,7 @@ import { useDebouncedState } from '@react-hookz/web'; import { useState } from 'react' import { GenericMakerRole } from 'src/graphql' +import { useCarousel } from 'src/utils/hooks'; import MakersFilters from '../MakersFilters/MakersFilters'; import MakersList from './MakersList'; import ProjectsList from './ProjectsList'; @@ -13,9 +14,13 @@ export default function ParticipantsSection({ tournamentId }: Props) { const [searchFilter, setSearchFilter] = useState(""); const [debouncedsearchFilter, setDebouncedSearchFilter] = useDebouncedState("", 500); const [roleFilter, setRoleFilter] = useState(null); - const [curTab, setCurTab] = useState<'makers' | 'projects'>('makers') + const [curTab, setCurTab] = useState<'all-makers' | 'makers-to-team' | 'projects'>('all-makers') + const { viewportRef, } = useCarousel({ + align: 'start', slidesToScroll: 1, + containScroll: "trimSnaps", + }) const changeSearchFilter = (new_value: string) => { setSearchFilter(new_value); @@ -37,30 +42,42 @@ export default function ParticipantsSection({ tournamentId }: Props) { /> -
- - + + + onClick={() => setCurTab('projects')} + > + Projects looking for makers + +
{curTab === 'projects' && } - {curTab === 'makers' && } + {curTab !== 'projects' && } ) } diff --git a/src/features/Tournaments/pages/MakersPage/ParticipantsSection/ProjectsList.tsx b/src/features/Tournaments/pages/MakersPage/ParticipantsSection/ProjectsList.tsx index db5fd93..b46da09 100644 --- a/src/features/Tournaments/pages/MakersPage/ParticipantsSection/ProjectsList.tsx +++ b/src/features/Tournaments/pages/MakersPage/ParticipantsSection/ProjectsList.tsx @@ -11,7 +11,7 @@ interface Props { roleFilter: number | null } -const ITEMS_PER_PAGE = 3; +const ITEMS_PER_PAGE = 15; export default function ProjectsList(props: Props) {