-
-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information
1 parent
4f5e124
commit 972bb9d
Showing
9 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
prisma/migrations/20240531154748_add_group_information/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-- AlterTable | ||
ALTER TABLE "Group" ADD COLUMN "information" TEXT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { cached } from '@/app/cached-functions' | ||
import { Button } from '@/components/ui/button' | ||
import { | ||
Card, | ||
CardContent, | ||
CardDescription, | ||
CardHeader, | ||
CardTitle, | ||
} from '@/components/ui/card' | ||
import { Pencil } from 'lucide-react' | ||
import { Metadata } from 'next' | ||
import { getTranslations } from 'next-intl/server' | ||
import Link from 'next/link' | ||
import { notFound } from 'next/navigation' | ||
|
||
export const metadata: Metadata = { | ||
title: 'Totals', | ||
} | ||
|
||
export default async function InformationPage({ | ||
params: { groupId }, | ||
}: { | ||
params: { groupId: string } | ||
}) { | ||
const group = await cached.getGroup(groupId) | ||
if (!group) notFound() | ||
|
||
const t = await getTranslations('Information') | ||
|
||
return ( | ||
<> | ||
<Card className="mb-4"> | ||
<CardHeader> | ||
<CardTitle className="flex justify-between"> | ||
<span>{t('title')}</span> | ||
<Button size="icon" asChild className="-mb-12"> | ||
<Link href={`/groups/${groupId}/edit`}> | ||
<Pencil className="w-4 h-4" /> | ||
</Link> | ||
</Button> | ||
</CardTitle> | ||
<CardDescription className="mr-12"> | ||
{t('description')} | ||
</CardDescription> | ||
</CardHeader> | ||
<CardContent className="prose prose-sm sm:prose-base max-w-full whitespace-break-spaces"> | ||
{group.information || ( | ||
<p className="text-muted-foreground italic">{t('empty')}</p> | ||
)} | ||
</CardContent> | ||
</Card> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters