feat: theme color

This commit is contained in:
2023-12-05 22:46:33 +00:00
parent c7fdf78db8
commit 9dc1e41566
7 changed files with 38 additions and 8 deletions

View File

@ -1,6 +1,6 @@
import "./layout.css";
import { useState, useSyncExternalStore } from "react";
import { CSSProperties, useState, useSyncExternalStore } from "react";
import * as Dialog from "@radix-ui/react-dialog";
import { Outlet, useNavigate } from "react-router-dom";
import { Helmet } from "react-helmet";
@ -120,8 +120,12 @@ export function LayoutPage() {
);
}
const styles = {} as CSSProperties;
if (login?.color) {
(styles as Record<string, string>)["--primary"] = login.color;
}
return (
<div className={`page${location.pathname.startsWith("/naddr1") ? " stream" : ""}`}>
<div className={`page${location.pathname.startsWith("/naddr1") ? " stream" : ""}`} style={styles}>
<Helmet>
<title>Home - zap.stream</title>
</Helmet>