ci / contract / contract (сгенерированный код совпадает с openapi.yaml) (push) Successful in 1m30s
ci / mobile / mobile (Metro-бандл Android) (push) Successful in 2m57s
ci / ts / ts (packages + web) (push) Successful in 1m16s
ci / docker / docker (образы собираются — их сервер собирает сам при обновлении) (push) Successful in 33s
- My Wave is rendered with react-native-skia on the UI thread; physics and colour helpers moved to @pipu/core (wave-anim) and shared with web. - Full-screen player honours ui_prefs.mobile_player (cover / wave). - Theme switching (dark / light / system) via a theme context and useColors() across all screens. - Profile: theme, wave variant, player view, sound quality sheet (Wi-Fi / mobile / downloads), recent-tracks cache clearing on next cold start, and a change-password sheet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
20 lines
775 B
TypeScript
20 lines
775 B
TypeScript
import { tokens, type ThemeName } from '@pipu/design-tokens';
|
|
import { createContext, useContext } from 'react';
|
|
|
|
export type Colors = Record<keyof typeof tokens.color.dark, string>;
|
|
|
|
/** Активная тема (dark / light); выбирается в профиле (`ui_prefs.theme`, «system» — по настройке телефона). */
|
|
export const ThemeContext = createContext<ThemeName>('dark');
|
|
|
|
export function useThemeName(): ThemeName {
|
|
return useContext(ThemeContext);
|
|
}
|
|
|
|
export function useColors(): Colors {
|
|
return tokens.color[useThemeName()];
|
|
}
|
|
|
|
/** Цвета до входа и загрузки настроек (сплэш) — тёмная тема. */
|
|
export const darkColors: Colors = tokens.color.dark;
|
|
export const radius = tokens.radius;
|