Skip to content
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
1 change: 1 addition & 0 deletions website/src/components/nav-bar.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { MdOutlineBookmark } from "react-icons/md/index"
import * as Dailp from "src/graphql/dailp"
import { useLocation } from "src/renderer/PageShell"
import { DropdownNavItem } from "./dropdown-nav-item"
Expand Down
47 changes: 47 additions & 0 deletions website/src/layout.css.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { style } from "@vanilla-extract/css"
import { rgba } from "polished"
import {
colors,
fonts,
Expand Down Expand Up @@ -67,3 +68,49 @@ export const siteLink = style({
})

export const contentContainer = style([row, { alignItems: "baseline" }])

export const iconLink = style({
color: "inherit",
display: "flex",
alignItems: "center",
justifyContent: "center",
width: "44px",
height: "44px",
borderRadius: "50%",

selectors: {
"&:hover": {
backgroundColor: rgba("black", 0.15),
},
},
})

export const wrapper = style({
position: "relative",
display: "inline-flex",
})

export const tooltip = style({
position: "absolute",
bottom: "-2.5rem",
left: "50%",
transform: "translateX(-50%) translateY(-4px)",
visibility: "hidden",
transition: "all 0.15s ease",
padding: "0.35rem 0.6rem",
borderRadius: "6px",
background: "rgba(0,0,0,0.85)",
color: "white",
fontSize: "0.8rem",
whiteSpace: "nowrap",
pointerEvents: "none",
zIndex: 1000,

selectors: {
[`${wrapper}:hover &`]: {
opacity: 1,
visibility: "visible",
transform: "translateX(-50%) translateY(0)",
},
},
})
21 changes: 21 additions & 0 deletions website/src/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@ import "@fontsource/charis-sil/400.css"
import "@fontsource/charis-sil/700.css"
import "@fontsource/quattrocento-sans/latin.css"
import "normalize.css"
import { rgba } from "polished"
import React from "react"
import { Helmet } from "react-helmet"
import { MdOutlineBookmark } from "react-icons/md/index"
import Link from "src/components/link"
import "src/style/global.css"
import { themeClass } from "src/theme.css"
import { LayoutClient } from "./client/layout"
import { IconButton } from "./components"
import NavBar from "./components/nav-bar"
import { Environment, deploymentEnvironment } from "./env"
import Footer from "./footer"
import * as css from "./layout.css"
import { MobileNav, NavMenu } from "./menu"
import { HeaderPrefDrawer } from "./mode"
import * as styles from "./mode.css"
import { LoginHeaderButton } from "./pages/auth/user-auth-layout"
import { PreferencesProvider } from "./preferences-context"
import "./wordpress.css"
Expand Down Expand Up @@ -45,6 +49,7 @@ const Layout: React.FC = ({ children }) => {
</span>
</div>
<LoginHeaderButton />
<DashboardButton color="black" />
<HeaderPrefDrawer />
</div>
{/* <NavMenu menuID={2} /> */}
Expand All @@ -58,3 +63,19 @@ const Layout: React.FC = ({ children }) => {
}

export default Layout

type DashboardButtonProps = {
color?: string
}

export const DashboardButton = ({ color }: DashboardButtonProps) => {
return (
<div className={css.wrapper} style={{ color }}>
<Link href="/dashboard" className={css.iconLink} aria-label="Dashboard">
<MdOutlineBookmark size={32} />
</Link>

<div className={css.tooltip}>Go to my dashboard</div>
</div>
)
}
8 changes: 8 additions & 0 deletions website/src/pages/cwkw/cwkw-layout.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,11 @@ export const loginHeader = style([
},
},
])

export const navButtons = style([
{
display: "flex",
flexDirection: "row",
gap: "0.5em",
},
])
8 changes: 6 additions & 2 deletions website/src/pages/cwkw/cwkw-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Helmet } from "react-helmet"
import { CreativeCommonsBy, Link } from "src/components"
import Sidebar, { MobileSidebar } from "src/components/sidebar"
import { useMediaQuery } from "src/custom-hooks"
import { DashboardButton } from "src/layout"
import { HeaderPrefDrawer } from "src/mode"
import { PreferencesProvider } from "src/preferences-context"
import { useRouteParams } from "src/renderer/PageShell"
Expand Down Expand Up @@ -61,8 +62,11 @@ const CWKWLayout: React.FC = ({ children }) => {
</Link>
</h1>
</div>
<LoginHeaderButton className={css.loginHeader} />
<HeaderPrefDrawer color={colors.body} />
<div className={css.navButtons}>
<LoginHeaderButton className={css.loginHeader} />
<DashboardButton color={colors.body} />
<HeaderPrefDrawer color={colors.body} />
</div>
</div>
</header>
{children}
Expand Down
Loading