File tree 4 files changed +27
-15
lines changed
packages/data-visualizer/src
4 files changed +27
-15
lines changed Original file line number Diff line number Diff line change 8
8
" firebase.json" ,
9
9
" **/.*" ,
10
10
" **/node_modules/**"
11
+ ],
12
+ "rewrites" : [
13
+ {
14
+ "source" : " **" ,
15
+ "destination" : " /index.html"
16
+ }
11
17
]
12
18
},
13
19
"emulators" : {
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ interface Props {
7
7
const Modal : FunctionalComponent < Props > = ( { close, children } ) => {
8
8
return (
9
9
< div
10
- className = "fixed top-0 left-0 w-screen h-screen flex items-center justify-center backdrop-filter backdrop-blur-sm"
10
+ className = "fixed top-0 left-0 w-screen h-screen flex items-center justify-center backdrop-filter backdrop-blur-sm z-50 "
11
11
onClick = { close } >
12
12
< div className = "bg-white p-4 pt-10 rounded-lg text-black relative" >
13
13
< button
Original file line number Diff line number Diff line change @@ -9,26 +9,33 @@ import { UserContext } from '../contexts/User/UserContext'
9
9
10
10
import { routeComponents } from './Router'
11
11
12
+ const className = ( activated : boolean ) =>
13
+ activated ? 'text-primary' : 'text-black hover:text-primary cursor-pointer'
14
+
12
15
const Layout : FunctionComponent = ( { children } ) => {
13
16
const { userState } = useContext ( UserContext )
14
17
const { usageState } = useContext ( UsageContext )
15
18
16
19
return (
17
20
< div className = "flex justify-start" >
18
- < div className = "hidden md:block w-40 min-w-40 bg-secondary text-center h-screen pt-10" >
21
+ < div className = "hidden md:block w-40 min-w-40 bg-white text-center h-screen pt-10" >
19
22
{ Object . entries ( routeComponents ) . map ( ( [ key , value ] ) => {
20
23
if ( ! value . label ) return null
21
24
return (
22
25
< div className = "pt-5 text-sm" key = { key } >
23
- < Link
24
- className = {
25
- window . location . pathname === key
26
- ? 'text-primary'
27
- : 'text-black hover:text-primary cursor-pointer'
28
- }
29
- href = { key } >
30
- { value . label }
31
- </ Link >
26
+ { value . external ? (
27
+ < div
28
+ className = { className ( false ) }
29
+ onClick = { ( ) => window . open ( value . external , '_blank' ) } >
30
+ { value . label }
31
+ </ div >
32
+ ) : (
33
+ < Link
34
+ className = { className ( window . location . pathname === key ) }
35
+ href = { key } >
36
+ { value . label }
37
+ </ Link >
38
+ ) }
32
39
</ div >
33
40
)
34
41
} ) }
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ export const routeComponents: {
26
26
requireAuth ?: boolean
27
27
component : FunctionComponent
28
28
label ?: string
29
+ external ?: string
29
30
}
30
31
} = {
31
32
[ ROUTES . DASHBOARD ] : {
@@ -47,10 +48,8 @@ export const routeComponents: {
47
48
[ ROUTES . ABOUT ] : {
48
49
requireAuth : true ,
49
50
label : 'About' ,
50
- component : ( ) => {
51
- window . open ( 'https://climate.jesper.no/about' , '_blank' )
52
- return null
53
- }
51
+ external : 'https://climate.jesper.no/about' ,
52
+ component : ( ) => null
54
53
} ,
55
54
[ ROUTES . SIGN_OUT ] : {
56
55
requireAuth : false ,
You can’t perform that action at this time.
0 commit comments