Skip to content

Commit

Permalink
Add labels to the table
Browse files Browse the repository at this point in the history
  • Loading branch information
vhande committed Nov 21, 2024
1 parent df8aefa commit b75ec72
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions src/pages/organizers/[organizerId]/preview/OrganizerTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import {
} from '@/utils/formatOrganizerDetail';
import { getLanguageObjectOrFallback } from '@/utils/getLanguageObjectOrFallback';

import { OrganizerLabels } from './OrganizerLabels';

type Props = { organizer: Organizer };

const getGlobalValue = getValueFromTheme('global');
Expand Down Expand Up @@ -123,14 +125,6 @@ export const OrganizerTable = ({ organizer }: Props) => {
);
}

const renderLabels = (title: string, labels: Organizer['hiddenLabels']) => {
<Inline padding={3}>
<Text minWidth="15rem" color={udbMainDarkGrey}>
{t(title)}
</Text>
</Inline>;
};

return (
<Inline padding={3}>
<Text minWidth="15rem" color={udbMainDarkGrey}>
Expand Down Expand Up @@ -191,6 +185,22 @@ export const OrganizerTable = ({ organizer }: Props) => {
);
};

const renderOrganizerLabels = (title: string, organizer: Organizer) => {
return (
<Inline
padding={3}
css={`
border-bottom: 1px solid ${grey2};
`}
>
<Text minWidth="15rem" color={udbMainDarkGrey}>
{t(title)}
</Text>
<OrganizerLabels organizer={organizer} />
</Inline>
);
};

return (
<Stack
flex={1}
Expand Down Expand Up @@ -219,6 +229,7 @@ export const OrganizerTable = ({ organizer }: Props) => {
formattedEmailAndPhone,
organizer?.contactPoint?.url,
)}
{renderOrganizerLabels('organizers.detail.labels', organizer)}
{renderOrganizerImages('organizers.detail.images', organizer?.images)}
</Stack>
);
Expand Down

0 comments on commit b75ec72

Please sign in to comment.