diff --git a/web/src/components/button/Button.tsx b/web/src/components/button/Button.tsx index 0678c9a..d464c91 100644 --- a/web/src/components/button/Button.tsx +++ b/web/src/components/button/Button.tsx @@ -1,8 +1,12 @@ import { component$, IntrinsicHTMLElements, Slot } from "@builder.io/qwik"; -export default component$((props: IntrinsicHTMLElements["div"]) => { +interface ButtonProps { + light?: boolean; +} + +export default component$((props: IntrinsicHTMLElements["div"] & ButtonProps) => { return ( -
+
); diff --git a/web/src/components/sidebars/Sidebars.tsx b/web/src/components/sidebars/Sidebars.tsx index 2f50679..c3938e9 100644 --- a/web/src/components/sidebars/Sidebars.tsx +++ b/web/src/components/sidebars/Sidebars.tsx @@ -1,7 +1,7 @@ import { component$ } from "@builder.io/qwik"; import { UserType } from "~/lib/types"; -import ButtonLight from "../button/ButtonLight"; -import User from "../user/User"; +import Button from "../button/Button"; +import { User } from "../user/User"; export const SidebarLeft = component$(() => { return ( @@ -11,11 +11,31 @@ export const SidebarLeft = component$(() => {
- - Post - +
- + + + + + +
+ + { - const visible = useSignal(false); +export const AccountSwitcher = component$(() => { + const visible = useContext(contexts.AccountSwitcher); + + return ( +
+
+ + +
+
+ ) +}); + +export const User = component$((props: UserProps) => { + const visible = useSignal(false); + useContextProvider(contexts.AccountSwitcher, visible); return (
-
-
- Account Switcher -
-
- -
+ {props.accountSwitcher && } +
avatar

{props.user.displayName}

- @ - + @ + {props.user.userName} {props.action}

@@ -48,4 +69,4 @@ export default component$((props: UserProps) => {
); -}); \ No newline at end of file +}); \ No newline at end of file diff --git a/web/src/lib/contexts.ts b/web/src/lib/contexts.ts new file mode 100644 index 0000000..9ce1a3b --- /dev/null +++ b/web/src/lib/contexts.ts @@ -0,0 +1,3 @@ +import { createContextId, Signal } from "@builder.io/qwik"; + +export const AccountSwitcher = createContextId>("clatter.user.switcher"); \ No newline at end of file diff --git a/web/src/routes/layout.tsx b/web/src/routes/layout.tsx index 67c8e72..2744a5b 100644 --- a/web/src/routes/layout.tsx +++ b/web/src/routes/layout.tsx @@ -15,7 +15,7 @@ export const onGet: RequestHandler = async ({ cacheControl }) => { export default component$(() => { return ( -
+
diff --git a/web/tailwind.config.js b/web/tailwind.config.js index 5b8240e..b6946c4 100644 --- a/web/tailwind.config.js +++ b/web/tailwind.config.js @@ -1,6 +1,7 @@ /** @type {import('tailwindcss').Config} */ export default { content: ['./src/**/*.{js,ts,jsx,tsx,mdx}'], + mode: "jit", theme: { extend: { colors: { @@ -11,7 +12,9 @@ export default { 300: "#4e4947", 350: "#5a5553", 400: "#6b6563", + 450: "#7c7674", 500: "#9c9591", + 550: "#a9a4a1", 600: "#b3adaa", } },