-
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.
- Loading branch information
Showing
60 changed files
with
2,270 additions
and
1,957 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 was deleted.
Oops, something went wrong.
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,74 +1,3 @@ | ||
:root { | ||
/* Colors */ | ||
--color-primary: #00796b; | ||
--color-text-primary: #0f172a; | ||
--color-background: #f8fafc; | ||
--color-elevated: #f1f5f9; | ||
|
||
/* Status colors */ | ||
--color-background-success: #f0fdf4; | ||
--color-text-success: #166534; | ||
--color-background-error: #fef2f2; | ||
--color-text-error: #991b1b; | ||
--color-background-warning: #fefce8; | ||
--color-text-warning: #854d0e; | ||
|
||
/* Spacings */ | ||
--spacing-1: 0.25rem; | ||
--spacing-2: 0.5rem; | ||
--spacing-3: 0.75rem; | ||
--spacing-4: 1rem; | ||
--spacing-5: 1.25rem; | ||
--spacing-6: 1.5rem; | ||
--spacing-7: 1.75rem; | ||
--spacing-8: 2rem; | ||
--spacing-9: 2.25rem; | ||
--spacing-10: 2.5rem; | ||
--spacing-11: 2.75rem; | ||
--spacing-12: 3rem; | ||
|
||
/* Border radius */ | ||
--border-radius-rounded: var(--spacing-1); | ||
|
||
/* Shadows */ | ||
--box-shadow-medium: rgb(0 0 0 / 15%) 1.95px 1.95px 2.6px; | ||
|
||
/* Max widths */ | ||
--max-width-header: 80rem; | ||
|
||
/* Font sizes */ | ||
--font-small: 0.875rem; | ||
--line-height-small: 1.25rem; | ||
} | ||
|
||
@media (prefers-color-scheme: dark) { | ||
:root { | ||
--color-text-primary: #f8fafc; | ||
--color-background: #020617; | ||
--color-elevated: #0f172a; | ||
|
||
/* Status colors */ | ||
--color-background-success: #1e293b; | ||
--color-text-success: #4ade80; | ||
--color-background-error: #1e293b; | ||
--color-text-error: #f87171; | ||
--color-background-warning: #1e293b; | ||
--color-text-warning: #fde047; | ||
} | ||
} | ||
|
||
button, | ||
input[type="submit"], | ||
input[type="reset"] { | ||
background: none; | ||
color: inherit; | ||
border: none; | ||
padding: 0; | ||
font: inherit; | ||
cursor: pointer; | ||
outline: inherit; | ||
} | ||
|
||
a { | ||
text-decoration: none; | ||
} | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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,5 @@ | ||
import LoadingSpinner from "@components/icons/loading-spinner"; | ||
|
||
export default function Loading() { | ||
return <LoadingSpinner className="mx-auto mt-5 h-44 w-44 text-primary" />; | ||
} |
This file was deleted.
Oops, something went wrong.
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,7 +1,16 @@ | ||
"use client"; | ||
|
||
import styles from "./page.module.css"; | ||
import Image from "next/image"; | ||
|
||
export default function Home() { | ||
return <main className={styles["main-container"]}>Admin</main>; | ||
return ( | ||
<main className="mx-3 flex flex-1 flex-col items-center justify-center gap-3"> | ||
<Image | ||
src="/partiguiden_logo_primary.png" | ||
alt="Partiguiden logo" | ||
width="890" | ||
height="140" | ||
/> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"use server"; | ||
import { PAGES } from "@lib/navigation"; | ||
import { revalidatePath } from "next/cache"; | ||
import { zStandpoint } from "../types"; | ||
import prisma from "@lib/prisma"; | ||
import handleServerError from "@lib/handleServerError"; | ||
|
||
export default async function createStandpoint(formData: FormData) { | ||
try { | ||
const json = Object.fromEntries(formData.entries()); | ||
const data = zStandpoint.parse({ | ||
...json, | ||
content: formData.getAll("content"), | ||
}); | ||
|
||
await prisma.standpoint.create({ | ||
data, | ||
}); | ||
|
||
revalidatePath(PAGES.standpoints.href); | ||
} catch (error) { | ||
return handleServerError(error); | ||
} | ||
} |
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,18 @@ | ||
"use server"; | ||
import handleServerError from "@lib/handleServerError"; | ||
import { PAGES } from "@lib/navigation"; | ||
import prisma from "@lib/prisma"; | ||
import { revalidatePath } from "next/cache"; | ||
|
||
export default async function deleteStandpoint(link: string) { | ||
try { | ||
await prisma.standpoint.delete({ | ||
where: { | ||
link, | ||
}, | ||
}); | ||
revalidatePath(PAGES.standpoints.href); | ||
} catch (error) { | ||
return handleServerError(error); | ||
} | ||
} |
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,30 @@ | ||
"use server"; | ||
import { PAGES } from "@lib/navigation"; | ||
import prisma from "@lib/prisma"; | ||
import { revalidatePath } from "next/cache"; | ||
import { zStandpoint } from "../types"; | ||
import type { Standpoint } from "@prisma/client"; | ||
import handleServerError from "@lib/handleServerError"; | ||
|
||
export default async function editStandpoint( | ||
standpointsPrisma: Standpoint, | ||
formData: FormData, | ||
) { | ||
try { | ||
const json = Object.fromEntries(formData.entries()); | ||
const data = zStandpoint.parse({ | ||
...json, | ||
content: formData.getAll("content"), | ||
}); | ||
await prisma.standpoint.update({ | ||
where: { | ||
link: standpointsPrisma.link, | ||
}, | ||
data, | ||
}); | ||
|
||
revalidatePath(PAGES.standpoints.href); | ||
} catch (error) { | ||
return handleServerError(error); | ||
} | ||
} |
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,25 @@ | ||
"use server"; | ||
import { PAGES } from "@lib/navigation"; | ||
import prisma from "@lib/prisma"; | ||
import { revalidatePath } from "next/cache"; | ||
import type { Standpoint } from "@prisma/client"; | ||
import handleServerError from "@lib/handleServerError"; | ||
|
||
export default async function updateSubject( | ||
standpointsPrisma: Standpoint, | ||
newSubject: string, | ||
) { | ||
try { | ||
await prisma.standpoint.update({ | ||
where: { | ||
link: standpointsPrisma.link, | ||
}, | ||
data: { | ||
subjectName: newSubject, | ||
}, | ||
}); | ||
revalidatePath(PAGES.standpoints.href); | ||
} catch (error) { | ||
return handleServerError(error); | ||
} | ||
} |
Oops, something went wrong.