mirror of
https://github.com/spliit-app/spliit.git
synced 2026-02-14 11:36:13 +01:00
add group information field to group settings and Information tab (#164)
* add group information field to group and Information tab to display * add breaks to info page * Improve UX --------- Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
This commit is contained in:
@@ -39,6 +39,7 @@ import { useTranslations } from 'next-intl'
|
||||
import Link from 'next/link'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useFieldArray, useForm } from 'react-hook-form'
|
||||
import { Textarea } from './ui/textarea'
|
||||
|
||||
export type Props = {
|
||||
group?: NonNullable<Awaited<ReturnType<typeof getGroup>>>
|
||||
@@ -60,11 +61,13 @@ export function GroupForm({
|
||||
defaultValues: group
|
||||
? {
|
||||
name: group.name,
|
||||
information: group.information ?? '',
|
||||
currency: group.currency,
|
||||
participants: group.participants,
|
||||
}
|
||||
: {
|
||||
name: '',
|
||||
information: '',
|
||||
currency: '',
|
||||
participants: [
|
||||
{ name: t('Participants.John') },
|
||||
@@ -162,6 +165,27 @@ export function GroupForm({
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="information"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t('InformationField.label')}</FormLabel>
|
||||
<FormControl>
|
||||
<Textarea
|
||||
rows={10}
|
||||
className="text-base"
|
||||
{...field}
|
||||
placeholder={t('InformationField.placeholder')}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user