mirror of
https://github.com/vercel/commerce.git
synced 2025-05-15 14:06:59 +00:00
nav: style info & filters
This commit is contained in:
parent
d921641585
commit
83ac1a8356
@ -1,14 +1,16 @@
|
|||||||
import { TypesNav } from '/components/home';
|
import { HomeNav } from '/components/home';
|
||||||
|
|
||||||
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
export default function HomeLayout({ children }) {
|
export default function HomeLayout({ children }) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<header>
|
<header>
|
||||||
<nav>
|
<nav>
|
||||||
<TypesNav />
|
<HomeNav />
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
<main>{children}</main>
|
<main className={styles.main}>{children}</main>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
3
app/(home)/styles.module.scss
Normal file
3
app/(home)/styles.module.scss
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
.main {
|
||||||
|
padding: 0 60px;
|
||||||
|
}
|
@ -7,16 +7,16 @@ const CenturyNovaSB = localFont({
|
|||||||
src: [
|
src: [
|
||||||
{
|
{
|
||||||
path: '../fonts/CenturyNovaSBRoman/font.woff',
|
path: '../fonts/CenturyNovaSBRoman/font.woff',
|
||||||
weight: '400',
|
weight: '300',
|
||||||
style: 'normal',
|
style: 'normal',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '../fonts/CenturyNovaSBItalic/font.woff',
|
path: '../fonts/CenturyNovaSBItalic/font.woff',
|
||||||
weight: '400',
|
weight: '300',
|
||||||
style: 'italic',
|
style: 'italic',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
variable: '--font-century-nova-sb',
|
variable: '--font-century-nova',
|
||||||
});
|
});
|
||||||
const Dia = localFont({
|
const Dia = localFont({
|
||||||
src: [
|
src: [
|
||||||
|
@ -10,6 +10,5 @@
|
|||||||
a,
|
a,
|
||||||
a:visited {
|
a:visited {
|
||||||
color: colors.$black;
|
color: colors.$black;
|
||||||
text-decoration: none;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import Image from 'next/image';
|
|||||||
import { getCollectionProducts, getMenu } from 'lib/shopify';
|
import { getCollectionProducts, getMenu } from 'lib/shopify';
|
||||||
|
|
||||||
import { PriceRanges } from '/components/price.js';
|
import { PriceRanges } from '/components/price.js';
|
||||||
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
export async function HomeProduct({ product }) {
|
export async function HomeProduct({ product }) {
|
||||||
const featuredImage = product?.images?.[0];
|
const featuredImage = product?.images?.[0];
|
||||||
@ -65,15 +66,29 @@ export async function HomeProductsList({ collection }) {
|
|||||||
export async function TypesNav() {
|
export async function TypesNav() {
|
||||||
const typesMenu = await getMenu('types-nav');
|
const typesMenu = await getMenu('types-nav');
|
||||||
|
|
||||||
// console.log({ typesMenu });
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ul>
|
<p className={styles.typesNav}>
|
||||||
{typesMenu?.map(menuItem => (
|
<span className='filter'>Filter: </span>
|
||||||
<li key={menuItem?.path}>
|
{typesMenu?.map((menuItem, i) => (
|
||||||
<Link href={menuItem?.path}>{menuItem?.title}</Link>
|
<span key={menuItem?.path}>
|
||||||
</li>
|
<Link
|
||||||
|
href={menuItem?.path}
|
||||||
|
className='link'
|
||||||
|
>{`${menuItem?.title}`}</Link>
|
||||||
|
<span className='not-link'>{`${
|
||||||
|
i == typesMenu.length - 1 ? '.' : ','
|
||||||
|
} `}</span>
|
||||||
|
</span>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</p>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const HomeNav = () => (
|
||||||
|
<div className={styles.homeNav}>
|
||||||
|
<Link href='/information' className='information'>
|
||||||
|
Information
|
||||||
|
</Link>
|
||||||
|
<TypesNav />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
31
components/home/styles.module.scss
Normal file
31
components/home/styles.module.scss
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
@use 'styles/_typography';
|
||||||
|
|
||||||
|
.homeNav {
|
||||||
|
padding: 51px 115px 22px 115px;
|
||||||
|
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 200px 1fr 200px;
|
||||||
|
align-items: baseline;
|
||||||
|
|
||||||
|
:global .information {
|
||||||
|
@include typography.header-cta;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.typesNav {
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
:global .filter {
|
||||||
|
@include typography.body;
|
||||||
|
}
|
||||||
|
|
||||||
|
:global .not-link {
|
||||||
|
@include typography.body-cta;
|
||||||
|
|
||||||
|
text-decoration-line: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
:global .link {
|
||||||
|
@include typography.body-cta;
|
||||||
|
}
|
||||||
|
}
|
92
styles/_typography.scss
Normal file
92
styles/_typography.scss
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
@mixin title {
|
||||||
|
font-family: var(--font-century-nova);
|
||||||
|
font-size: 95px;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 300;
|
||||||
|
line-height: 90px; /* 94.737% */
|
||||||
|
letter-spacing: -5.7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@mixin header {
|
||||||
|
font-family: var(--font-century-nova);
|
||||||
|
font-size: 35px;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 300;
|
||||||
|
line-height: 39px; /* 111.429% */
|
||||||
|
letter-spacing: -1.4px;
|
||||||
|
|
||||||
|
text-decoration-thickness: 5%;
|
||||||
|
text-underline-offset: 7%;
|
||||||
|
}
|
||||||
|
|
||||||
|
@mixin subheader {
|
||||||
|
font-family: var(--font-dia);
|
||||||
|
font-size: 20px;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 20px; /* 100% */
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
@mixin body {
|
||||||
|
font-family: var(--font-century-nova);
|
||||||
|
font-size: 25px;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 300;
|
||||||
|
line-height: 30px; /* 120% */
|
||||||
|
letter-spacing: -0.75px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@mixin list {
|
||||||
|
font-family: var(--font-dia);
|
||||||
|
font-size: 18px;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 100;
|
||||||
|
line-height: 19px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@mixin caption {
|
||||||
|
font-family: var(--font-dia);
|
||||||
|
font-size: 10px;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 10px; /* 100% */
|
||||||
|
letter-spacing: 0.1px;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
@mixin header-cta($decoration: underline) {
|
||||||
|
font-family: var(--font-century-nova);
|
||||||
|
font-size: 35px;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 100;
|
||||||
|
line-height: 35px; /* 100% */
|
||||||
|
letter-spacing: -1.4px;
|
||||||
|
text-decoration-line: $decoration;
|
||||||
|
|
||||||
|
text-decoration-thickness: 5%;
|
||||||
|
text-underline-offset: 7%;
|
||||||
|
}
|
||||||
|
|
||||||
|
@mixin body-cta($decoration: underline) {
|
||||||
|
font-family: var(--font-dia);
|
||||||
|
font-size: 25px;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 100;
|
||||||
|
line-height: 30px;
|
||||||
|
letter-spacing: -0.25px;
|
||||||
|
text-decoration-line: $decoration;
|
||||||
|
|
||||||
|
text-decoration-thickness: 4%;
|
||||||
|
text-underline-offset: 4%;
|
||||||
|
}
|
||||||
|
|
||||||
|
@mixin list-cta($decoration: underline) {
|
||||||
|
font-family: var(--font-dia);
|
||||||
|
font-size: 18px;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 100;
|
||||||
|
line-height: 20px; /* 111.111% */
|
||||||
|
text-transform: uppercase;
|
||||||
|
text-decoration-line: $decoration;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user