mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
* removed daisy from config * removed tw-elements artefact * removed comments from tailwind config * removed safelist * migrated to tailwind4 and daisyui5 * deleted tailwind.config.js which is not eeded anymore * 3.0.79 * version number * fixed broken layouts * more fixing * more layout fixing * tested theming * small fixes * adapt snapshots to changes * package.json: add unit test update script * more ui refactoring & theme controller * ui improvements * package-lock.json * fix linting * fixed tabs * fix linting * fixed typing --------- Co-authored-by: mahula <lenzmath@posteo.de>
52 lines
1.6 KiB
TypeScript
52 lines
1.6 KiB
TypeScript
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
|
|
import { ContactInfoForm } from '#components/Profile/Subcomponents/ContactInfoForm'
|
|
import { CrowdfundingForm } from '#components/Profile/Subcomponents/CrowdfundingForm'
|
|
import { GroupSubheaderForm } from '#components/Profile/Subcomponents/GroupSubheaderForm'
|
|
import { ProfileStartEndForm } from '#components/Profile/Subcomponents/ProfileStartEndForm'
|
|
import { ProfileTextForm } from '#components/Profile/Subcomponents/ProfileTextForm'
|
|
|
|
import type { FormState } from '#types/FormState'
|
|
import type { Item } from '#types/Item'
|
|
|
|
const componentMap = {
|
|
groupSubheaders: GroupSubheaderForm,
|
|
texts: ProfileTextForm,
|
|
contactInfos: ContactInfoForm,
|
|
startEnd: ProfileStartEndForm,
|
|
crowdfundings: CrowdfundingForm,
|
|
// weitere Komponenten hier
|
|
}
|
|
|
|
export const FlexForm = ({
|
|
item,
|
|
state,
|
|
setState,
|
|
}: {
|
|
state: FormState
|
|
setState: React.Dispatch<React.SetStateAction<any>>
|
|
item: Item
|
|
}) => {
|
|
return (
|
|
<div className='tw:mt-6 tw:flex tw:flex-col tw:h-full'>
|
|
{item.layer?.itemType.profileTemplate.map((templateItem) => {
|
|
const TemplateComponent = componentMap[templateItem.collection]
|
|
return TemplateComponent ? (
|
|
<TemplateComponent
|
|
key={templateItem.id}
|
|
state={state}
|
|
setState={setState}
|
|
item={item}
|
|
{...templateItem.item}
|
|
/>
|
|
) : (
|
|
<div className='tw:mt-2' key={templateItem.id}>
|
|
{templateItem.collection} form not found
|
|
</div>
|
|
)
|
|
})}
|
|
</div>
|
|
)
|
|
}
|