diff --git a/src/pages/community/profiles/[id].tsx b/src/pages/community/profiles/[id].tsx index 40c27d06f2d7..8d7926de1584 100644 --- a/src/pages/community/profiles/[id].tsx +++ b/src/pages/community/profiles/[id].tsx @@ -733,11 +733,11 @@ const LikedPosts = ({ profileID }) => { ) } -const Block = ({ title, children, url }) => { +const Block = ({ title, children, url, className }) => { return (
@@ -1381,54 +1381,48 @@ export default function ProfilePage({ params }: PageProps) { errors={errors} setFieldValue={setFieldValue} /> -
- {profile.teams?.data?.length > 0 && - profile.teams.data[0].attributes.profiles?.data?.length > 0 && ( - -
- {team.attributes.profiles.data - .filter((teammate) => teammate.id !== data?.id) - .map((teammate) => { - return ( - - leadID === teammate.id - )} - /> - - ) - })} -
-
- )} -
+ {profile?.teams?.data?.length === 1 ? ( + // Single team - use Block (OSFieldset) +
+ +
+ +
+
+
+ ) : profile?.teams?.data?.length > 1 ? ( + // Multiple teams - use OSTabs +
+ ({ + value: team.attributes.slug, + label: <>{team.attributes.name} Team, + content: ( +
+
+ + {team.attributes.name} Team + + +
+ +
+ ), + }))} + defaultValue={profile.teams.data[0].attributes.slug} + triggerDataScheme="primary" + /> +
+ ) : null} + {profile.amaEnabled && (
@@ -1451,6 +1445,43 @@ export default function ProfilePage({ params }: PageProps) { ) } +const TeamMembersList = ({ self, team }) => { + const selfTeammate = team.attributes.profiles.data.find((teammate) => teammate.id === self.id) + const otherTeammates = team.attributes.profiles.data.filter((teammate) => teammate.id !== self.id) + const teammates = [selfTeammate, ...otherTeammates].filter(Boolean) + + return ( + <> + {teammates.map((teammate) => { + return ( + + leadID === teammate.id + )} + /> + + ) + })} + + ) +} + const Achievement = ({ title, description, image, icon, id, mutate, profile, ...other }) => { const { user, getJwt } = useUser() const [hidden, setHidden] = useState(other.hidden)