-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Josh Habdas <jhabdas@protonmail.com>
- Loading branch information
Josh Habdas
committed
Apr 5, 2021
1 parent
0793f21
commit bcf17cd
Showing
10 changed files
with
176 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
build/* | ||
node_modules/* | ||
reports/* | ||
/**/*.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"trailingComma": "all", | ||
"tabWidth": 2, | ||
"semi": true, | ||
"singleQuote": false, | ||
"bracketSpacing": true, | ||
"arrowParens": "always" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import React from "react"; | ||
import inject from "hocs/inject"; | ||
import AppBar from "@material-ui/core/AppBar"; | ||
import Hidden from "@material-ui/core/Hidden"; | ||
import Toolbar from "@material-ui/core/Toolbar"; | ||
import Typography from "@material-ui/core/Typography"; | ||
import { createStyles, withStyles } from "@material-ui/core/styles"; | ||
import { NavigationDesktop } from "components/NavigationDesktop"; | ||
import { | ||
NavigationMobile, | ||
NavigationToggleMobile, | ||
} from "components/NavigationMobile"; | ||
import LocaleDropdown from "components/LocaleDropdown"; | ||
import AccountDropdown from "components/AccountDropdown"; | ||
import ShopLogo from "@reactioncommerce/components/ShopLogo/v1"; | ||
import Link from "components/Link"; | ||
import MiniCart from "components/MiniCart"; | ||
|
||
import type { FC } from "react"; | ||
import type { WithStyles, Theme } from "@material-ui/core"; | ||
|
||
const styles = (theme: Theme) => | ||
createStyles({ | ||
appBar: { | ||
backgroundColor: theme.palette.reaction.white, | ||
borderBottom: `solid 1px ${theme.palette.reaction.black05}`, | ||
color: theme.palette.reaction.coolGrey500, | ||
}, | ||
controls: { | ||
alignItems: "inherit", | ||
display: "inherit", | ||
flex: 1, | ||
}, | ||
title: { | ||
color: theme.palette.reaction.reactionBlue, | ||
marginRight: theme.spacing(), | ||
borderBottom: `solid 5px ${theme.palette.reaction.reactionBlue200}`, | ||
}, | ||
toolbar: { | ||
alignItems: "center", | ||
display: "flex", | ||
justifyContent: "space-between", | ||
}, | ||
}); | ||
|
||
interface HeaderProps extends WithStyles<typeof styles> { | ||
shop: { | ||
name: string; | ||
}; | ||
uiStore: { | ||
toggleMenuDrawerOpen: Function; | ||
}; | ||
viewer: any; | ||
} | ||
|
||
const Header: FC<HeaderProps> = ({ classes, shop, uiStore }) => { | ||
const handleNavigationToggleClick = () => { | ||
uiStore.toggleMenuDrawerOpen(); | ||
}; | ||
return ( | ||
<AppBar position="static" elevation={0} className={classes.appBar}> | ||
<Toolbar className={classes.toolbar}> | ||
<Hidden mdUp> | ||
<NavigationToggleMobile onClick={handleNavigationToggleClick} /> | ||
</Hidden> | ||
|
||
<div className={classes.controls}> | ||
<Typography className={classes.title} color="inherit" variant="h6"> | ||
{/* @ts-ignore TODO: Refactor link to address type error */} | ||
<Link route="/"> | ||
{shop ? <ShopLogo shopName={shop.name} /> : "Example Storefront"} | ||
</Link> | ||
</Typography> | ||
|
||
<Hidden smDown initialWidth={"md"}> | ||
<NavigationDesktop /> | ||
</Hidden> | ||
</div> | ||
|
||
<LocaleDropdown /> | ||
|
||
<AccountDropdown /> | ||
<MiniCart /> | ||
</Toolbar> | ||
<NavigationMobile shop={shop} /> | ||
</AppBar> | ||
); | ||
}; | ||
|
||
export default withStyles(styles)(inject("uiStore")(Header)); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "esnext", | ||
"lib": ["dom", "dom.iterable", "esnext"], | ||
"allowJs": true, | ||
"skipLibCheck": true, | ||
"strict": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"importsNotUsedAsValues": "error", | ||
"noEmit": true, | ||
"esModuleInterop": true, | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"jsx": "preserve", | ||
"baseUrl": "." | ||
}, | ||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "./types/**/*"], | ||
"exclude": ["node_modules"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import "@material-ui/core/styles/createPalette"; | ||
|
||
declare module "@material-ui/core/styles/createPalette" { | ||
interface Palette { | ||
reaction: any; | ||
} | ||
interface PaletteOptions { | ||
reaction?: any; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
declare module "@reactioncommerce/components/ShopLogo/v1"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters