File tree 5 files changed +39
-34
lines changed
5 files changed +39
-34
lines changed Original file line number Diff line number Diff line change
1
+ const prod = process . env . NODE_ENV === 'production' ;
2
+
3
+ const URL = '/value-driven-templates' ;
4
+
5
+ module . exports = {
6
+ 'process.env.BACKEND_URL' : prod ? URL : '' ,
7
+ 'process.env.ASSET_PREFIX' : URL ,
8
+ } ;
Original file line number Diff line number Diff line change 1
1
const withSass = require ( '@zeit/next-sass' ) ;
2
2
const withLess = require ( '@zeit/next-less' ) ;
3
3
4
+ const webpack = require ( 'webpack' ) ;
5
+
6
+ const isProd = ( process . env . NODE_ENV || 'production' ) === 'production' ;
7
+
8
+ const assetPrefix = isProd ? '/value-driven-templates' : '' ;
9
+
4
10
if ( typeof require !== 'undefined' ) {
5
11
require . extensions [ '.less' ] = ( ) => { } ;
6
12
}
7
13
8
14
module . exports = withLess (
9
15
withSass ( {
16
+ assetPrefix,
10
17
lessLoaderOptions : {
11
18
javascriptEnabled : true ,
12
19
} ,
20
+ webpack : ( config ) => {
21
+ config . plugins . push (
22
+ new webpack . DefinePlugin ( {
23
+ 'process.env.ASSET_PREFIX' : JSON . stringify ( assetPrefix ) ,
24
+ } )
25
+ ) ;
26
+
27
+ return config ;
28
+ } ,
13
29
} )
14
30
) ;
Original file line number Diff line number Diff line change
1
+ export enum AppRoute {
2
+ HOME = '' ,
3
+ ABOUT = '/about' ,
4
+ HOW_TO_CONTRIBUTE = '/how-to-contribute' ,
5
+ }
6
+
7
+ export const getLink = ( route : AppRoute ) => `${ process . env . ASSET_PREFIX } /${ route } ` ;
Original file line number Diff line number Diff line change 9
9
NavigationItem ,
10
10
NavigationLink ,
11
11
} from './navigation.styles' ;
12
+ import { AppRoute } from '../../router/app-routes' ;
12
13
13
14
export const Navigation = ( ) => {
14
15
const { isMobile } = useDeviceDetect ( ) ;
@@ -20,18 +21,22 @@ export const Navigation = () => {
20
21
21
22
return (
22
23
< StyledNavigation >
23
- < Logo > value driven templates</ Logo >
24
+ < Link href = { AppRoute . HOME } >
25
+ < a >
26
+ < Logo > value driven templates</ Logo >
27
+ </ a >
28
+ </ Link >
24
29
{ isMobile ? (
25
30
< Hamburger active = { isMobileMenuVisible } onClick = { onMobileMenuClick } />
26
31
) : (
27
32
< ItemList >
28
33
< NavigationItem >
29
- < Link href = "/about" >
34
+ < Link href = { AppRoute . ABOUT } >
30
35
< NavigationLink > About</ NavigationLink >
31
36
</ Link >
32
37
</ NavigationItem >
33
38
< NavigationItem >
34
- < Link href = "/how-to-contribute" >
39
+ < Link href = { AppRoute . HOW_TO_CONTRIBUTE } >
35
40
< NavigationLink > How to contribute</ NavigationLink >
36
41
</ Link >
37
42
</ NavigationItem >
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments