Skip to content

Workshop sole&ankle #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21,209 changes: 21,178 additions & 31 deletions package-lock.json

Large diffs are not rendered by default.

22 changes: 18 additions & 4 deletions src/components/Header/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ const Header = () => {
<header>
<SuperHeader />
<MainHeader>
<Logo />
<Side>
<Logo />
</Side>
<Nav>
<NavLink href="/sale">Sale</NavLink>
<NavLink href="/new">New&nbsp;Releases</NavLink>
Expand All @@ -21,17 +23,29 @@ const Header = () => {
<NavLink href="/kids">Kids</NavLink>
<NavLink href="/collections">Collections</NavLink>
</Nav>
<Side />
</MainHeader>
</header>
);
};

const MainHeader = styled.div`
padding: 0 32px;
display: flex;
align-items: baseline;
padding: 18px 32px;
height: 72px;
border-bottom: 1px solid ${COLORS.gray[300]};
`;

const Nav = styled.nav``;
const Nav = styled.nav`
display: flex;
gap: 48px;
margin: 0px 48px;
`;

const Side = styled.div`
flex: 1;
`;

const NavLink = styled.a`
font-size: 1.125rem;
Expand All @@ -45,4 +59,4 @@ const NavLink = styled.a`
}
`;

export default Header;
export default Header;
6 changes: 5 additions & 1 deletion src/components/Select/Select.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import { FileText } from 'react-feather';
import styled from 'styled-components/macro';

import { COLORS, WEIGHTS } from '../../constants';
Expand Down Expand Up @@ -32,7 +33,10 @@ const Select = ({ label, value, children, ...delegated }) => {
);
};

const Wrapper = styled.label``;
const Wrapper = styled.label`
display: flex;
align-items: baseline;
`;

const VisibleLabel = styled.span`
color: ${COLORS.gray[700]};
Expand Down
52 changes: 48 additions & 4 deletions src/components/ShoeCard/ShoeCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,30 @@ const ShoeCard = ({
<Wrapper>
<ImageWrapper>
<Image alt="" src={imageSrc} />
{variant === 'on-sale' && <SaleFlag>Sale</SaleFlag>}
{variant === 'new-release' && (
<NewFlag>Just released!</NewFlag>
)}
</ImageWrapper>
<Spacer size={12} />
<Row>
<Name>{name}</Name>
<Price>{formatPrice(price)}</Price>
<Price
style={{
'--color':
variant === 'on-sale' ? COLORS.gray[700] : undefined,
'--text-decoration':
variant === 'on-sale' ? 'line-through' : undefined,
}}
>
{formatPrice(price)}
</Price>
</Row>
<Row>
<ColorInfo>{pluralize('Color', numOfColors)}</ColorInfo>
{variant === 'on-sale' ? (
<SalePrice>{formatPrice(salePrice)}</SalePrice>
) : undefined}
</Row>
</Wrapper>
</Link>
Expand All @@ -61,18 +77,25 @@ const ImageWrapper = styled.div`
position: relative;
`;

const Image = styled.img``;
const Image = styled.img`
width: 100%;
`;

const Row = styled.div`
font-size: 1rem;
display: flex;
justify-content: space-between;
`;

const Name = styled.h3`
font-weight: ${WEIGHTS.medium};
color: ${COLORS.gray[900]};
`;

const Price = styled.span``;
const Price = styled.span`
color: var(--color);
text-decoration: var(--text-decoration);
`;

const ColorInfo = styled.p`
color: ${COLORS.gray[700]};
Expand All @@ -83,4 +106,25 @@ const SalePrice = styled.span`
color: ${COLORS.primary};
`;

export default ShoeCard;
const Flag = styled.div`
position: absolute;
top: 12px;
right: -4px;
background: red;
height: 32px;
line-height: 32px;
padding: 0 10px;
font-size: ${14 / 18}rem;
font-weight: ${WEIGHTS.bold};
color: ${COLORS.white};
border-radius: 2px;
`;

const SaleFlag = styled(Flag)`
background-color: ${COLORS.primary};
`;
const NewFlag = styled(Flag)`
background-color: ${COLORS.secondary};
`;

export default ShoeCard;
16 changes: 13 additions & 3 deletions src/components/ShoeGrid/ShoeGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,22 @@ const ShoeGrid = () => {
return (
<Wrapper>
{SHOES.map((shoe) => (
<ShoeCard key={shoe.slug} {...shoe} />
))}
<ShoeWrapper key={shoe.slug}>
<ShoeCard {...shoe} />
</ShoeWrapper>
))}
</Wrapper>
);
};

const Wrapper = styled.div``;
const Wrapper = styled.div`
display:flex;
flex-wrap: wrap;
gap: 32px;
`;

const ShoeWrapper = styled.div`
min-width: 275px;
flex: 1;
`;
export default ShoeGrid;
22 changes: 18 additions & 4 deletions src/components/ShoeIndex/ShoeIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,27 @@ const ShoeIndex = ({ sortId, setSortId }) => {
);
};

const Wrapper = styled.div``;
const Wrapper = styled.div`
display:flex;
flex-direction: row-reverse;
gap: 32px;

const LeftColumn = styled.div``;
`;

const LeftColumn = styled.div`
flex-basis: 248px;

`;

const MainColumn = styled.div``;
const MainColumn = styled.div`
flex: 1;
`;

const Header = styled.header``;
const Header = styled.header`
display:flex;
align-items: baseline;
justify-content: space-between;
`;

const Title = styled.h2`
font-size: 1.5rem;
Expand Down
6 changes: 6 additions & 0 deletions src/components/SuperHeader/SuperHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,16 @@ const Wrapper = styled.div`
font-size: 0.875rem;
color: ${COLORS.gray[300]};
background-color: ${COLORS.gray[900]};
display: flex;
height: 40px;
align-items: center;
padding: 0 32px;
gap: 24px;
`;

const MarketingMessage = styled.span`
color: ${COLORS.white};
margin-right: auto;
`;

const HelpLink = styled.a`
Expand Down