From 169161d622fd8e078a5cda6103cdb2211f9cdb38 Mon Sep 17 00:00:00 2001 From: GoodNullName Date: Mon, 4 Nov 2024 12:58:05 +0800 Subject: [PATCH] fix: enhance DormScoreScreen with theme support (#649) * feat: enhance DormScoreScreen with theme support and loading indicator * fix: revert some changes --- apps/thu-info-app/src/ui/home/dormScore.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/thu-info-app/src/ui/home/dormScore.tsx b/apps/thu-info-app/src/ui/home/dormScore.tsx index f23c6049a..08e6dbefd 100644 --- a/apps/thu-info-app/src/ui/home/dormScore.tsx +++ b/apps/thu-info-app/src/ui/home/dormScore.tsx @@ -1,4 +1,4 @@ -import {View} from "react-native"; +import {View, useColorScheme} from "react-native"; import {useEffect, useState} from "react"; import {NetworkRetry} from "../../components/easySnackbars"; import {getStr} from "../../utils/i18n"; @@ -8,10 +8,13 @@ import {saveRemoteImg} from "../../utils/saveImg"; import {DormAuthError} from "@thu-info/lib/src/utils/error"; import {RootNav} from "../../components/Root"; import {useSelector} from "react-redux"; +import themes from "../../assets/themes/themes"; export const DormScoreScreen = ({navigation}: {navigation: RootNav}) => { const [base64, setBase64] = useState(); const dormPassword = useSelector((s: State) => s.credentials.dormPassword); + const themeName = useColorScheme(); + const {colors} = themes(themeName); useEffect(() => { helper .getDormScore(dormPassword) @@ -29,7 +32,8 @@ export const DormScoreScreen = ({navigation}: {navigation: RootNav}) => { {base64 && ( } menuContext={{