MCPcopy Create free account
hub / github.com/pacexy/flow / useSourceColor

Function useSourceColor

apps/reader/src/hooks/theme/useSourceColor.ts:5–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3import { useSettings } from '@flow/reader/state'
4
5export function useSourceColor() {
6 const [{ theme }, setSettings] = useSettings()
7
8 const setSourceColor = useCallback(
9 (source: string) => {
10 setSettings((prev) => ({
11 ...prev,
12 theme: {
13 ...prev.theme,
14 source,
15 },
16 }))
17 },
18 [setSettings],
19 )
20
21 return { sourceColor: theme?.source ?? '#0ea5e9', setSourceColor }
22}

Callers 2

ThemeFunction · 0.90
ThemeViewFunction · 0.90

Calls 1

useSettingsFunction · 0.90

Tested by

no test coverage detected