cleanup
This commit is contained in:
parent
9997fc528a
commit
e6cfde4f18
5 changed files with 29 additions and 15 deletions
|
@ -3,9 +3,12 @@ import DesignIcon from 'shared/components/icons/design'
|
|||
import { useTranslation } from 'next-i18next'
|
||||
import {Picker, PickerLink} from 'shared/components/picker'
|
||||
|
||||
|
||||
const PatternPicker = ({ app }) => {
|
||||
const { t } = useTranslation(['common'])
|
||||
|
||||
const sectionPatterns = (section) => Object.keys(app.navigation[section]).filter((p)=>!p.startsWith('__'))
|
||||
|
||||
const pickerProps = {
|
||||
Icon: DesignIcon,
|
||||
title: t('designs'),
|
||||
|
@ -14,19 +17,17 @@ const PatternPicker = ({ app }) => {
|
|||
|
||||
return (<Picker {...pickerProps}>
|
||||
{Object.keys(app.navigation).map(section => {
|
||||
const sectionProps = {
|
||||
selectedItem: t(app.navigation[section].__title),
|
||||
isStatic: true
|
||||
}
|
||||
const sectionTitle = t(app.navigation[section].__title);
|
||||
|
||||
{return (<React.Fragment key={section}>
|
||||
<li className={`
|
||||
capitalize font-bold text-base-content text-center
|
||||
opacity-50 border-b2 my-2 border-base-content
|
||||
`} {...sectionProps}>
|
||||
`}>
|
||||
{sectionTitle}
|
||||
</li>
|
||||
{Object.keys(app.navigation[section]).filter((p)=>!p.startsWith('__')).map(pattern => {
|
||||
|
||||
{sectionPatterns(section).map(pattern => {
|
||||
const patternProps = {
|
||||
href: app.navigation[section][pattern].__slug
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue