1
0
Fork 0
freesewing/sites/shared/components/designs/design-picker.mjs
Joost De Cock ddbbbda2bc chore(shared): Changes kiosk/expand/flags/header
- Revamped the flags ui to be consistent with the rest
- The expand setting is on by default now. Tweaks to its dialog and
  header
- Added a new kiosk mode that will use the entire screen for the
  workbench
- Got rid of the auto-hiding behaviour of the header which gets annoying
  quick
2023-09-09 17:58:44 +02:00

23 lines
681 B
JavaScript

import { designs } from 'shared/config/designs.mjs'
import { Design, ns as designNs } from 'shared/components/designs/design.mjs'
import { useTranslation } from 'next-i18next'
export const ns = designNs
export const DesignPicker = ({ hrefBuilder = false }) => {
const { t } = useTranslation('designs')
// Need to sort designs by their translated title
const translated = {}
for (const d in designs) translated[t(`${d}.t`)] = d
return (
<div className="flex flex-row flex-wrap gap-2 mt-8">
{Object.keys(translated)
.sort()
.map((d) => (
<Design name={translated[d]} key={d} hrefBuilder={hrefBuilder} />
))}
</div>
)
}