diff --git a/apps/design-system/src/components/Atoms/Address/Address.stories.tsx b/apps/design-system/src/components/Molecules/Address/Address.stories.tsx similarity index 94% rename from apps/design-system/src/components/Atoms/Address/Address.stories.tsx rename to apps/design-system/src/components/Molecules/Address/Address.stories.tsx index d64351be..940e70cd 100644 --- a/apps/design-system/src/components/Atoms/Address/Address.stories.tsx +++ b/apps/design-system/src/components/Molecules/Address/Address.stories.tsx @@ -4,7 +4,7 @@ import Address from './Address' export default { component: Address, - title: 'Components/Address', + title: 'Molecules/Address', } as Meta const Template: Story = ({ street, city, postalCode, country, phone, email }) => ( diff --git a/apps/design-system/src/components/Atoms/Address/Address.tsx b/apps/design-system/src/components/Molecules/Address/Address.tsx similarity index 100% rename from apps/design-system/src/components/Atoms/Address/Address.tsx rename to apps/design-system/src/components/Molecules/Address/Address.tsx diff --git a/apps/design-system/src/components/Atoms/Address/Address.ui.test.tsx b/apps/design-system/src/components/Molecules/Address/Address.ui.test.tsx similarity index 92% rename from apps/design-system/src/components/Atoms/Address/Address.ui.test.tsx rename to apps/design-system/src/components/Molecules/Address/Address.ui.test.tsx index 6a5bdb06..42fae1ab 100644 --- a/apps/design-system/src/components/Atoms/Address/Address.ui.test.tsx +++ b/apps/design-system/src/components/Molecules/Address/Address.ui.test.tsx @@ -2,7 +2,7 @@ import { render, screen } from '@testing-library/react' import Address from './Address' -describe('compoments/Atoms/Address', () => { +describe('compoments/Molecules/Address', () => { it('should render Address', () => { // when ... rendering component const street = 'STREET' diff --git a/apps/design-system/src/components/Atoms/Address/index.ts b/apps/design-system/src/components/Molecules/Address/index.ts similarity index 100% rename from apps/design-system/src/components/Atoms/Address/index.ts rename to apps/design-system/src/components/Molecules/Address/index.ts diff --git a/apps/design-system/src/components/Atoms/MemberProfileCard/MemberProfileCard.stories.tsx b/apps/design-system/src/components/Molecules/MemberProfileCard/MemberProfileCard.stories.tsx similarity index 90% rename from apps/design-system/src/components/Atoms/MemberProfileCard/MemberProfileCard.stories.tsx rename to apps/design-system/src/components/Molecules/MemberProfileCard/MemberProfileCard.stories.tsx index 7079e286..b4bf6007 100644 --- a/apps/design-system/src/components/Atoms/MemberProfileCard/MemberProfileCard.stories.tsx +++ b/apps/design-system/src/components/Molecules/MemberProfileCard/MemberProfileCard.stories.tsx @@ -1,11 +1,11 @@ import { Meta, Story } from '@storybook/react' -import Pill from '../Pill/Pill' +import Pill from '../../Atoms/Pill/Pill' import MemberProfileCard from './MemberProfileCard' export default { component: MemberProfileCard, - title: 'Components/MemberProfileCard', + title: 'Molecules/MemberProfileCard', } as Meta const Template: Story = ({ title, logoUri, street, city, postalCode, country }) => ( diff --git a/apps/design-system/src/components/Atoms/MemberProfileCard/MemberProfileCard.tsx b/apps/design-system/src/components/Molecules/MemberProfileCard/MemberProfileCard.tsx similarity index 100% rename from apps/design-system/src/components/Atoms/MemberProfileCard/MemberProfileCard.tsx rename to apps/design-system/src/components/Molecules/MemberProfileCard/MemberProfileCard.tsx diff --git a/apps/design-system/src/components/Atoms/MemberProfileCard/MemberProfileCard.ui.test.tsx b/apps/design-system/src/components/Molecules/MemberProfileCard/MemberProfileCard.ui.test.tsx similarity index 90% rename from apps/design-system/src/components/Atoms/MemberProfileCard/MemberProfileCard.ui.test.tsx rename to apps/design-system/src/components/Molecules/MemberProfileCard/MemberProfileCard.ui.test.tsx index a4c1e941..8293c360 100644 --- a/apps/design-system/src/components/Atoms/MemberProfileCard/MemberProfileCard.ui.test.tsx +++ b/apps/design-system/src/components/Molecules/MemberProfileCard/MemberProfileCard.ui.test.tsx @@ -1,10 +1,10 @@ import { render, screen } from '@testing-library/react' import React from 'react' -import Pill from '../Pill/Pill' +import Pill from '../../Atoms/Pill/Pill' import MemberProfileCard from './MemberProfileCard' -describe('compoments/Atoms/MemberProfileCard', () => { +describe('compoments/Molecules/MemberProfileCard', () => { it('should render a Member Card with the title', () => { // when ... rendering component const title = 'TITLE' diff --git a/apps/design-system/src/components/Atoms/MemberProfileCard/index.ts b/apps/design-system/src/components/Molecules/MemberProfileCard/index.ts similarity index 100% rename from apps/design-system/src/components/Atoms/MemberProfileCard/index.ts rename to apps/design-system/src/components/Molecules/MemberProfileCard/index.ts diff --git a/apps/design-system/src/index.ts b/apps/design-system/src/index.ts index c75dddcd..710c7824 100644 --- a/apps/design-system/src/index.ts +++ b/apps/design-system/src/index.ts @@ -1,4 +1,4 @@ -export { Address } from './components/Atoms/Address' +export { Address } from './components/Molecules/Address' export { Button } from './components/Atoms/Button' export { Card } from './components/Atoms/Card' export { ContactPerson } from './components/Atoms/ContactPerson' @@ -8,7 +8,7 @@ export { Grid, GridRow } from './components/Atoms/Grid' export { Heading } from './components/Atoms/Heading' export { HeadingWithTooltip } from './components/Atoms/HeadingWithTooltip' export { LoadingIndicator } from './components/Atoms/LoadingIndicator' -export { MemberProfileCard } from './components/Atoms/MemberProfileCard' +export { MemberProfileCard } from './components/Molecules/MemberProfileCard' export { Nav, NavItem } from './components/Atoms/Nav' export { Pill } from './components/Atoms/Pill' export { Table, TableBody, TableCell, TableFooter, TableHeader, TableRow } from './components/Atoms/Table' diff --git a/apps/envited.ascs.digital/app/members/[slug]/page.tsx b/apps/envited.ascs.digital/app/members/[slug]/page.tsx index 54780121..eae4618d 100644 --- a/apps/envited.ascs.digital/app/members/[slug]/page.tsx +++ b/apps/envited.ascs.digital/app/members/[slug]/page.tsx @@ -1,5 +1,3 @@ -import { prop, propOr } from 'ramda' - import { getProfile } from '../../../common/serverActions' import { Header } from '../../../modules/Header' import { Member } from '../../../modules/Member' @@ -12,22 +10,7 @@ export default async function Index({ params: { slug } }: { params: { slug: stri
- +
diff --git a/apps/envited.ascs.digital/modules/Member/Member.tsx b/apps/envited.ascs.digital/modules/Member/Member.tsx index 0ce7e8d1..f2d2600a 100644 --- a/apps/envited.ascs.digital/modules/Member/Member.tsx +++ b/apps/envited.ascs.digital/modules/Member/Member.tsx @@ -1,44 +1,16 @@ 'use client' import { Address, Card, ContactPerson, Heading, Pill } from '@envited-marketplace/design-system' -import { isNil, map } from 'ramda' +import { has, isNil, map, propOr } from 'ramda' import React, { FC } from 'react' import { useTranslation } from '../../common/i18n' +import { Profile } from '../../common/types' interface MemberProps { - name: string - description: string - logo: string - website: string - streetAddress: string - addressCountry: string - addressLocality: string - postalCode: string - salesEmail: string | null - salesName: string | null - salesPhone: string | null - principalEmail: string | null - principalName: string | null - principalPhone: string | null + member: Profile } - -export const Member: FC = ({ - name, - description, - logo, - website, - streetAddress, - addressCountry, - addressLocality, - postalCode, - salesEmail, - salesName, - salesPhone, - principalEmail, - principalName, - principalPhone, -}) => { +export const Member: FC = ({ member }) => { const { t } = useTranslation('Member') return ( @@ -46,7 +18,7 @@ export const Member: FC = ({
{t('[Heading] member profile')} - {name} + {propOr('', 'name')(member)}
{t('[Heading] business categories')}
@@ -55,37 +27,53 @@ export const Member: FC = ({
{t('[Heading] about us')} -
{description}
+
{propOr('', 'description')(member)}
- {!isNil(logo) && {name}} + {!isNil(propOr('', 'logo')(member)) && ( + {propOr('', + )} {t('[Heading] address')}
- {principalName && principalEmail && principalPhone && ( + {has('principalName')(member) && has('principalEmail')(member) && has('principalPhone')(member) && ( {t('[Heading] principal contact')}
- +
)} - {salesName && salesEmail && salesPhone && ( + {has('salesName')(member) && has('salesEmail')(member) && has('salesPhone')(member) && ( {t('[Heading] sales contact')}
- +
)}