Skip to content

Commit

Permalink
add MaxWidth to topbar nav
Browse files Browse the repository at this point in the history
  • Loading branch information
puncsky committed Feb 18, 2021
1 parent 9529c73 commit a99e583
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 22 deletions.
4 changes: 3 additions & 1 deletion src/shared/common/styles/style-padding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export const contentPadding = {
},
};

export const maxContentWidth = { maxWidth: "1320px", width: "100%" };

export const topBottomContentPadding = {
paddingTop: "12px",
paddingBottom: "12px",
Expand All @@ -37,7 +39,7 @@ export function ContentPadding({
return (
<Pd style={style as CSSProperties}>
<Flex center width="100%">
<div style={{ maxWidth: "1320px", width: "100%" }}>{children}</div>
<div style={maxContentWidth}>{children}</div>
</Flex>
</Pd>
);
Expand Down
52 changes: 31 additions & 21 deletions src/shared/common/top-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Hamburger } from "./icons/hamburger.svg";
import { transition } from "./styles/style-animation";
import { colors } from "./styles/style-color";
import { media, PALM_WIDTH } from "./styles/style-media";
import { contentPadding } from "./styles/style-padding";
import { contentPadding, maxContentWidth } from "./styles/style-padding";

export const TOP_BAR_HEIGHT = 52;

Expand Down Expand Up @@ -55,37 +55,47 @@ export const TopBar = (): JSX.Element => {
return (
<div>
<Bar>
<Flex>
<Logo />
<CommonMargin />
<BrandText href="/">{t("topbar.brand")}</BrandText>
</Flex>
<Flex>
<Menu>{renderMenu()}</Menu>
</Flex>
<HamburgerBtn
displayMobileMenu={displayMobileMenu}
onClick={() => {
setDisplayMobileMenu(true);
}}
>
<Hamburger />
</HamburgerBtn>
<CrossBtn displayMobileMenu={displayMobileMenu}>
<Cross />
</CrossBtn>
<MaxWidth>
<Flex>
<Logo />
<CommonMargin />
<BrandText href="/">{t("topbar.brand")}</BrandText>
</Flex>
<Flex>
<Menu>{renderMenu()}</Menu>
</Flex>
<HamburgerBtn
displayMobileMenu={displayMobileMenu}
onClick={() => {
setDisplayMobileMenu(true);
}}
>
<Hamburger />
</HamburgerBtn>
<CrossBtn displayMobileMenu={displayMobileMenu}>
<Cross />
</CrossBtn>
</MaxWidth>
</Bar>
<BarPlaceholder />
{renderMobileMenu()}
</div>
);
};

const Bar = styled("nav", ({ $theme }) => ({
const MaxWidth = styled("div", () => ({
display: "flex",
flexDirection: "row",
...maxContentWidth,
justifyContent: "space-between",
alignItems: "center",
}));

const Bar = styled("nav", ({ $theme }) => ({
display: "flex",
flexDirection: "row",
justifyContent: "center",
alignItems: "center",
lineHeight: `${TOP_BAR_HEIGHT}px`,
height: `${TOP_BAR_HEIGHT}px`,
backgroundColor: $theme.colors.nav01,
Expand Down

0 comments on commit a99e583

Please sign in to comment.