Skip to content

Commit

Permalink
feat: merge develop into 32_add_is_published
Browse files Browse the repository at this point in the history
Signed-off-by: Roy Scheeren <[email protected]>
  • Loading branch information
royscheeren committed Jan 29, 2024
2 parents d2d5970 + d4a6e05 commit 9d84140
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
12 changes: 7 additions & 5 deletions apps/envited.ascs.digital/app/dashboard/users/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { Users } from '../../../modules/Users'

export default async function Index() {
const USERS_MAP = [{
name: 'John Johnson',
email: '[email protected]',
id: 'did:pkh:tz:tz1SfdVU1mor3Sgej3FmmwMH4HM1EjTzqqeE',
}]
const USERS_MAP = [
{
name: 'John Johnson',
email: '[email protected]',
id: 'did:pkh:tz:tz1SfdVU1mor3Sgej3FmmwMH4HM1EjTzqqeE',
},
]

return <Users users={USERS_MAP} />
}
6 changes: 5 additions & 1 deletion apps/envited.ascs.digital/common/i18n/useI18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import { Locale, TranslationsMap } from './types'
const getTranslationsForLanguage = (namespace: string) => (locale: Locale) => pathOr({}, [locale, namespace])

const mergeTranslations = reduce(mergeDeepRight, { [Locale.en_GB]: {}, [Locale.de_DE]: {} })
const translationObject = mergeTranslations([HeaderTranslation, HeroHeaderTranslation, UsersTranslation]) as TranslationsMap
const translationObject = mergeTranslations([
HeaderTranslation,
HeroHeaderTranslation,
UsersTranslation,
]) as TranslationsMap

export const translation = (translations: TranslationsMap) => (namespace: string) => {
const t = (key: string): React.ReactElement =>
Expand Down
12 changes: 7 additions & 5 deletions apps/envited.ascs.digital/modules/Users/Users.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import { Users } from './Users'

describe('Users', () => {
it('should render successfully', () => {
const USERS_MAP = [{
name: 'John Johnson',
email: '[email protected]',
id: 'did:pkh:tz:tz1SfdVU1mor3Sgej3FmmwMH4HM1EjTzqqeE',
}]
const USERS_MAP = [
{
name: 'John Johnson',
email: '[email protected]',
id: 'did:pkh:tz:tz1SfdVU1mor3Sgej3FmmwMH4HM1EjTzqqeE',
},
]

const { baseElement } = render(<Users users={USERS_MAP} />)
expect(baseElement).toBeTruthy()
Expand Down
6 changes: 3 additions & 3 deletions apps/envited.ascs.digital/modules/Users/Users.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use client'

import { Card, Heading, Table, TableBody, TableCell, TableHeader, TableRow } from '@envited-marketplace/design-system'
import { map } from 'ramda'
import React, { FC } from 'react'

import { useTranslation } from '../../common/i18n'
import { User } from '../../common/types/types'
import { map } from 'ramda'

interface UsersProps {
users: Partial<User>[]
Expand All @@ -31,13 +31,13 @@ export const Users: FC<UsersProps> = ({ users }) => {
</TableRow>
</TableHeader>
<TableBody>
{map(({id, name, email }: Partial<User>) =>
{map(({ id, name, email }: Partial<User>) => (
<TableRow key={id}>
<TableCell>{id}</TableCell>
<TableCell>{name}</TableCell>
<TableCell>{email}</TableCell>
</TableRow>
)(users)}
))(users)}
</TableBody>
</Table>
</Card>
Expand Down

0 comments on commit 9d84140

Please sign in to comment.