File tree Expand file tree Collapse file tree 5 files changed +62
-10
lines changed Expand file tree Collapse file tree 5 files changed +62
-10
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ import { useState } from 'react';
5
5
import SearchResults from './SearchResults.component' ;
6
6
7
7
const searchClient = algoliasearch (
8
- process . env . ALGOLIA_APP_ID ,
9
- process . env . ALGOLIA_PUBLIC_API_KEY
8
+ process . env . NEXT_PUBLIC_ALGOLIA_APP_ID ,
9
+ process . env . NEXT_PUBLIC_ALGOLIA_PUBLIC_API_KEY
10
10
) ;
11
11
12
12
/**
@@ -16,7 +16,7 @@ const MobileSearch = () => {
16
16
const [ search , setSearch ] = useState ( null ) ;
17
17
const [ hasFocus , sethasFocus ] = useState ( false ) ;
18
18
return (
19
- < div className = "inline mt-4" >
19
+ < div className = "inline mt-4 md:hidden " >
20
20
< InstantSearch
21
21
indexName = { process . env . NEXT_PUBLIC_ALGOLIA_INDEX_NAME }
22
22
searchClient = { searchClient }
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ const Cart = () => {
18
18
< >
19
19
< Link href = "/handlekurv" >
20
20
< a
21
- className = "inline-block pl-4 mt-4 no-underline"
21
+ className = "pl-4 mt-4 no-underline inline-block "
22
22
aria-label = "Handlekurv"
23
23
>
24
24
< svg
Original file line number Diff line number Diff line change
1
+ import Link from 'next/link' ;
2
+
3
+ import Cart from '../Cart/Cart.component' ;
4
+ import Search from '../AlgoliaSearch/AlgoliaSearchBox.component' ;
5
+ import SVGMobileSearchIcon from '../SVG/SVGMobileSearchIcon.component' ;
6
+
7
+ import Hamburger from '../Header/Hamburger.component' ;
8
+
9
+ /**
10
+ * Navigation for the application.
11
+ * Includes mobile menu.
12
+ */
13
+ const Stickynav = ( ) => (
14
+ < nav
15
+ id = "footer"
16
+ className = "fixed bottom-0 z-50 w-full py-1 bg-white md:hidden lg:hidden xl:hidden"
17
+ >
18
+ < div className = "container flex flex-wrap items-center justify-between px-6 py-3 mx-auto mt-0 md:min-w-96" >
19
+ < Hamburger />
20
+ < div
21
+ className = "order-3 hidden w-full md:flex md:items-center md:w-auto md:order-1"
22
+ id = "menu"
23
+ >
24
+ < ul className = "items-center justify-between pt-4 text-base text-gray-700 md:flex md:pt-0" >
25
+ < li >
26
+ < Link href = "/produkter" >
27
+ < a className = "inline-block py-2 pr-4 text-xl font-bold no-underline hover:underline" >
28
+ Produkter
29
+ </ a >
30
+ </ Link >
31
+ </ li >
32
+ < li >
33
+ < Link href = "/kategorier" >
34
+ < a className = "inline-block py-2 pr-4 text-xl font-bold no-underline hover:underline" >
35
+ Kategorier
36
+ </ a >
37
+ </ Link >
38
+ </ li >
39
+ </ ul >
40
+ </ div >
41
+ < div className = "flex items-center order-2 md:order-3" id = "nav-content" >
42
+ < Search />
43
+ < SVGMobileSearchIcon />
44
+ < Cart />
45
+ </ div >
46
+ </ div >
47
+ </ nav >
48
+ ) ;
49
+
50
+ export default Stickynav ;
Original file line number Diff line number Diff line change @@ -2,20 +2,18 @@ import Link from 'next/link';
2
2
3
3
import Cart from '../Cart/Cart.component' ;
4
4
import Search from '../AlgoliaSearch/AlgoliaSearchBox.component' ;
5
- import SVGMobileSearchIcon from '../SVG/SVGMobileSearchIcon.component' ;
5
+ import MobileSearch from '../AlgoliaSearch/MobileSearch.component' ;
6
+
6
7
7
- import Hamburger from './Hamburger.component' ;
8
8
9
9
/**
10
10
* Navigation for the application.
11
11
* Includes mobile menu.
12
12
*/
13
13
const Navbar = ( ) => (
14
14
< header >
15
- < nav id = "header" className = "fixed top-0 z-50 w-full py-1 bg-white " >
15
+ < nav id = "header" className = "top-0 z-50 w-full py-1 bg-white " >
16
16
< div className = "container flex flex-wrap items-center justify-between px-6 py-3 mx-auto mt-0 md:min-w-96" >
17
- < Hamburger />
18
-
19
17
< div
20
18
className = "order-3 hidden w-full md:flex md:items-center md:w-auto md:order-1"
21
19
id = "menu"
@@ -59,7 +57,9 @@ const Navbar = () => (
59
57
</ div >
60
58
< div className = "flex items-center order-2 md:order-3" id = "nav-content" >
61
59
< Search />
62
- < SVGMobileSearchIcon />
60
+
61
+ < MobileSearch />
62
+
63
63
< Cart />
64
64
</ div >
65
65
</ div >
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import Router from 'next/router';
5
5
import NProgress from 'nprogress' ;
6
6
7
7
import Footer from 'components/Footer/Footer.component' ;
8
+ import Stickynav from 'components/Footer/Stickynav.component' ;
8
9
9
10
import 'styles/index.css' ;
10
11
import 'styles/animate.min.css' ;
@@ -21,6 +22,7 @@ const App = ({ Component, pageProps }) => (
21
22
< AppProvider >
22
23
< Component { ...pageProps } />
23
24
< Footer />
25
+ < Stickynav />
24
26
</ AppProvider >
25
27
</ ApolloProvider >
26
28
) ;
You can’t perform that action at this time.
0 commit comments