@pplancq/react-template 2.10.0 → 2.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.mock +1 -1
- package/.prettierignore +8 -0
- package/.stylelintignore +4 -0
- package/CHANGELOG.md +41 -0
- package/_README.md +2 -2
- package/bin/template-install.js +8 -8
- package/commitlint.config.mjs +1 -1
- package/eslint.config.mjs +12 -9
- package/lint-staged.config.mjs +5 -5
- package/mise.toml +2 -2
- package/mocks/handlers/userHandlers.ts +1 -3
- package/mrc.playwright.config.ts +14 -14
- package/package.json +20 -22
- package/playwright.config.ts +21 -21
- package/prettier.config.mjs +1 -1
- package/rsbuild.config.ts +23 -23
- package/scripts/lint.js +4 -4
- package/scripts/playwright.js +19 -19
- package/scripts/removeDemo.cjs +115 -89
- package/scripts/test.js +6 -6
- package/src/app/App.tsx +5 -7
- package/src/app/assets/css/reset.css +3 -3
- package/src/app/providers/Providers/Providers.tsx +5 -7
- package/src/app/providers/QueryClientProvider/QueryClientProvider.tsx +6 -8
- package/src/demo/application/use-cases/GetArchitecturePrinciplesUseCase.ts +1 -3
- package/src/demo/application/use-cases/GetDemoUsersUseCase.ts +1 -3
- package/src/demo/infrastructure/repositories/StaticArchitecturePrincipleRepository.ts +1 -3
- package/src/demo/ui/components/DemoFooter/DemoFooter.tsx +8 -10
- package/src/demo/ui/components/DemoHeader/DemoHeader.module.css +2 -2
- package/src/demo/ui/components/DemoHeader/DemoHeader.tsx +15 -17
- package/src/demo/ui/components/DemoNavigation/DemoNavigation.module.css +2 -2
- package/src/demo/ui/components/Input/Input.module.scss +2 -2
- package/src/demo/ui/components/Logo/Logo.tsx +3 -3
- package/src/demo/ui/forms/ProfileForm/ProfileForm.module.scss +1 -1
- package/src/demo/ui/layouts/DemoLayout/DemoLayout.tsx +5 -7
- package/src/demo/ui/layouts/MainTemplate/MainTemplate.module.css +3 -3
- package/src/demo/ui/layouts/MainTemplate/MainTemplate.tsx +10 -12
- package/src/demo/ui/pages/DemoHome/DemoHome.module.scss +23 -23
- package/src/demo/ui/pages/DemoHome/DemoHome.tsx +96 -98
- package/src/demo/ui/pages/DependencyInjectionDemo/DependencyInjectionDemo.module.scss +5 -5
- package/src/demo/ui/pages/ReactHookFormDemo/ReactHookFormDemo.module.scss +4 -4
- package/src/demo/ui/pages/ReactQueryDemo/ReactQueryDemo.module.scss +5 -5
- package/stylelint.config.mjs +1 -1
- package/vitest.config.mts +22 -22
- package/vitest.setup.ts +5 -5
- package/playwright-report/html/index.html +0 -90
- package/playwright-report/sonar-results.xml +0 -20
- package/test-results/.last-run.json +0 -4
package/scripts/removeDemo.cjs
CHANGED
|
@@ -1,127 +1,153 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const { rmSync, readFileSync, writeFileSync, mkdirSync } = require(
|
|
3
|
-
const { resolve } = require(
|
|
2
|
+
const { rmSync, readFileSync, writeFileSync, mkdirSync } = require("node:fs");
|
|
3
|
+
const { resolve } = require("node:path");
|
|
4
|
+
const { execFileSync } = require("node:child_process");
|
|
4
5
|
|
|
5
|
-
const resolveSrc = path => resolve(__dirname, `../src${path}`);
|
|
6
|
+
const resolveSrc = (path) => resolve(__dirname, `../src${path}`);
|
|
6
7
|
|
|
7
|
-
rmSync(resolveSrc(
|
|
8
|
+
rmSync(resolveSrc("/demo"), { recursive: true, force: true });
|
|
9
|
+
rmSync(resolve(__dirname, "../tests/unit/demo"), { recursive: true, force: true });
|
|
10
|
+
rmSync(resolve(__dirname, "../tests/e2e/demo.test.ts"), { force: true });
|
|
11
|
+
writeFileSync(
|
|
12
|
+
resolve(__dirname, "../tests/e2e/home.test.ts"),
|
|
13
|
+
[
|
|
14
|
+
'import { expect } from "@playwright/test";',
|
|
15
|
+
'import { describe, it } from "./fixture/playwright.fixture";',
|
|
16
|
+
"",
|
|
17
|
+
'describe("Home", () => {',
|
|
18
|
+
' it("should display the home page", async ({ page }) => {',
|
|
19
|
+
' await page.goto("/");',
|
|
20
|
+
' await expect(page.getByRole("heading", { name: "Home" })).toBeVisible();',
|
|
21
|
+
" });",
|
|
22
|
+
"});",
|
|
23
|
+
"",
|
|
24
|
+
].join("\n"),
|
|
25
|
+
{ encoding: "utf-8" },
|
|
26
|
+
);
|
|
8
27
|
|
|
9
|
-
rmSync(resolveSrc(
|
|
10
|
-
writeFileSync(resolveSrc(
|
|
11
|
-
writeFileSync(resolveSrc(
|
|
12
|
-
encoding:
|
|
28
|
+
rmSync(resolveSrc("/app/assets/css/mainBody.css"), { force: true });
|
|
29
|
+
writeFileSync(resolveSrc("/app/assets/css/global.css"), ":root {\n --white-color: #fff;\n}\n", { encoding: "utf-8" });
|
|
30
|
+
writeFileSync(resolveSrc("/app/assets/css/index.ts"), 'import "./reset.css";\nimport "./global.css";\n', {
|
|
31
|
+
encoding: "utf-8",
|
|
13
32
|
});
|
|
14
33
|
|
|
15
|
-
mkdirSync(resolveSrc(
|
|
16
|
-
writeFileSync(resolveSrc(
|
|
34
|
+
mkdirSync(resolveSrc("/home/domain"), { recursive: true });
|
|
35
|
+
writeFileSync(resolveSrc("/home/domain/.gitkeep"), "", { encoding: "utf-8" });
|
|
17
36
|
|
|
18
|
-
mkdirSync(resolveSrc(
|
|
19
|
-
writeFileSync(resolveSrc(
|
|
37
|
+
mkdirSync(resolveSrc("/home/application"), { recursive: true });
|
|
38
|
+
writeFileSync(resolveSrc("/home/application/.gitkeep"), "", { encoding: "utf-8" });
|
|
20
39
|
|
|
21
|
-
mkdirSync(resolveSrc(
|
|
22
|
-
writeFileSync(resolveSrc(
|
|
40
|
+
mkdirSync(resolveSrc("/home/infrastructure"), { recursive: true });
|
|
41
|
+
writeFileSync(resolveSrc("/home/infrastructure/.gitkeep"), "", { encoding: "utf-8" });
|
|
23
42
|
|
|
24
|
-
writeFileSync(resolveSrc(
|
|
25
|
-
encoding:
|
|
43
|
+
writeFileSync(resolveSrc("/home/serviceIdentifiers.ts"), "export const HOME_SERVICES = Object.freeze({});\n", {
|
|
44
|
+
encoding: "utf-8",
|
|
26
45
|
});
|
|
27
46
|
|
|
28
47
|
writeFileSync(
|
|
29
|
-
resolveSrc(
|
|
48
|
+
resolveSrc("/home/serviceHome.ts"),
|
|
30
49
|
[
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
].join(
|
|
38
|
-
{ encoding:
|
|
50
|
+
'import { ContainerModule } from "inversify";',
|
|
51
|
+
"",
|
|
52
|
+
"export const serviceHome: ContainerModule = new ContainerModule(() => {",
|
|
53
|
+
" // Register your home context services here",
|
|
54
|
+
"});",
|
|
55
|
+
"",
|
|
56
|
+
].join("\n"),
|
|
57
|
+
{ encoding: "utf-8" },
|
|
39
58
|
);
|
|
40
59
|
|
|
41
|
-
mkdirSync(resolveSrc(
|
|
60
|
+
mkdirSync(resolveSrc("/home/ui/pages/Home"), { recursive: true });
|
|
42
61
|
writeFileSync(
|
|
43
|
-
resolveSrc(
|
|
62
|
+
resolveSrc("/home/ui/pages/Home/Home.tsx"),
|
|
44
63
|
[
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
].join('\n'),
|
|
55
|
-
{ encoding: 'utf-8' },
|
|
64
|
+
"export const Home = () => (",
|
|
65
|
+
" <section>",
|
|
66
|
+
" <h1>Home</h1>",
|
|
67
|
+
" <p>Your demo context has been removed. Start building your first bounded context from here.</p>",
|
|
68
|
+
" </section>",
|
|
69
|
+
");",
|
|
70
|
+
"",
|
|
71
|
+
].join("\n"),
|
|
72
|
+
{ encoding: "utf-8" },
|
|
56
73
|
);
|
|
57
74
|
|
|
58
|
-
mkdirSync(resolveSrc(
|
|
75
|
+
mkdirSync(resolveSrc("/home/ui/routing"), { recursive: true });
|
|
59
76
|
writeFileSync(
|
|
60
|
-
resolveSrc(
|
|
61
|
-
[
|
|
62
|
-
{ encoding:
|
|
77
|
+
resolveSrc("/home/ui/routing/homeAppRoutes.ts"),
|
|
78
|
+
["export const homeAppRoutes = Object.freeze({", ' home: "/",', "});", ""].join("\n"),
|
|
79
|
+
{ encoding: "utf-8" },
|
|
63
80
|
);
|
|
64
81
|
|
|
65
82
|
writeFileSync(
|
|
66
|
-
resolveSrc(
|
|
83
|
+
resolveSrc("/home/ui/routing/homeRoutes.tsx"),
|
|
67
84
|
[
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
].join(
|
|
81
|
-
{ encoding:
|
|
85
|
+
'import { Home } from "@Home/ui/pages/Home/Home";',
|
|
86
|
+
'import type { RouteObject } from "react-router";',
|
|
87
|
+
"",
|
|
88
|
+
"export const homeRoutes: RouteObject = {",
|
|
89
|
+
" children: [",
|
|
90
|
+
" {",
|
|
91
|
+
" index: true,",
|
|
92
|
+
" element: <Home />,",
|
|
93
|
+
" },",
|
|
94
|
+
" ],",
|
|
95
|
+
"};",
|
|
96
|
+
"",
|
|
97
|
+
].join("\n"),
|
|
98
|
+
{ encoding: "utf-8" },
|
|
82
99
|
);
|
|
83
100
|
|
|
84
101
|
writeFileSync(
|
|
85
|
-
resolveSrc(
|
|
102
|
+
resolveSrc("/app/config/serviceContainer.ts"),
|
|
86
103
|
[
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
].join(
|
|
95
|
-
{ encoding:
|
|
104
|
+
'import { serviceHome } from "@Home/serviceHome";',
|
|
105
|
+
'import { Container } from "inversify";',
|
|
106
|
+
"",
|
|
107
|
+
"export const serviceContainer = new Container();",
|
|
108
|
+
"",
|
|
109
|
+
"serviceContainer.load(serviceHome);",
|
|
110
|
+
"",
|
|
111
|
+
].join("\n"),
|
|
112
|
+
{ encoding: "utf-8" },
|
|
96
113
|
);
|
|
97
114
|
|
|
98
115
|
writeFileSync(
|
|
99
|
-
resolveSrc(
|
|
116
|
+
resolveSrc("/app/routing/routes.tsx"),
|
|
100
117
|
[
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
].join(
|
|
112
|
-
{ encoding:
|
|
118
|
+
'import { homeRoutes } from "@Home/ui/routing/homeRoutes";',
|
|
119
|
+
'import type { RouteObject } from "react-router";',
|
|
120
|
+
"",
|
|
121
|
+
"export const routeObject: RouteObject[] = [",
|
|
122
|
+
" {",
|
|
123
|
+
' path: "/",',
|
|
124
|
+
" children: [homeRoutes],",
|
|
125
|
+
" },",
|
|
126
|
+
"];",
|
|
127
|
+
"",
|
|
128
|
+
].join("\n"),
|
|
129
|
+
{ encoding: "utf-8" },
|
|
113
130
|
);
|
|
114
131
|
|
|
115
|
-
const tsconfigJson = JSON.parse(readFileSync(resolve(__dirname,
|
|
116
|
-
delete tsconfigJson.compilerOptions.paths[
|
|
117
|
-
tsconfigJson.compilerOptions.paths[
|
|
118
|
-
writeFileSync(resolve(__dirname,
|
|
132
|
+
const tsconfigJson = JSON.parse(readFileSync(resolve(__dirname, "../tsconfig.json"), { encoding: "utf-8" }));
|
|
133
|
+
delete tsconfigJson.compilerOptions.paths["@Demo/*"];
|
|
134
|
+
tsconfigJson.compilerOptions.paths["@Home/*"] = ["./src/home/*"];
|
|
135
|
+
writeFileSync(resolve(__dirname, "../tsconfig.json"), `${JSON.stringify(tsconfigJson, null, 2)}\n`, {
|
|
136
|
+
encoding: "utf-8",
|
|
137
|
+
});
|
|
119
138
|
|
|
120
|
-
const packagesJson = JSON.parse(readFileSync(resolve(__dirname,
|
|
121
|
-
const {
|
|
139
|
+
const packagesJson = JSON.parse(readFileSync(resolve(__dirname, "../package.json"), { encoding: "utf-8" }));
|
|
140
|
+
const { "remove:demo": _, ...scripts } = packagesJson.scripts;
|
|
122
141
|
packagesJson.scripts = { ...scripts };
|
|
123
|
-
writeFileSync(resolve(__dirname,
|
|
142
|
+
writeFileSync(resolve(__dirname, "../package.json"), `${JSON.stringify(packagesJson, null, 2)}\n`, {
|
|
143
|
+
encoding: "utf-8",
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
execFileSync(require.resolve("prettier/bin/prettier.cjs"), ["--write", "package.json", "tsconfig.json"], {
|
|
147
|
+
cwd: resolve(__dirname, ".."),
|
|
148
|
+
stdio: "ignore",
|
|
149
|
+
});
|
|
124
150
|
|
|
125
|
-
rmSync(resolve(__dirname,
|
|
151
|
+
rmSync(resolve(__dirname, "../scripts/removeDemo.cjs"));
|
|
126
152
|
|
|
127
|
-
console.info(
|
|
153
|
+
console.info("\nThe demo application has been removed\n");
|
package/scripts/test.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
// eslint-disable-next-line import/no-
|
|
2
|
-
import concurrently from
|
|
1
|
+
// eslint-disable-next-line import/no-unresolved
|
|
2
|
+
import concurrently from "concurrently";
|
|
3
3
|
|
|
4
4
|
const args = process.argv.slice(2);
|
|
5
5
|
|
|
6
|
-
let commands = [
|
|
6
|
+
let commands = ["npm:test:unit", "npm:test:e2e"];
|
|
7
7
|
|
|
8
|
-
if (args.includes(
|
|
9
|
-
commands = commands.map(command => `${command} -- --coverage`);
|
|
8
|
+
if (args.includes("--coverage")) {
|
|
9
|
+
commands = commands.map((command) => `${command} -- --coverage`);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
const { result } = concurrently(commands, {
|
|
13
|
-
prefixColors:
|
|
13
|
+
prefixColors: "auto",
|
|
14
14
|
maxProcesses: 1,
|
|
15
15
|
});
|
|
16
16
|
|
package/src/app/App.tsx
CHANGED
|
@@ -9,10 +9,8 @@ type AppProps = {
|
|
|
9
9
|
basename?: string;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
export const App = ({ basename }: AppProps) =>
|
|
13
|
-
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
);
|
|
18
|
-
};
|
|
12
|
+
export const App = ({ basename }: AppProps) => (
|
|
13
|
+
<Providers queryClient={queryClient} container={serviceContainer}>
|
|
14
|
+
<Router basename={basename} />
|
|
15
|
+
</Providers>
|
|
16
|
+
);
|
|
@@ -77,15 +77,15 @@ time,
|
|
|
77
77
|
mark,
|
|
78
78
|
audio,
|
|
79
79
|
video {
|
|
80
|
-
margin: 0;
|
|
81
80
|
padding: 0;
|
|
82
|
-
|
|
83
|
-
vertical-align: baseline;
|
|
81
|
+
margin: 0;
|
|
84
82
|
font: inherit;
|
|
85
83
|
font-family:
|
|
86
84
|
-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans",
|
|
87
85
|
"Helvetica Neue", sans-serif;
|
|
88
86
|
font-size: 100%;
|
|
87
|
+
vertical-align: baseline;
|
|
88
|
+
border: 0;
|
|
89
89
|
-webkit-font-smoothing: antialiased;
|
|
90
90
|
-moz-osx-font-smoothing: grayscale;
|
|
91
91
|
}
|
|
@@ -9,10 +9,8 @@ type ProvidersProps = PropsWithChildren<{
|
|
|
9
9
|
container: Container;
|
|
10
10
|
}>;
|
|
11
11
|
|
|
12
|
-
export const Providers = ({ queryClient, container, children }: ProvidersProps) =>
|
|
13
|
-
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
);
|
|
18
|
-
};
|
|
12
|
+
export const Providers = ({ queryClient, container, children }: ProvidersProps) => (
|
|
13
|
+
<ServiceProvider container={container}>
|
|
14
|
+
<QueryClientProvider queryClient={queryClient}>{children}</QueryClientProvider>
|
|
15
|
+
</ServiceProvider>
|
|
16
|
+
);
|
|
@@ -6,11 +6,9 @@ type ClientProviderProps = {
|
|
|
6
6
|
queryClient: QueryClient;
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
export const QueryClientProvider = ({ children, queryClient }: PropsWithChildren<ClientProviderProps>) =>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
);
|
|
16
|
-
};
|
|
9
|
+
export const QueryClientProvider = ({ children, queryClient }: PropsWithChildren<ClientProviderProps>) => (
|
|
10
|
+
<ReactQueryClientProvider client={queryClient}>
|
|
11
|
+
{children}
|
|
12
|
+
<ReactQueryDevtools initialIsOpen={false} />
|
|
13
|
+
</ReactQueryClientProvider>
|
|
14
|
+
);
|
|
@@ -5,7 +5,5 @@ import type { ArchitecturePrincipleRepositoryInterface } from "@Demo/domain/repo
|
|
|
5
5
|
export class GetArchitecturePrinciplesUseCase implements GetArchitecturePrinciplesUseCaseInterface {
|
|
6
6
|
public constructor(private readonly architecturePrincipleRepository: ArchitecturePrincipleRepositoryInterface) {}
|
|
7
7
|
|
|
8
|
-
public readonly execute = (): ArchitecturePrinciple[] =>
|
|
9
|
-
return this.architecturePrincipleRepository.getAll();
|
|
10
|
-
};
|
|
8
|
+
public readonly execute = (): ArchitecturePrinciple[] => this.architecturePrincipleRepository.getAll();
|
|
11
9
|
}
|
|
@@ -5,7 +5,5 @@ import type { DemoUserRepositoryInterface } from "@Demo/domain/repositories/Demo
|
|
|
5
5
|
export class GetDemoUsersUseCase implements GetDemoUsersUseCaseInterface {
|
|
6
6
|
public constructor(private readonly demoUserRepository: DemoUserRepositoryInterface) {}
|
|
7
7
|
|
|
8
|
-
public readonly execute = async (): Promise<DemoUser[]> =>
|
|
9
|
-
return this.demoUserRepository.getAll();
|
|
10
|
-
};
|
|
8
|
+
public readonly execute = async (): Promise<DemoUser[]> => this.demoUserRepository.getAll();
|
|
11
9
|
}
|
|
@@ -27,7 +27,5 @@ export class StaticArchitecturePrincipleRepository implements ArchitecturePrinci
|
|
|
27
27
|
},
|
|
28
28
|
];
|
|
29
29
|
|
|
30
|
-
public readonly getAll = (): ArchitecturePrinciple[] =>
|
|
31
|
-
return this.architecturePrinciples;
|
|
32
|
-
};
|
|
30
|
+
public readonly getAll = (): ArchitecturePrinciple[] => this.architecturePrinciples;
|
|
33
31
|
}
|
|
@@ -5,13 +5,11 @@ import { Link } from "react-router";
|
|
|
5
5
|
|
|
6
6
|
import classes from "./DemoFooter.module.css";
|
|
7
7
|
|
|
8
|
-
export const DemoFooter = () =>
|
|
9
|
-
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
);
|
|
17
|
-
};
|
|
8
|
+
export const DemoFooter = () => (
|
|
9
|
+
<div className={classes.container}>
|
|
10
|
+
<hr />
|
|
11
|
+
<Link to={demoAppRoutes.home}>
|
|
12
|
+
<Logo size="50px" src={logo} alt="logo" />
|
|
13
|
+
</Link>
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
@@ -6,20 +6,18 @@ import { Link } from "react-router";
|
|
|
6
6
|
|
|
7
7
|
import classes from "./DemoHeader.module.css";
|
|
8
8
|
|
|
9
|
-
export const DemoHeader = () =>
|
|
10
|
-
|
|
11
|
-
<
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
);
|
|
25
|
-
};
|
|
9
|
+
export const DemoHeader = () => (
|
|
10
|
+
<div className={classes.container}>
|
|
11
|
+
<Link to={demoAppRoutes.home}>
|
|
12
|
+
<Logo size="50px" src={logo} alt="logo" />
|
|
13
|
+
</Link>
|
|
14
|
+
<DemoNavigation
|
|
15
|
+
links={[
|
|
16
|
+
{ label: "Overview", url: demoAppRoutes.home },
|
|
17
|
+
{ label: "React Query", url: demoAppRoutes.reactQuery },
|
|
18
|
+
{ label: "React Hook Form", url: demoAppRoutes.reactHookForm },
|
|
19
|
+
{ label: "Dependency Injection", url: demoAppRoutes.dependencyInjection },
|
|
20
|
+
]}
|
|
21
|
+
/>
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
%inputStyle {
|
|
9
|
-
margin: 10px;
|
|
10
9
|
padding: 10px;
|
|
10
|
+
margin: 10px;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.inputStyle {
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
border-radius: 2px;
|
|
22
22
|
|
|
23
23
|
&:focus {
|
|
24
|
-
border: 2px solid red;
|
|
25
24
|
outline: none !important;
|
|
25
|
+
border: 2px solid red;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -6,6 +6,6 @@ type LogoProps = {
|
|
|
6
6
|
size?: string;
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
export const Logo = ({ src, alt, size = "80px" }: LogoProps) =>
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
export const Logo = ({ src, alt, size = "80px" }: LogoProps) => (
|
|
10
|
+
<img className={classes.logoStyle} style={{ width: size }} src={src} alt={alt} />
|
|
11
|
+
);
|
|
@@ -3,10 +3,8 @@ import { DemoHeader } from "@Demo/ui/components/DemoHeader/DemoHeader";
|
|
|
3
3
|
import { MainTemplate } from "@Demo/ui/layouts/MainTemplate/MainTemplate";
|
|
4
4
|
import { Outlet } from "react-router";
|
|
5
5
|
|
|
6
|
-
export const DemoLayout = () =>
|
|
7
|
-
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
);
|
|
12
|
-
};
|
|
6
|
+
export const DemoLayout = () => (
|
|
7
|
+
<MainTemplate headerProps={{ leftComponents: <DemoHeader /> }} footerProps={{ footerContent: <DemoFooter /> }}>
|
|
8
|
+
<Outlet />
|
|
9
|
+
</MainTemplate>
|
|
10
|
+
);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
.mainTemplateStyle {
|
|
2
2
|
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
3
|
flex-direction: column;
|
|
4
|
+
min-height: 100%;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
.header {
|
|
8
8
|
display: flex;
|
|
9
|
-
|
|
9
|
+
gap: 16px;
|
|
10
10
|
align-items: center;
|
|
11
11
|
justify-content: space-between;
|
|
12
|
-
|
|
12
|
+
padding: 16px;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.main {
|
|
@@ -12,15 +12,13 @@ type MainTemplateProps = {
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
export const MainTemplate = ({ headerProps, footerProps, children }: PropsWithChildren<MainTemplateProps>) =>
|
|
16
|
-
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
);
|
|
26
|
-
};
|
|
15
|
+
export const MainTemplate = ({ headerProps, footerProps, children }: PropsWithChildren<MainTemplateProps>) => (
|
|
16
|
+
<div className={classes.mainTemplateStyle}>
|
|
17
|
+
<header className={classes.header}>
|
|
18
|
+
{headerProps.leftComponents}
|
|
19
|
+
{headerProps.rightComponents}
|
|
20
|
+
</header>
|
|
21
|
+
<main className={classes.main}>{children}</main>
|
|
22
|
+
<footer className={classes.footer}>{footerProps.footerContent}</footer>
|
|
23
|
+
</div>
|
|
24
|
+
);
|