-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvements to settings pages (#141)
Co-authored-by: Oscar Eriksson <[email protected]>
- Loading branch information
1 parent
8d245dd
commit 2144b51
Showing
29 changed files
with
878 additions
and
388 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
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 |
---|---|---|
@@ -1,29 +1,41 @@ | ||
import DivisionGroupService from '@/services/divisionGroupService'; | ||
import AddTypeForm from './AddTypeForm'; | ||
import Divider from '@/components/Divider/Divider'; | ||
import EditTypeForm from './EditTypeForm'; | ||
import i18nService from '@/services/i18nService'; | ||
import Table from '@/components/Table/Table'; | ||
|
||
export default async function Page() { | ||
export default async function Page({ | ||
params: { locale } | ||
}: { | ||
params: { locale: string }; | ||
}) { | ||
const types = await DivisionGroupService.getGroupTypes(); | ||
types.pop(); | ||
const l = i18nService.getLocale(locale); | ||
|
||
return ( | ||
<main> | ||
<title>Kontrollpanel - Grupptyper</title> | ||
<h1>Grupptyper</h1> | ||
<ul> | ||
{types.map((type) => ( | ||
<li key={type.id}> | ||
ID {type.id} | ||
<EditTypeForm type={type} /> | ||
</li> | ||
))} | ||
</ul> | ||
|
||
<Divider /> | ||
|
||
<h1>Lägg till grupptyp</h1> | ||
<AddTypeForm /> | ||
<title> | ||
{l.settings.common.controlPanel + ' - ' + l.settings.groupTypes.name} | ||
</title> | ||
<h1>{l.settings.groupTypes.name}</h1> | ||
<Table> | ||
<thead> | ||
<tr> | ||
<th>ID</th> | ||
<th>{l.settings.common.nameEn}</th> | ||
<th>{l.settings.common.nameSv}</th> | ||
<th>{l.settings.common.priority}</th> | ||
<th>{l.settings.common.actions}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{types.map((type) => ( | ||
<EditTypeForm key={type.id} type={type} locale={locale} /> | ||
))} | ||
<AddTypeForm locale={locale} /> | ||
</tbody> | ||
</Table> | ||
</main> | ||
); | ||
} |
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
Oops, something went wrong.