diff --git a/.gitignore b/.gitignore index 225ed9c..a1ca6fe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,36 +1,7 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# next.js -/.next/ -/out/ -public/sitemap.xml -.vercel - -# production -/build -*.xml -# rss feed -/public/feed.xml - -# misc -.DS_Store - -# debug -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# local env files -.env.local -.env.development.local -.env.test.local -.env.production.local \ No newline at end of file +/nbproject/ +/.idea/* +*.tmlanguage.cache +*.tmPreferences.cache +*.stTheme.cache +*.sublime-workspace +*.sublime-project diff --git a/components/LayoutWrapper.js b/components/LayoutWrapper.js index 60c5b83..1edd81f 100644 --- a/components/LayoutWrapper.js +++ b/components/LayoutWrapper.js @@ -12,7 +12,7 @@ const LayoutWrapper = ({ children }) => { return (
-
+
@@ -63,7 +63,7 @@ const LayoutWrapper = ({ children }) => {
-
{children}
+
{children}
diff --git a/components/SectionContainer.js b/components/SectionContainer.js index 6758473..13d4903 100644 --- a/components/SectionContainer.js +++ b/components/SectionContainer.js @@ -1,3 +1,3 @@ export default function SectionContainer({ children }) { - return
{children}
+ return
{children}
} diff --git a/components/ShopByCategory.js b/components/ShopByCategory.js new file mode 100644 index 0000000..65c3fca --- /dev/null +++ b/components/ShopByCategory.js @@ -0,0 +1,59 @@ +import Link from './Link' +import PropTypes from 'prop-types' + +export default function ShopByCategory({ + title = 'SHOP BY CATEGORY', + categories = [], + buttonText = 'SHOP ALL', + buttonLink = '/shop', +}) { + return ( +
+
{title}
+ +
+ {categories.map((category, index) => ( +
+ {category.name} +
{category.name}
+
+ ))} +
+ + {buttonText && ( +
+ + + +
+ )} +
+ ) +} + +ShopByCategory.propTypes = { + title: PropTypes.string, + categories: PropTypes.arrayOf( + PropTypes.shape({ + name: PropTypes.string.isRequired, + image: PropTypes.string.isRequired, + }) + ), + buttonText: PropTypes.string, + buttonLink: PropTypes.string, +} diff --git a/pages/index.js b/pages/index.js index 34a852a..25430f3 100644 --- a/pages/index.js +++ b/pages/index.js @@ -6,6 +6,7 @@ import { getAllFilesFrontMatter } from '@/lib/mdx' import formatDate from '@/lib/utils/formatDate' import NewsletterForm from '@/components/NewsletterForm' +import ShopByCategory from '@/components/ShopByCategory' const MAX_DISPLAY = 5 @@ -96,6 +97,33 @@ export default function Home({ posts }) { )} + ) }