diff --git a/docs/config.json b/docs/config.json index d366b49f2d..8c02da3967 100644 --- a/docs/config.json +++ b/docs/config.json @@ -1,6 +1,6 @@ { - "siteTitle": "Sportsbet.io", - "author": "Sportsbet.io", + "siteTitle": "Moon Design", + "author": "Coingaming", "description": "Everything you need to know about the Moon Design System", "packages": [ "assets", diff --git a/docs/src/components/nav/index.tsx b/docs/src/components/nav/index.tsx index 72f7630c3d..c7d73d075f 100644 --- a/docs/src/components/nav/index.tsx +++ b/docs/src/components/nav/index.tsx @@ -7,7 +7,7 @@ import { PagesData } from '../../types'; import { transformSections } from './transform'; import { Logo } from './logo'; -import { Menu, MenuList, MenuItem } from './menu'; +import { Menu, MenuList } from './menu'; const sidebar = graphql` query { @@ -32,21 +32,31 @@ const sidebar = graphql` } `; -const NavContainer = styled.nav(({ theme: { space } }) => ({ - padding: rem(space.default), +const NavContainer = styled.nav(({ theme: { space, color } }) => ({ + paddingTop: rem(24), + paddingBottom: rem(24), + paddingLeft: rem(32), + paddingRight: rem(32), + backgroundColor: color.gohan[100], + minWidth: rem(272), })); +const NavContainerWrapper = styled.div({ + padding: rem(32), +}); + export const Nav = () => ( ( - - - - {/* TODO: Investigate IDE type issue highlighting */} - - + + + + {/* TODO: Investigate IDE type issue highlighting */} + + + )} /> diff --git a/docs/src/components/nav/logo.tsx b/docs/src/components/nav/logo.tsx index b2dc6b16b0..c80f284e38 100644 --- a/docs/src/components/nav/logo.tsx +++ b/docs/src/components/nav/logo.tsx @@ -26,17 +26,18 @@ const LogoContainer = styled.div(({ theme: { breakpoint, color, space } }) => ({ height: rem(40), width: rem(240), alignItems: 'center', - justifyContent: 'space-between', + marginBottom: rem(32), + maxHeight: rem(20), /* The logo */ 'svg:first-child': { width: 'auto', height: '100%', }, [`${IconChevronDown}`]: { - fontSize: rem(18), + fontSize: rem(12), marginLeft: rem(space.default), flexShrink: 0, - color: color.trunks[100], + color: color.goten[100], }, [mq(breakpoint.medium)]: { width: '100%', @@ -57,6 +58,7 @@ const BrandSelect = styled.select({ '&:hover': { cursor: 'pointer', }, + outline: 'none', }); export const Logo = () => { @@ -65,7 +67,9 @@ export const Logo = () => { return ( - {brand === 'MoonDesign' && } + {brand === 'MoonDesign' && ( + + )} {brand === 'Sportsbet.io' && ( )} diff --git a/docs/src/components/nav/menu.tsx b/docs/src/components/nav/menu.tsx index 24a533c48b..6ca7c15078 100644 --- a/docs/src/components/nav/menu.tsx +++ b/docs/src/components/nav/menu.tsx @@ -32,14 +32,13 @@ const MenuListItem = styled.li<{ section?: boolean }>( section && { fontSize: '1.2rem', fontWeight: fontWeight.semibold, - color: color.trunks[100], + color: color.goten[100], }, ] ); const Link = styled(GatsbyLink)(({ theme: { color, fontWeight } }) => ({ - // @ts-ignore: &[aria-current=page] - color: color.bulma[100], + color: color.trunks[100], textDecoration: 'none', '&[aria-current=page]': { fontWeight: fontWeight.semibold, @@ -52,31 +51,41 @@ const Link = styled(GatsbyLink)(({ theme: { color, fontWeight } }) => ({ /** * Components: Private */ -const SubMenu = ({ items, title }: MenuListProps & MenuProps) => ( - - {title && ( - - {title} - - )} - - {items.map(item => ( - - ))} - - -); +const SubMenuWrapper = styled.div({ + marginBottom: rem(32), +}); + +const SubMenu = ({ items, title }: MenuListProps & MenuProps) => { + const [isOpen, setIsOpen] = React.useState(false); + return ( + { + setIsOpen(!isOpen); + }} + > + {title && ( + + {title} + + )} + {isOpen && ( + + {items.map(item => ( + + ))} + + )} + + ); +}; /** * Components: Exported */ -export const MenuList = styled.ul<{ nested?: boolean & MenuListProps }>( - ({ theme: { space }, nested }) => ({ - margin: 0, - marginLeft: nested ? rem(space.default) : 0, - listStyleType: 'none', - }) -); +export const MenuList = styled.ul({ + margin: 0, + listStyleType: 'none', +}); export const MenuItem = ({ route, name, section }: MenuItemProps) => ( @@ -87,8 +96,12 @@ export const MenuItem = ({ route, name, section }: MenuItemProps) => ( export const Menu = ({ items }: MenuProps) => items.map(item => item.pages ? ( - + + + ) : ( - + + + ) ); diff --git a/docs/src/provider.tsx b/docs/src/provider.tsx index c45a93be01..48f90d2116 100644 --- a/docs/src/provider.tsx +++ b/docs/src/provider.tsx @@ -102,21 +102,10 @@ export const DocsThemeProvider: React.FC<{ children: React.ReactChild }> = ({ colorMode: 'light', }); - const consoleInfoTheme = () => - process.env.NODE_ENV !== 'production' && - /* eslint-disable-next-line no-console */ - console.info( - '🎨 Theme: ', - themeState, - themes[themeState.brand][themeState.colorMode] - ); - /** * Toggle between themes 'dark' and 'light' states */ const toggleColorScheme = () => { - consoleInfoTheme(); - setThemeState({ brand: themeState.brand, colorMode: themeState.colorMode === 'dark' ? 'light' : 'dark', @@ -124,7 +113,6 @@ export const DocsThemeProvider: React.FC<{ children: React.ReactChild }> = ({ }; const setBrand = (themeKey: DocsBrands) => { - consoleInfoTheme(); setThemeState({ brand: themeKey, colorMode: themeState.colorMode }); };