mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Add a (rudimentary) splash screen
This commit is contained in:
parent
1e182e0d75
commit
9dc9431170
@ -20,21 +20,29 @@
|
|||||||
|
|
||||||
const IS_DEV = process.env.APP_VARIANT === "development";
|
const IS_DEV = process.env.APP_VARIANT === "development";
|
||||||
|
|
||||||
|
// Defined outside the config because dark splashscreen needs to be platform specific.
|
||||||
|
const splash = {
|
||||||
|
image: "./assets/icon.png",
|
||||||
|
resizeMode: "contain",
|
||||||
|
backgroundColor: "#eff1f5",
|
||||||
|
dark: {
|
||||||
|
image: "./assets/icon.png",
|
||||||
|
resizeMode: "contain",
|
||||||
|
backgroundColor: "#1e1e2e",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
expo: {
|
expo: {
|
||||||
name: "kyoo",
|
name: IS_DEV ? "Kyoo Development" : "Kyoo",
|
||||||
slug: "kyoo",
|
slug: "kyoo",
|
||||||
scheme: "kyoo",
|
scheme: "kyoo",
|
||||||
version: "1.0.0",
|
version: "1.0.0",
|
||||||
orientation: "default",
|
orientation: "default",
|
||||||
icon: "./assets/icon.png",
|
icon: "./assets/icon.png",
|
||||||
entryPoint: "./index.tsx",
|
entryPoint: "./index.tsx",
|
||||||
userInterfaceStyle: "light",
|
userInterfaceStyle: "automatic",
|
||||||
splash: {
|
splash,
|
||||||
image: "./assets/splash.png",
|
|
||||||
resizeMode: "contain",
|
|
||||||
backgroundColor: "#ffffff",
|
|
||||||
},
|
|
||||||
updates: {
|
updates: {
|
||||||
fallbackToCacheTimeout: 0,
|
fallbackToCacheTimeout: 0,
|
||||||
},
|
},
|
||||||
@ -45,12 +53,10 @@ const config = {
|
|||||||
android: {
|
android: {
|
||||||
package: IS_DEV ? "moe.sdg.kyoo.dev" : "moe.sdg.kyoo",
|
package: IS_DEV ? "moe.sdg.kyoo.dev" : "moe.sdg.kyoo",
|
||||||
adaptiveIcon: {
|
adaptiveIcon: {
|
||||||
foregroundImage: "./assets/adaptive-icon.png",
|
foregroundImage: "./assets/icon.png",
|
||||||
backgroundColor: "#FFFFFF",
|
backgroundColor: "#eff1f5",
|
||||||
},
|
},
|
||||||
},
|
splash,
|
||||||
web: {
|
|
||||||
favicon: "./assets/favicon.png",
|
|
||||||
},
|
},
|
||||||
extra: {
|
extra: {
|
||||||
eas: {
|
eas: {
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
import { PortalProvider } from "@gorhom/portal";
|
import { PortalProvider } from "@gorhom/portal";
|
||||||
import { ThemeSelector } from "@kyoo/primitives";
|
import { ThemeSelector } from "@kyoo/primitives";
|
||||||
import { NavbarProfile, NavbarRight, NavbarTitle } from "@kyoo/ui";
|
import { NavbarRight, NavbarTitle } from "@kyoo/ui";
|
||||||
import { createQueryClient } from "@kyoo/models";
|
import { createQueryClient } from "@kyoo/models";
|
||||||
import { QueryClientProvider } from "@tanstack/react-query";
|
import { QueryClientProvider } from "@tanstack/react-query";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
@ -35,7 +35,7 @@ import {
|
|||||||
} from "@expo-google-fonts/poppins";
|
} from "@expo-google-fonts/poppins";
|
||||||
import { useCallback, useState } from "react";
|
import { useCallback, useState } from "react";
|
||||||
import { useColorScheme } from "react-native";
|
import { useColorScheme } from "react-native";
|
||||||
import { initReactI18next, useTranslation } from "react-i18next";
|
import { initReactI18next } from "react-i18next";
|
||||||
import { useTheme } from "yoshiki/native";
|
import { useTheme } from "yoshiki/native";
|
||||||
import "intl-pluralrules";
|
import "intl-pluralrules";
|
||||||
|
|
||||||
@ -63,6 +63,9 @@ const ThemedStack = ({ onLayout }: { onLayout?: () => void }) => {
|
|||||||
screenOptions={{
|
screenOptions={{
|
||||||
headerTitle: () => <NavbarTitle onLayout={onLayout} />,
|
headerTitle: () => <NavbarTitle onLayout={onLayout} />,
|
||||||
headerRight: () => <NavbarRight />,
|
headerRight: () => <NavbarRight />,
|
||||||
|
contentStyle: {
|
||||||
|
backgroundColor: theme.background,
|
||||||
|
},
|
||||||
headerStyle: {
|
headerStyle: {
|
||||||
backgroundColor: theme.appbar,
|
backgroundColor: theme.appbar,
|
||||||
},
|
},
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 17 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 7.5 KiB |
Binary file not shown.
Before Width: | Height: | Size: 46 KiB |
@ -22,6 +22,6 @@ module.exports = function (api) {
|
|||||||
api.cache(true);
|
api.cache(true);
|
||||||
return {
|
return {
|
||||||
presets: ["babel-preset-expo"],
|
presets: ["babel-preset-expo"],
|
||||||
/* plugins: ["react-native-reanimated/plugin"], */
|
plugins: ["react-native-reanimated/plugin"],
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -37,12 +37,11 @@ const queryFn = async <Data,>(
|
|||||||
context: QueryFunctionContext,
|
context: QueryFunctionContext,
|
||||||
): Promise<Data> => {
|
): Promise<Data> => {
|
||||||
const kyooUrl =
|
const kyooUrl =
|
||||||
(Platform.OS !== "web"
|
Platform.OS !== "web"
|
||||||
? process.env.PUBLIC_BACK_URL
|
? process.env.PUBLIC_BACK_URL
|
||||||
: typeof window === "undefined"
|
: typeof window === "undefined"
|
||||||
? process.env.KYOO_URL ?? "http://localhost:5000"
|
? process.env.KYOO_URL ?? "http://localhost:5000"
|
||||||
: // TODO remove the hardcoded fallback. This is just for testing purposes
|
: "/api";
|
||||||
"/api") ?? "https://beta.sdg.moe";
|
|
||||||
if (!kyooUrl) console.error("Kyoo's url is not defined.");
|
if (!kyooUrl) console.error("Kyoo's url is not defined.");
|
||||||
|
|
||||||
let resp;
|
let resp;
|
||||||
|
@ -40,7 +40,7 @@ type IconProps = {
|
|||||||
export const Icon = ({ icon: Icon, color, size = 24, ...props }: IconProps) => {
|
export const Icon = ({ icon: Icon, color, size = 24, ...props }: IconProps) => {
|
||||||
const { css, theme } = useYoshiki();
|
const { css, theme } = useYoshiki();
|
||||||
const computed = css(
|
const computed = css(
|
||||||
{ width: size, height: size, fill: color ?? theme.colors.white } as ViewStyle,
|
{ width: size, height: size, fill: color ?? theme.contrast } as ViewStyle,
|
||||||
props,
|
props,
|
||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
|
@ -74,8 +74,12 @@ export const PressableFeedback = forwardRef<
|
|||||||
const pressProps = { onBlur, onFocus, onPressIn, onPressOut, onPress };
|
const pressProps = { onBlur, onFocus, onPressIn, onPressOut, onPress };
|
||||||
const wrapperProps = Platform.select<ViewProps & { ref?: any }>({
|
const wrapperProps = Platform.select<ViewProps & { ref?: any }>({
|
||||||
android: {
|
android: {
|
||||||
...props,
|
style: {
|
||||||
style: { ...StyleSheet.flatten(props?.style), overflow: "hidden" },
|
borderRadius: StyleSheet.flatten(props?.style)?.borderRadius,
|
||||||
|
alignContent: "center",
|
||||||
|
justifyContent: "center",
|
||||||
|
overflow: "hidden",
|
||||||
|
},
|
||||||
ref,
|
ref,
|
||||||
},
|
},
|
||||||
default: {},
|
default: {},
|
||||||
|
@ -55,7 +55,7 @@ export const catppuccin: ThemeBuilder = {
|
|||||||
},
|
},
|
||||||
dark: {
|
dark: {
|
||||||
// Catppuccin mocha
|
// Catppuccin mocha
|
||||||
appbar: "#94e2d5",
|
appbar: "#89b4fa",
|
||||||
overlay0: "#6c7086",
|
overlay0: "#6c7086",
|
||||||
overlay1: "#9399b2",
|
overlay1: "#9399b2",
|
||||||
link: "#89b4fa",
|
link: "#89b4fa",
|
||||||
|
@ -38,6 +38,7 @@ type Mode = {
|
|||||||
overlay0: Property.Color;
|
overlay0: Property.Color;
|
||||||
overlay1: Property.Color;
|
overlay1: Property.Color;
|
||||||
link: Property.Color;
|
link: Property.Color;
|
||||||
|
contrast: Property.Color;
|
||||||
variant: Variant;
|
variant: Variant;
|
||||||
colors: {
|
colors: {
|
||||||
red: Property.Color;
|
red: Property.Color;
|
||||||
@ -67,26 +68,17 @@ declare module "yoshiki" {
|
|||||||
font: FontList;
|
font: FontList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module "yoshiki/native" {
|
|
||||||
export interface Theme extends Mode, Variant {
|
|
||||||
light: Mode & Variant;
|
|
||||||
dark: Mode & Variant;
|
|
||||||
user: Mode & Variant;
|
|
||||||
alternate: Mode & Variant;
|
|
||||||
font: FontList;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export type { Theme } from "yoshiki";
|
export type { Theme } from "yoshiki";
|
||||||
export type ThemeBuilder = {
|
export type ThemeBuilder = {
|
||||||
light: Mode & { default: Variant };
|
light: Omit<Mode, "contrast"> & { default: Variant };
|
||||||
dark: Mode & { default: Variant };
|
dark: Omit<Mode, "contrast"> & { default: Variant };
|
||||||
};
|
};
|
||||||
|
|
||||||
const selectMode = (theme: ThemeBuilder & { font: FontList }, mode: "light" | "dark"): Theme => {
|
const selectMode = (theme: ThemeBuilder & { font: FontList }, mode: "light" | "dark"): Theme => {
|
||||||
const { light: lightBuilder, dark: darkBuilder, ...options } = theme;
|
const { light: lightBuilder, dark: darkBuilder, ...options } = theme;
|
||||||
const light = { ...lightBuilder, ...lightBuilder.default };
|
const light = { ...lightBuilder, ...lightBuilder.default, contrast: lightBuilder.colors.black };
|
||||||
const dark = { ...darkBuilder, ...darkBuilder.default };
|
const dark = { ...darkBuilder, ...darkBuilder.default, contrast: darkBuilder.colors.white };
|
||||||
const value = mode === "light" ? light : dark;
|
const value = mode === "light" ? light : dark;
|
||||||
const alternate = mode === "light" ? dark : light;
|
const alternate = mode === "light" ? dark : light;
|
||||||
return {
|
return {
|
||||||
|
@ -165,7 +165,7 @@ const TitleLine = ({
|
|||||||
/>
|
/>
|
||||||
<IconButton
|
<IconButton
|
||||||
icon={Theaters}
|
icon={Theaters}
|
||||||
color={{ xs: theme.user.colors.black, md: theme.colors.white }}
|
color={{ xs: theme.user.contrast, md: theme.colors.white }}
|
||||||
{...tooltip(t("show.trailer"))}
|
{...tooltip(t("show.trailer"))}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user