Skip to content

Commit

Permalink
feat: adding new contract
Browse files Browse the repository at this point in the history
  • Loading branch information
wellitongervickas committed Nov 28, 2023
1 parent 403bf0b commit 2c395b8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
22 changes: 16 additions & 6 deletions app/[locale]/apps/components/list/List.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
'use client'

import { Children, HTMLProps } from 'react'
import ListItem from './ListItem'
import { IHubAppAddeds } from '@/app/headless/thegraph/entities/app/types'
import { useI18n } from '@/locales/client'

export type ListProps = HTMLProps<HTMLUListElement> & {
apps: IHubAppAddeds[]
}

export const List = ({ apps, ...props }: ListProps) => {
const t = useI18n()
return (
<ul className='grid grid-cols-4 gap-6' {...props}>
{Children.toArray(
apps.map((app) => (
<li className='col-span-4 sm:col-span-2 lg:col-span-1'>
<ListItem app={app} />
</li>
))
{apps.length === 0 ? (
<li>{t('FEEDBACK.NO_APPS_FOUND')}</li>
) : (
<>
{Children.toArray(
apps.map((app) => (
<li className='col-span-4 sm:col-span-2 lg:col-span-1'>
<ListItem app={app} />
</li>
))
)}
</>
)}
</ul>
)
Expand Down
3 changes: 2 additions & 1 deletion locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ const en = {
}
},
FEEDBACK: {
NOT_ALLOWED: 'Not allowed'
NOT_ALLOWED: 'Not allowed',
NO_APPS_FOUND: 'No apps found'
},
LANGUAGE: {
TITLE: 'Language'
Expand Down
3 changes: 2 additions & 1 deletion locales/pt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ const pt = {
}
},
FEEDBACK: {
NOT_ALLOWED: 'Não permitido'
NOT_ALLOWED: 'Não permitido',
NO_APPS_FOUND: 'Nenhum app encontrado'
},
LANGUAGE: {
TITLE: 'Idioma'
Expand Down

0 comments on commit 2c395b8

Please sign in to comment.