mirror of
https://github.com/kennethnym/aris.git
synced 2026-03-20 09:01:19 +00:00
feat: init waitlist website (#60)
* feat: init waitlist website Co-authored-by: Ona <no-reply@ona.com> * feat[waitlist]: tweak copy Co-authored-by: Ona <no-reply@ona.com> * fix[waitlist]: reminify lottie json Co-authored-by: Ona <no-reply@ona.com> * feat[waitlist]: seo and preview stuff * chore[waitlist]: clean up * build[waitlist]: add fly.io config * feat(waitlist): add time-of-day greeting and duplicate email message Co-authored-by: Ona <no-reply@ona.com> * feat(waitlist): handle duplicate emails and send confirmation Co-authored-by: Ona <no-reply@ona.com> * chore: remove stray console.log Co-authored-by: Ona <no-reply@ona.com> * feat(waitlist): add privacy policy page Co-authored-by: Ona <no-reply@ona.com> * feat(waitlist): add footer with bottom progressive blur Co-authored-by: Ona <no-reply@ona.com> * feat(waitlist): add trouble message and improve error handling Co-authored-by: Ona <no-reply@ona.com> * fix(waitlist): fix timeOfDay logic, typo, and add audienceId Co-authored-by: Ona <no-reply@ona.com> * feat(waitlist): add .ico fallback favicon and style error page Co-authored-by: Ona <no-reply@ona.com> * chore(waitlist): add robots.txt, sitemap, clean dockerignore Co-authored-by: Ona <no-reply@ona.com> * feat(waitlist): add footer to privacy policy page Co-authored-by: Ona <no-reply@ona.com> * fix(waitlist): use segments instead of audienceId Co-authored-by: Ona <no-reply@ona.com> * fix[waitlist]: remove segmentId from dup check Co-authored-by: Ona <no-reply@ona.com> * fix(waitlist): reset logo animation on mouse leave Co-authored-by: Ona <no-reply@ona.com> --------- Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
27
apps/waitlist-website/app/hooks/use-color-scheme.ts
Normal file
27
apps/waitlist-website/app/hooks/use-color-scheme.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { useEffect, useState } from "react"
|
||||
|
||||
export const ColorScheme = {
|
||||
Light: "light",
|
||||
Dark: "dark",
|
||||
} as const
|
||||
export type ColorScheme = (typeof ColorScheme)[keyof typeof ColorScheme]
|
||||
|
||||
export function useColorScheme(): ColorScheme {
|
||||
const [scheme, setScheme] = useState<ColorScheme>(() => {
|
||||
if (typeof window === "undefined") return ColorScheme.Light
|
||||
return window.matchMedia("(prefers-color-scheme: dark)").matches
|
||||
? ColorScheme.Dark
|
||||
: ColorScheme.Light
|
||||
})
|
||||
|
||||
useEffect(() => {
|
||||
const mql = window.matchMedia("(prefers-color-scheme: dark)")
|
||||
const handler = (e: MediaQueryListEvent) => {
|
||||
setScheme(e.matches ? ColorScheme.Dark : ColorScheme.Light)
|
||||
}
|
||||
mql.addEventListener("change", handler)
|
||||
return () => mql.removeEventListener("change", handler)
|
||||
}, [])
|
||||
|
||||
return scheme
|
||||
}
|
||||
Reference in New Issue
Block a user