Fix yoshiki providers + add vite proxy

This commit is contained in:
Zoe Roux
2025-02-07 22:52:41 +01:00
parent b4f303e0fb
commit b4144e61d3
5 changed files with 20 additions and 8 deletions
+7 -4
View File
@@ -1,9 +1,9 @@
import type { Property } from "csstype";
import type { ReactNode } from "react";
import { Platform, type TextStyle } from "react-native";
import { type Theme, ThemeProvider, useAutomaticTheme } from "yoshiki";
import { type Theme, ThemeProvider as WebThemeProvider, useAutomaticTheme } from "yoshiki";
import "yoshiki";
import { useTheme, useYoshiki } from "yoshiki/native";
import { ThemeProvider, useTheme, useYoshiki } from "yoshiki/native";
import "yoshiki/native";
import { catppuccin } from "./catppuccin";
@@ -127,7 +127,11 @@ export const ThemeSelector = ({
}) => {
const newTheme = selectMode({ ...catppuccin, font }, theme);
return <ThemeProvider theme={newTheme}>{children as any}</ThemeProvider>;
return (
<ThemeProvider theme={newTheme}>
<WebThemeProvider theme={newTheme}>{children as any}</WebThemeProvider>
</ThemeProvider>
);
};
export type YoshikiFunc<T> = (props: ReturnType<typeof useYoshiki>) => T;
@@ -190,4 +194,3 @@ export const ContrastArea = ({
export const alpha = (color: Property.Color, alpha: number) => {
return color + Math.round(alpha * 255).toString(16);
};
+2 -2
View File
@@ -2,7 +2,7 @@ import type { FC } from "react";
import type { KyooError } from "~/models";
import { ConnectionError } from "./connection";
import { OfflineView } from "./offline";
import { SetupPage } from "./setup";
// import { SetupPage } from "./setup";
import { Unauthorized } from "./unauthorized";
export * from "./error";
@@ -15,7 +15,7 @@ export type ErrorHandler = {
export const errorHandlers: Record<string, ErrorHandler> = {
unauthorized: { view: Unauthorized, forbid: "app" },
setup: { view: SetupPage, forbid: "setup" },
// setup: { view: SetupPage, forbid: "setup" },
connection: { view: ConnectionError },
offline: { view: OfflineView },
};