Skip to content

Commit 1eae6f0

Browse files
committed
added info banner for JamStackBox
1 parent f0c0cce commit 1eae6f0

File tree

3 files changed

+59
-18
lines changed

3 files changed

+59
-18
lines changed

README.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This starter also includes credentials to a Shopify demo store so you can try it
1313

1414
If you have questions feel free to message me on [Twitter](https://twitter.com/alexanderhorl) 🤙🏻
1515

16-
Checkout [nureineburg.netlify.app](https://nureineburg.netlify.app) for a real public shop built with this starter, the code is also [public](https://github.com/AlexanderProd/nureineburg.de/).
16+
Checkout [nureineburg.alexanderhoerl.de](https://nureineburg.alexanderhoerl.de) for a real public shop built with this starter, the code is also [public](https://github.com/AlexanderProd/nureineburg.de/).
1717

1818
## 💎 Features
1919

@@ -27,9 +27,11 @@ Checkout [nureineburg.netlify.app](https://nureineburg.netlify.app) for a real p
2727
- SEO
2828

2929
### 📦 Dynamic Inventory Checking
30+
3031
The Shopify product inventory is being checked in realtime, therefore no rebuilding and redeploy is needed when a product goes out of stock. This avoids problems where products could still be available even though they're out of stock due to redeploy delay.
3132

3233
### 🖌 Styling
34+
3335
I'm using [Emotion](https://emotion.sh/docs/introduction) as styled components library, but the starter is purposely only sparsely styled so you don't have to remove unecessary code but can instead add your own styling immediately.
3436

3537
## ⚠️ Common problems
@@ -65,12 +67,12 @@ I'm using [Emotion](https://emotion.sh/docs/introduction) as styled components l
6567
6668
Open the `my-shopify-store` directory in your code editor of choice and edit `src/pages/index.js`. Save your changes and the browser will update in real time!
6769
68-
1. **Connect your own Shopify store.**
70+
1. **Connect your own Shopify store.**
6971
7072
Open both `.env` files located in the root directory of your page end replace the credentials with your own. Don't forget to restart Gatsby for your store to be loaded!
7173

7274
⚠️ Make sure to use the Shopify storefront API credentials, not the regular Shopify API!
73-
75+
7476
## Deploy
7577

7678
Checkout my other open-source project [JAMStackBox](https://github.com/AlexanderProd/jam-stack-box) to continuously deploy your Gatsby site on your own server.
@@ -86,9 +88,10 @@ Looking for more guidance? Full documentation for Gatsby lives [on the website](
8688
## 📌 ToDo
8789

8890
I'll happily merge any pull request to improve the starter. 🙂
89-
- [X] Convert Layout to function component.
90-
- [X] Add dynamic inventory checking to avoid re-building after every purchase.
91-
- [X] Add better styling.
92-
- [X] Add image optimization using Gatsby sharp plugin.
93-
- [X] Convert ProductForm to function component.
91+
92+
- [x] Convert Layout to function component.
93+
- [x] Add dynamic inventory checking to avoid re-building after every purchase.
94+
- [x] Add better styling.
95+
- [x] Add image optimization using Gatsby sharp plugin.
96+
- [x] Convert ProductForm to function component.
9497
<!-- AUTO-GENERATED-CONTENT:END -->

src/components/Navigation/index.js

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import reduce from 'lodash/reduce'
33
import PropTypes from 'prop-types'
44

55
import StoreContext from '~/context/StoreContext'
6-
import { CartCounter, Container, MenuLink, Wrapper } from './styles'
6+
import { CartCounter, Container, InfoBanner, MenuLink, Wrapper } from './styles'
77

88
const useQuantity = () => {
99
const {
@@ -18,15 +18,27 @@ const Navigation = ({ siteTitle }) => {
1818
const [hasItems, quantity] = useQuantity()
1919

2020
return (
21-
<Wrapper>
22-
<Container>
23-
<MenuLink to="/">{siteTitle}</MenuLink>
24-
<MenuLink to="/cart">
25-
{hasItems && <CartCounter>{quantity}</CartCounter>}
26-
Cart 🛍
27-
</MenuLink>
28-
</Container>
29-
</Wrapper>
21+
<>
22+
<InfoBanner>
23+
Check out my open source Project{' '}
24+
<a
25+
href="https://github.com/AlexanderProd/jam-stack-box"
26+
target="_blank"
27+
>
28+
JAMStackBox
29+
</a>{' '}
30+
to continuosly deploy Gatsby sites on your own.
31+
</InfoBanner>
32+
<Wrapper>
33+
<Container>
34+
<MenuLink to="/">{siteTitle}</MenuLink>
35+
<MenuLink to="/cart">
36+
{hasItems && <CartCounter>{quantity}</CartCounter>}
37+
Cart 🛍
38+
</MenuLink>
39+
</Container>
40+
</Wrapper>
41+
</>
3042
)
3143
}
3244

src/components/Navigation/styles.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,29 @@ export const CartCounter = styled.span`
3838
margin: -10px;
3939
z-index: 20;
4040
`
41+
42+
export const InfoBanner = styled.div`
43+
align-items: center;
44+
justify-content: space-between;
45+
padding-top: 0.5rem;
46+
padding-bottom: 0.5rem;
47+
padding-left: 2.5rem;
48+
padding-right: 2.5rem;
49+
background-color: #eb5ebf;
50+
text-align: center;
51+
color: white;
52+
53+
a {
54+
color: white;
55+
}
56+
57+
svg {
58+
cursor: pointer;
59+
}
60+
61+
@media (max-width: ${breakpoints.s}px) {
62+
& > :first-of-type {
63+
margin-right: 0.5rem;
64+
}
65+
}
66+
`

0 commit comments

Comments
 (0)