From 1f89f9ab998312da05a542c9c8a0f296a9370747 Mon Sep 17 00:00:00 2001 From: mori8 Date: Sat, 4 Jun 2022 02:10:24 +0900 Subject: [PATCH] Fix: show 'noEvent' text if there is no event today --- react-native/screens/HomeScreen.tsx | 15 ++++++++------- react-native/screens/IntroductionScreen.tsx | 6 +++--- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/react-native/screens/HomeScreen.tsx b/react-native/screens/HomeScreen.tsx index 23527f7..2cfa2fb 100644 --- a/react-native/screens/HomeScreen.tsx +++ b/react-native/screens/HomeScreen.tsx @@ -73,9 +73,9 @@ export default function HomeScreen({ navigation }: Navigation) { const auth = useAuth(); useEffect(() => { - // if (auth?.userData) { - // setUser(auth?.userData); - // } + if (auth?.userData) { + setUser(auth?.userData); + } navigation.setOptions({ headerRight: () => , @@ -176,11 +176,12 @@ export default function HomeScreen({ navigation }: Navigation) { fontStyle="normal" fontSize="xl" lineHeight={60} - > - {i18n.t("eventCount_1") + + >{ + events.event_num === 0 ? i18n.t("noEvent") : + i18n.t("eventCount_1") + events.event_num + - i18n.t("eventCount_2")} - + i18n.t("eventCount_2") + } { - navigation.navigate("Home"); - }) + // useEffect(() => { + // navigation.navigate("Home"); + // }) useEffect(() => { if (response?.type === "success") {