Skip to content

Commit

Permalink
feat: set map pins to have profile link
Browse files Browse the repository at this point in the history
  • Loading branch information
benfurber committed Sep 26, 2024
1 parent fb11cc4 commit c6c37cb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import type { IProfileCreator } from 'oa-shared'

interface IProps {
creator: IProfileCreator
isLink: boolean
}

export const CardDetailsMemberProfile = ({ creator }: IProps) => {
export const CardDetailsMemberProfile = ({ creator, isLink }: IProps) => {
const { _id, badges, countryCode, profileType, userImage } = creator

return (
Expand Down Expand Up @@ -55,7 +56,7 @@ export const CardDetailsMemberProfile = ({ creator }: IProps) => {
isVerified: badges?.verified || false,
}}
sx={{ alignSelf: 'flex-start' }}
isLink={false}
isLink={isLink}
/>
<Category
category={{ label: 'Wants to get started' }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import type { IProfileCreator } from 'oa-shared'

interface IProps {
creator: IProfileCreator
isLink: boolean
}

export const CardDetailsSpaceProfile = ({ creator }: IProps) => {
export const CardDetailsSpaceProfile = ({ creator, isLink }: IProps) => {
const { _id, about, badges, countryCode, coverImage, profileType, subType } =
creator

Expand Down Expand Up @@ -68,7 +69,7 @@ export const CardDetailsSpaceProfile = ({ creator }: IProps) => {
isSupporter: badges?.supporter || false,
}}
sx={{ alignSelf: 'flex-start' }}
isLink={false}
isLink={isLink}
/>
</Flex>
{subType && (
Expand Down
11 changes: 8 additions & 3 deletions packages/components/src/CardProfile/CardProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,22 @@ import type { MapListItem } from '../types/common'

export interface IProps {
item: MapListItem
isLink?: boolean
}

export const CardProfile = ({ item }: IProps) => {
export const CardProfile = ({ item, isLink = false }: IProps) => {
const { creator } = item

const isMember = creator?.profileType === 'member'

return (
<Flex sx={{ alignItems: 'stretch', alignContent: 'stretch' }}>
{isMember && <CardDetailsMemberProfile creator={creator} />}
{!isMember && creator && <CardDetailsSpaceProfile creator={creator} />}
{isMember && (
<CardDetailsMemberProfile creator={creator} isLink={isLink} />
)}
{!isMember && creator && (
<CardDetailsSpaceProfile creator={creator} isLink={isLink} />
)}
{!creator && <CardDetailsFallback item={item} />}
</Flex>
)
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/PinProfile/PinProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const PinProfile = (props: IProps) => {
</Box>
</Box>

<CardProfile item={item} />
<CardProfile item={item} isLink />

{!isMember && creator?.isContactableByPublic && (
<Flex sx={{ justifyContent: 'flex-end' }}>
Expand Down

0 comments on commit c6c37cb

Please sign in to comment.