@@ -5,13 +5,21 @@ import {
5
5
Outlet ,
6
6
Scripts ,
7
7
ScrollRestoration ,
8
+ useLocation ,
8
9
} from "react-router" ;
9
10
10
- import '@mantine/core/styles.css' ;
11
- import { createTheme , MantineProvider } from '@mantine/core' ;
11
+ import "@mantine/core/styles.css" ;
12
+ import {
13
+ createTheme ,
14
+ MantineProvider ,
15
+ Container ,
16
+ Button ,
17
+ Input ,
18
+ } from "@mantine/core" ;
12
19
13
20
import type { Route } from "./+types/root" ;
14
21
import "./app.css" ;
22
+ import Header from "./components/header/header" ;
15
23
16
24
export const links : Route . LinksFunction = ( ) => [
17
25
{ rel : "preconnect" , href : "https://fonts.googleapis.com" } ,
@@ -28,6 +36,92 @@ export const links: Route.LinksFunction = () => [
28
36
29
37
const theme = createTheme ( {
30
38
/** mantine theme overrides */
39
+ colors : {
40
+ "brand-yellow" : [
41
+ "#fff9df" ,
42
+ "#fff2ca" ,
43
+ "#ffe399" ,
44
+ "#ffd463" ,
45
+ "#ffc736" ,
46
+ "#ffc01e" ,
47
+ "#ffba02" ,
48
+ "#e4a300" ,
49
+ "#cb9100" ,
50
+ "#af7c00" ,
51
+ ] ,
52
+ "custom-gray" : [
53
+ "#f5f5f4" ,
54
+ "#e7e7e7" ,
55
+ "#cdcdcd" ,
56
+ "#b2b2b2" ,
57
+ "#9a9a9a" ,
58
+ "#8b8b8b" ,
59
+ "#848484" ,
60
+ "#717171" ,
61
+ "#646464" ,
62
+ "#343231" ,
63
+ ] ,
64
+ green : [
65
+ "#e5ffe5" ,
66
+ "#cefecf" ,
67
+ "#9ffa9f" ,
68
+ "#6bf76b" ,
69
+ "#48f548" ,
70
+ "#24f324" ,
71
+ "#0df212" ,
72
+ "#00d701" ,
73
+ "#00c000" ,
74
+ "#00a600" ,
75
+ ] ,
76
+
77
+ yellow : [
78
+ "#fff9df" ,
79
+ "#fff2ca" ,
80
+ "#ffe399" ,
81
+ "#ffd463" ,
82
+ "#ffc736" ,
83
+ "#ffc01e" ,
84
+ "#ffba02" ,
85
+ "#e4a300" ,
86
+ "#cb9100" ,
87
+ "#af7c00" ,
88
+ ] ,
89
+
90
+ red : [
91
+ "#ffe7e8" ,
92
+ "#ffcece" ,
93
+ "#ff9b9b" ,
94
+ "#ff6464" ,
95
+ "#fe3736" ,
96
+ "#fe1b19" ,
97
+ "#ff0000" ,
98
+ "#e40000" ,
99
+ "#cb0000" ,
100
+ "#b20000" ,
101
+ ] ,
102
+ } ,
103
+
104
+ components : {
105
+ Button : Button . extend ( {
106
+ defaultProps : {
107
+ variant : "filled" ,
108
+ color : "brand-yellow" ,
109
+ c : "custom-gray.9" ,
110
+ } ,
111
+ } ) ,
112
+
113
+ Input : Input . extend ( { } ) ,
114
+
115
+ InputWrapper : Input . Wrapper . extend ( {
116
+ classNames : {
117
+ label : "text-white" ,
118
+ error : "text-red-500" ,
119
+ } ,
120
+ } ) ,
121
+ } ,
122
+
123
+ primaryColor : "brand-yellow" ,
124
+ primaryShade : { light : 6 , dark : 6 } ,
31
125
} ) ;
32
126
33
127
export function Layout ( { children } : { children : React . ReactNode } ) {
@@ -49,9 +143,17 @@ export function Layout({ children }: { children: React.ReactNode }) {
49
143
}
50
144
51
145
export default function App ( ) {
146
+ const location = useLocation ( ) ;
147
+ const linksWithHeader = [ "/user" ] ;
148
+
149
+ const isHeader = ( ) => {
150
+ return linksWithHeader . includes ( location . pathname ) ;
151
+ } ;
152
+
52
153
return (
53
- < MantineProvider theme = { theme } >
54
- { < Outlet /> }
154
+ < MantineProvider theme = { theme } defaultColorScheme = "dark" >
155
+ { isHeader ( ) && < Header /> }
156
+ < Container fluid > { < Outlet /> } </ Container >
55
157
</ MantineProvider >
56
158
) ;
57
159
}
0 commit comments