-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Legg til cdn for statiske filer * Legg aktivt oppgavesøk som context istedet for session cookie * Alle kan legge tilbake oppgaver som ikke er ferdigstilt. Man skal kun se oppgaver som er ferdig
- Loading branch information
Showing
11 changed files
with
104 additions
and
37 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import type { PropsWithChildren } from "react"; | ||
import { createContext, useState } from "react"; | ||
|
||
interface ISaksbehandlerContext { | ||
aktivtOppgaveSok: string; | ||
setAktivtOppgaveSok: (sok: string) => void; | ||
} | ||
|
||
export const SaksbehandlerContext = createContext<ISaksbehandlerContext | undefined>(undefined); | ||
|
||
export function SaksbehandlerProvider(props: PropsWithChildren<{ aktivtSok: string }>) { | ||
const [aktivtOppgaveSok, setAktivtOppgaveSok] = useState<string>(""); | ||
|
||
return ( | ||
<SaksbehandlerContext.Provider value={{ aktivtOppgaveSok, setAktivtOppgaveSok }}> | ||
{props.children} | ||
</SaksbehandlerContext.Provider> | ||
); | ||
} |
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,11 @@ | ||
import { useContext } from "react"; | ||
|
||
import { SaksbehandlerContext } from "~/context/saksbehandler-context"; | ||
|
||
export function useSaksbehandler() { | ||
const context = useContext(SaksbehandlerContext); | ||
if (!context) { | ||
throw new Error("useSaksbehandler must be used within an SaksbehandlerProvider"); | ||
} | ||
return context; | ||
} |
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
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
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