Skip to content

Commit 1419a96

Browse files
authored
feat: Add pending component to router (#634)
1 parent cca138a commit 1419a96

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

.changeset/big-corners-act.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@baseplate-dev/react-generators': patch
3+
---
4+
5+
Add a default pending component to router

packages/react-generators/src/generators/core/react-router/templates/src/app/router.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
import type { ErrorRouteComponent } from '@tanstack/react-router';
44

55
import { routeTree } from '$routeTree';
6-
import { Button, ErrorDisplay, NotFoundCard } from '%reactComponentsImports';
6+
import {
7+
Button,
8+
ErrorDisplay,
9+
Loader,
10+
NotFoundCard,
11+
} from '%reactComponentsImports';
712
import { createRouter } from '@tanstack/react-router';
813

914
function ErrorComponent({
@@ -26,6 +31,7 @@ export const router = createRouter({
2631
routeTree,
2732
defaultNotFoundComponent: NotFoundCard,
2833
defaultErrorComponent: ErrorComponent,
34+
defaultPendingComponent: Loader,
2935
TPL_ADDITIONAL_ROUTER_OPTIONS,
3036
});
3137

plugins/plugin-auth/src/local-auth/admin/generators/admin-crud-reset-password-action/extractor.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"fileOptions": { "kind": "singleton" },
2626
"pathRootRelativePath": "{routes-root}/-components/password-reset-dialog.gql",
2727
"sourceFile": "routes/-components/password-reset-dialog.gql",
28-
"variables": {}
28+
"variables": { "TPL_USER_ROW_FRAGMENT": {} }
2929
}
3030
}
3131
}

plugins/plugin-auth/src/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const passwordResetDialogGql = createTextTemplateFile({
3737
'../templates/routes/-components/password-reset-dialog.gql',
3838
),
3939
},
40-
variables: {},
40+
variables: { TPL_USER_ROW_FRAGMENT: {} },
4141
});
4242

4343
export const LOCAL_AUTH_ADMIN_ADMIN_CRUD_RESET_PASSWORD_ACTION_TEMPLATES = {
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
mutation ResetUserPassword($input: ResetUserPasswordInput!) {
22
resetUserPassword(input: $input) {
33
user {
4-
id
5-
name
6-
email
4+
...TPL_USER_ROW_FRAGMENT
75
}
86
}
97
}

0 commit comments

Comments
 (0)