Skip to content

Commit

Permalink
feat(admin-ui): norskifisering
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferMarthinsen committed May 6, 2024
1 parent f67a9cb commit a817425
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
6 changes: 3 additions & 3 deletions kabinizer-front-end/src/components/DeleteDraw.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const DeleteDraw = ({ draw }: { draw: Array<Draw> }) => {
return (
<div className="flex w-full flex-col gap-8 rounded-xl bg-gray-300 p-4">
<div className="rounded gap-10 bg-[#354A71] text-center">
<h2 className="text-lg h-10 flex w-full items-center justify-center rounded bg-[#354A71] px-4 font-poppins text-white">Delete or edit draw?</h2>
<h2 className="text-lg h-10 flex w-full items-center justify-center rounded bg-[#354A71] px-4 font-poppins text-white">Slett eller endre trekning</h2>
</div>
{draw?.map((draws) => (
<div key={draws.id} className="flex flex-col items-center gap-4">
Expand All @@ -39,10 +39,10 @@ const DeleteDraw = ({ draw }: { draw: Array<Draw> }) => {
<Editicon />
</button>
<div className="font-poppins flex w-full flex-col items-start gap-2 rounded bg-[#354A71] p-4 text-white">
<p>Title: {draws?.title}</p>
<p>{draws?.title}</p>
{draws?.periods?.map((period) => (
<div key={period.id}>
{`Period: ${formatDate(period?.periodStart)} -
{`Periode ${formatDate(period?.periodStart)} -
${formatDate(period?.periodEnd)}`}
</div>
))}
Expand Down
18 changes: 9 additions & 9 deletions kabinizer-front-end/src/components/EditPeriodView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const EditPeriodView = (props: { draw: object }) => {
>
<div className="flex flex-col justify-between gap-4">
<label className=" rounded-xl bg-[#354A71] p-1 text-center">
Draw title
Trekning tittel
</label>
<form.Field
name="draw.title"
Expand Down Expand Up @@ -93,7 +93,7 @@ const EditPeriodView = (props: { draw: object }) => {

<div className="flex flex-col justify-between gap-4">
<label className="whitespace-nowrap rounded-xl bg-[#354A71] p-1 text-center">
Deadline to
Frist
</label>
<form.Field
name="draw.end"
Expand Down Expand Up @@ -126,7 +126,7 @@ const EditPeriodView = (props: { draw: object }) => {
</div>
<div className="flex flex-col justify-between gap-4">
<label className="whitespace-nowrap rounded-xl bg-[#354A71] p-1 text-center">
Is special draw?
Er det en spesiell trekning?
</label>
<form.Field
name="draw.isSpecial"
Expand Down Expand Up @@ -179,7 +179,7 @@ const EditPeriodView = (props: { draw: object }) => {
return (
<div className="flex flex-col justify-between gap-4">
<label className="whitespace-nowrap rounded-xl bg-[#354A71] p-1 text-center">
Period from?
Periode start?
</label>
<input
className="w-56 rounded bg-white p-1 text-justify text-black"
Expand Down Expand Up @@ -218,7 +218,7 @@ const EditPeriodView = (props: { draw: object }) => {
return (
<div className="flex flex-col justify-between gap-4">
<label className="whitespace-nowrap rounded-xl bg-[#354A71] p-1 text-center">
Period to?
Periode slutt?
</label>
<input
className="w-56 rounded bg-white p-1 text-justify text-black"
Expand All @@ -240,7 +240,7 @@ const EditPeriodView = (props: { draw: object }) => {
return (
<div className="flex flex-col justify-between gap-4">
<label className="whitespace-nowrap rounded-xl bg-[#354A71] p-1 text-center">
Period title?
Periode tittel?
</label>
<input
className="w-56 rounded bg-white p-1 text-justify text-black"
Expand Down Expand Up @@ -291,7 +291,7 @@ const EditPeriodView = (props: { draw: object }) => {
onClick={() => handleUpdatePeriods(periods)}
type="button"
>
Add period
Legg til periode
</button>
</div>
</div>
Expand All @@ -305,12 +305,12 @@ const EditPeriodView = (props: { draw: object }) => {
<div className="mt-8 flex gap-8">
<div className="w-20 rounded bg-[#354A71] p-1 text-center hover:bg-blue-700">
<button type="submit" disabled={!canSubmit}>
{isSubmitting ? "..." : "Submit"}
{isSubmitting ? "..." : "Send inn"}
</button>
</div>
<div className="w-20 rounded bg-[#354A71] p-1 text-center hover:bg-blue-700">
<button type="reset" onClick={() => form.reset()}>
Reset
Slett
</button>
</div>
</div>
Expand Down
18 changes: 9 additions & 9 deletions kabinizer-front-end/src/components/NewPeriodView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const NewPeriodView = () => {
>
<div className="flex flex-col justify-between gap-4">
<label className=" rounded-xl bg-[#354A71] p-1 text-center">
Draw title
Trekning tittel
</label>
<form.Field
name="title"
Expand Down Expand Up @@ -76,7 +76,7 @@ const NewPeriodView = () => {

<div className="flex flex-col justify-between gap-4">
<label className="whitespace-nowrap rounded-xl bg-[#354A71] p-1 text-center">
Deadline to
Frist
</label>
<form.Field
name="deadlineEnd"
Expand Down Expand Up @@ -109,7 +109,7 @@ const NewPeriodView = () => {
</div>
<div className="flex flex-col justify-between gap-4">
<label className="whitespace-nowrap rounded-xl bg-[#354A71] p-1 text-center">
Is special draw?
Er det en spesiell trekning?
</label>
<form.Field
name="isSpecial"
Expand Down Expand Up @@ -162,7 +162,7 @@ const NewPeriodView = () => {
return (
<div className="flex flex-col justify-between gap-4">
<label className="whitespace-nowrap rounded-xl bg-[#354A71] p-1 text-center">
Period from?
Periode fra?
</label>
<input
className="w-56 rounded bg-white p-1 text-justify text-black"
Expand Down Expand Up @@ -200,7 +200,7 @@ const NewPeriodView = () => {
return (
<div className="flex flex-col justify-between gap-4">
<label className="whitespace-nowrap rounded-xl bg-[#354A71] p-1 text-center">
Period to?
Periode til?
</label>
<input
className="w-56 rounded bg-white p-1 text-justify text-black"
Expand All @@ -222,7 +222,7 @@ const NewPeriodView = () => {
return (
<div className="flex flex-col justify-between gap-4">
<label className="whitespace-nowrap rounded-xl bg-[#354A71] p-1 text-center">
Period title?
Periode tittel?
</label>
<input
className="w-56 rounded bg-white p-1 text-justify text-black"
Expand Down Expand Up @@ -251,7 +251,7 @@ const NewPeriodView = () => {
}
type="button"
>
Add period
Legg til periode
</button>
</div>
</div>
Expand All @@ -265,12 +265,12 @@ const NewPeriodView = () => {
<div className="mt-8 flex gap-8">
<div className="w-20 rounded bg-[#354A71] p-1 text-center hover:bg-blue-700">
<button type="submit" disabled={!canSubmit}>
{isSubmitting ? "..." : "Submit"}
{isSubmitting ? "..." : "Send inn"}
</button>
</div>
<div className="w-20 rounded bg-[#354A71] p-1 text-center hover:bg-blue-700">
<button type="reset" onClick={() => form.reset()}>
Reset
Slett
</button>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions kabinizer-front-end/src/pages/admin/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@ const Admin = () => {
<div className="w-22 flex w-full flex-col items-center gap-4">
<div className="rounded bg-[#354A71] p-1 ">
<h2 className="font-poppins text-lg">
Download selected periods
Last ned perioder
</h2>
</div>
<Button size="large" onClick={mutate}>
Download
Last ned
</Button>
</div>
</div>
<div className="rounded flex w-full flex-col justify-center gap-10 bg-gray-300 p-4">
<Button size="large" onClick={generateNewPeriod}>
Generate new period
Legg til nye perioder
</Button>
</div>
{showNewPeriodView && <NewPeriodView />}
Expand Down

0 comments on commit a817425

Please sign in to comment.