-
Notifications
You must be signed in to change notification settings - Fork 6
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
15 changed files
with
102 additions
and
56 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,7 @@ | ||
import { createFileRoute } from "@tanstack/react-router"; | ||
import { prOidc } from "oidc"; | ||
import { protectedLoader } from "oidc"; | ||
|
||
export const Route = createFileRoute("/account")({ | ||
component: () => <div>Hello account!</div>, | ||
beforeLoad: async () => { | ||
const oidc = await prOidc; | ||
|
||
if (oidc.isUserLoggedIn) { | ||
return null; | ||
} | ||
|
||
await oidc.login({ | ||
doesCurrentHrefRequiresAuth: true | ||
}); | ||
} | ||
beforeLoad: protectedLoader | ||
}); |
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,5 +1,52 @@ | ||
import { useSuspenseQuery } from "@tanstack/react-query"; | ||
import { createFileRoute } from "@tanstack/react-router"; | ||
import { getGetTodosQueryOptions } from "api/endpoints/default"; | ||
import { TodoApp } from "components/TodoApp"; | ||
|
||
export const Route = createFileRoute("/todo/")({ | ||
component: () => <>Summary</> | ||
component: TodoIndex, | ||
loader: ({ context: { queryClient }, abortController }) => | ||
queryClient.ensureQueryData( | ||
getGetTodosQueryOptions({ request: { signal: abortController.signal } }) | ||
) | ||
}); | ||
|
||
function TodoIndex() { | ||
const todoQuery = useSuspenseQuery(getGetTodosQueryOptions()); | ||
const todo = todoQuery.data; | ||
|
||
const test = (params: unknown) => console.log(params); | ||
|
||
const todos = [ | ||
{ | ||
id: "1", | ||
text: "test1", | ||
isDone: false | ||
}, | ||
|
||
{ | ||
id: "2", | ||
text: "test2", | ||
isDone: false | ||
}, | ||
{ | ||
id: "3", | ||
text: "test3", | ||
isDone: true | ||
}, | ||
{ | ||
id: "4", | ||
text: "test4", | ||
isDone: true | ||
} | ||
]; | ||
return ( | ||
<TodoApp | ||
onAddTodo={test} | ||
onDeleteTodo={test} | ||
onToggleTodo={test} | ||
onUpdateTodoText={test} | ||
todos={todos} | ||
/> | ||
); | ||
} |
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