Skip to content
This repository was archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
add dashboard nav link
Browse files Browse the repository at this point in the history
  • Loading branch information
joshnies committed Aug 5, 2021
1 parent 25604e0 commit df67eab
Show file tree
Hide file tree
Showing 10 changed files with 114 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
}
]
],
"plugins": ["@emotion/babel-plugin"]
"plugins": ["@emotion/babel-plugin", "inline-react-svg"]
}
2 changes: 1 addition & 1 deletion .storybook/.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
}
]
],
"plugins": ["@emotion/babel-plugin"]
"plugins": ["@emotion/babel-plugin", "inline-react-svg"]
}
4 changes: 4 additions & 0 deletions components/avatar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** User's avatar. */
export default function Avatar() {
return <></>;
}
2 changes: 1 addition & 1 deletion components/hamburger-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default function HamburgerButton(props: {
outline: 'none',
border: 'none',
cursor: 'pointer',
margin: '0 40px 0 0',
margin: 0,
[`@media (min-width: ${theme.breakpoints.sm.max})`]: {
display: 'none',
},
Expand Down
5 changes: 5 additions & 0 deletions components/nav-drawer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useTheme } from '@geist-ui/react';
import { ArrowUpRight } from '@geist-ui/react-icons';

import NavDrawerItem from './nav-drawer-item';
import routes from '../routes';
Expand All @@ -25,6 +26,10 @@ export default function NavDrawer() {
<NavDrawerItem to={routes.blog} newTab>
blog
</NavDrawerItem>
<NavDrawerItem to={routes.dash}>
go to dashboard{' '}
<ArrowUpRight size={18} color="white" css={{ marginTop: 5 }} />
</NavDrawerItem>
</ul>
);
}
19 changes: 18 additions & 1 deletion components/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import { useState } from 'react';
import Link from 'next/link';
import { useTheme } from '@geist-ui/react';
import styled from '@emotion/styled';
import { ArrowUpRight } from '@geist-ui/react-icons';

import HamburgerButton from './hamburger-button';
import NavItem from './nav-item';
import NavDrawer from './nav-drawer';
import Avatar from './avatar';
import routes from '../routes';

/**
Expand Down Expand Up @@ -81,7 +83,22 @@ export default function Navbar(props: { activeRoute?: string }) {
contact us
</DynamicNavItem>
</ul>
<HamburgerButton active={showDrawer} onClick={toggleDrawer} />
<div
css={{
display: 'flex',
justifyContent: 'right',
alignItems: 'center',
width: '100%',
marginRight: 40,
}}
>
<DynamicNavItem to={routes.dash} activeRoute={props.activeRoute}>
go to dashboard{' '}
<ArrowUpRight size={18} color="white" css={{ marginTop: 5 }} />
</DynamicNavItem>
<Avatar />
<HamburgerButton active={showDrawer} onClick={toggleDrawer} />
</div>
</nav>
{showDrawer && <NavDrawer />}
</>
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@emotion/styled": "^11.3.0",
"@fontsource/poppins": "^4.5.0",
"@geist-ui/react": "^2.1.5",
"@geist-ui/react-icons": "^1.0.1",
"next": "11.0.1",
"react": "17.0.2",
"react-dom": "17.0.2"
Expand All @@ -28,6 +29,7 @@
"@storybook/react": "^6.3.6",
"@types/react": "17.0.15",
"babel-loader": "^8.2.2",
"babel-plugin-inline-react-svg": "^2.0.1",
"eslint": "7.32.0",
"eslint-config-next": "11.0.1",
"typescript": "4.3.5"
Expand Down
3 changes: 2 additions & 1 deletion routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ const routes = {
index: '/theory',
caseStudy: '/theory/case-study',
},
contactUs: '/contact-us',
blog: process.env.NEXT_PUBLIC_BLOG_URL ?? '/404',
contactUs: '/contact-us',
dash: 'https://app.turring.ai',
};

export default routes;
11 changes: 11 additions & 0 deletions stories/Avatar.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { ComponentMeta, ComponentStory } from '@storybook/react';
import Avatar from '../components/avatar';

export default {
title: 'Avatar',
component: Avatar,
} as ComponentMeta<typeof Avatar>;

const Template: ComponentStory<typeof Avatar> = () => <Avatar />;

export const Default = Template.bind({});
69 changes: 69 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,11 @@
chalk "^2.0.0"
js-tokens "^4.0.0"

"@babel/parser@^7.0.0":
version "7.15.0"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.0.tgz#b6d6e29058ca369127b0eeca2a1c4b5794f1b6b9"
integrity sha512-0v7oNOjr6YT9Z2RAOTv4T9aP+ubfx4Q/OhVtAet7PFDt0t9Oy6Jn+/rfC6b8HJ5zEqrQCiMxJfgtHpmIminmJQ==

"@babel/parser@^7.12.11", "@babel/parser@^7.12.7", "@babel/parser@^7.14.5", "@babel/parser@^7.14.8", "@babel/parser@^7.14.9":
version "7.14.9"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.14.9.tgz#596c1ad67608070058ebf8df50c1eaf65db895a4"
Expand Down Expand Up @@ -1332,6 +1337,11 @@
resolved "https://registry.yarnpkg.com/@fontsource/poppins/-/poppins-4.5.0.tgz#a419697b85864afbf8363f5c247b1e9d1f117564"
integrity sha512-RqgMIQqKHWNH3IUj+a0MAhlb4g5fftsXRTJ2bauefBmfM8Ja5q+qQZjKwyB/iCc+paJD320zFnLJ8G+y1ZyemQ==

"@geist-ui/react-icons@^1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@geist-ui/react-icons/-/react-icons-1.0.1.tgz#5da112bbc98216bf05da3aabbd7d21594440b209"
integrity sha512-/phre1NwXT0Mrxcq3yb+KksJ16/ykptgxI7+jh5pmDZfxnIMPlBWFBGDK0yw96oi752Wuo24X6+tkWjVe/g5Bg==

"@geist-ui/react@^2.1.5":
version "2.1.5"
resolved "https://registry.yarnpkg.com/@geist-ui/react/-/react-2.1.5.tgz#26532eb1869a97c60c36a3860cba184bdab59f55"
Expand Down Expand Up @@ -2309,6 +2319,11 @@
resolve-from "^5.0.0"
store2 "^2.12.0"

"@trysound/[email protected]":
version "0.1.1"
resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.1.1.tgz#3348564048e7a2d7398c935d466c0414ebb6a669"
integrity sha512-Z6DoceYb/1xSg5+e+ZlPZ9v0N16ZvZ+wYMraFue4HYrE4ttONKtsvruIRf6t9TBR0YvSOfi1hUU0fJfBLCDYow==

"@types/braces@*":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@types/braces/-/braces-3.0.1.tgz#5a284d193cfc61abb2e5a50d36ebbc50d942a32b"
Expand Down Expand Up @@ -3213,6 +3228,17 @@ [email protected]:
dependencies:
"@babel/helper-plugin-utils" "7.10.4"

babel-plugin-inline-react-svg@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/babel-plugin-inline-react-svg/-/babel-plugin-inline-react-svg-2.0.1.tgz#68c9c119d643a8f2d7bf939b942534d89ae3ade9"
integrity sha512-aD4gy2G3gNVDaw97LtoixzWbaOcSEnOb4KJPe8kZedSeqxY3v71KsBs8DGmButGZtEloCRhRRuU2TpW1hIPXig==
dependencies:
"@babel/helper-plugin-utils" "^7.0.0"
"@babel/parser" "^7.0.0"
lodash.isplainobject "^4.0.6"
resolve "^1.20.0"
svgo "^2.0.3"

babel-plugin-istanbul@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.0.0.tgz#e159ccdc9af95e0b570c75b4573b7c34d671d765"
Expand Down Expand Up @@ -3987,6 +4013,11 @@ commander@^6.2.1:
resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c"
integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==

commander@^7.1.0:
version "7.2.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7"
integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==

commondir@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b"
Expand Down Expand Up @@ -4288,6 +4319,14 @@ css-select@^4.1.3:
domutils "^2.6.0"
nth-check "^2.0.0"

css-tree@^1.1.2:
version "1.1.3"
resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.1.3.tgz#eb4870fb6fd7707327ec95c2ff2ab09b5e8db91d"
integrity sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==
dependencies:
mdn-data "2.0.14"
source-map "^0.6.1"

css-what@^5.0.0:
version "5.0.1"
resolved "https://registry.yarnpkg.com/css-what/-/css-what-5.0.1.tgz#3efa820131f4669a8ac2408f9c32e7c7de9f4cad"
Expand Down Expand Up @@ -4317,6 +4356,13 @@ [email protected]:
dependencies:
cssnano-preset-simple "^2.0.0"

csso@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/csso/-/csso-4.2.0.tgz#ea3a561346e8dc9f546d6febedd50187cf389529"
integrity sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==
dependencies:
css-tree "^1.1.2"

csstype@^2.5.7:
version "2.6.17"
resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.17.tgz#4cf30eb87e1d1a005d8b6510f95292413f6a1c0e"
Expand Down Expand Up @@ -7007,6 +7053,11 @@ lodash.debounce@^4.0.8:
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168=

lodash.isplainobject@^4.0.6:
version "4.0.6"
resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb"
integrity sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=

lodash.merge@^4.6.2:
version "4.6.2"
resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a"
Expand Down Expand Up @@ -7167,6 +7218,11 @@ mdast-util-to-string@^1.0.0:
resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz#27055500103f51637bd07d01da01eb1967a43527"
integrity sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A==

[email protected]:
version "2.0.14"
resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.14.tgz#7113fc4281917d63ce29b43446f701e68c25ba50"
integrity sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==

mdurl@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e"
Expand Down Expand Up @@ -9851,6 +9907,19 @@ supports-color@^8.0.0:
dependencies:
has-flag "^4.0.0"

svgo@^2.0.3:
version "2.3.1"
resolved "https://registry.yarnpkg.com/svgo/-/svgo-2.3.1.tgz#603a69ce50311c0e36791528f549644ec1b3f4bc"
integrity sha512-riDDIQgXpEnn0BEl9Gvhh1LNLIyiusSpt64IR8upJu7MwxnzetmF/Y57pXQD2NMX2lVyMRzXt5f2M5rO4wG7Dw==
dependencies:
"@trysound/sax" "0.1.1"
chalk "^4.1.0"
commander "^7.1.0"
css-select "^4.1.3"
css-tree "^1.1.2"
csso "^4.2.0"
stable "^0.1.8"

symbol.prototype.description@^1.0.0:
version "1.0.4"
resolved "https://registry.yarnpkg.com/symbol.prototype.description/-/symbol.prototype.description-1.0.4.tgz#c30edd3fe8c040d941cf7dc15842be15adf66855"
Expand Down

0 comments on commit df67eab

Please sign in to comment.