From 331f8d80220e03f0a09b6668c813b2dcb60c3b3e Mon Sep 17 00:00:00 2001 From: Innei Date: Thu, 15 May 2025 21:38:44 +0800 Subject: [PATCH] refactor(mobile): update SearchFeedCard and login components for improved styling and loading state - Changed icon color usage in SearchFeedCard to align with design standards. - Adjusted layout and spacing in SearchFeedCard for better visual consistency. - Enhanced login text styling for better emphasis in the Login component. - Added loading state handling in SocialLogin component to improve user experience during authentication. These changes enhance the overall UI and UX of the mobile application. Signed-off-by: Innei --- .../discover/search-tabs/SearchFeedCard.tsx | 63 +++++++++---------- apps/mobile/src/modules/login/index.tsx | 2 +- apps/mobile/src/modules/login/social.tsx | 11 +++- 3 files changed, 42 insertions(+), 34 deletions(-) diff --git a/apps/mobile/src/modules/discover/search-tabs/SearchFeedCard.tsx b/apps/mobile/src/modules/discover/search-tabs/SearchFeedCard.tsx index 4147e398f..acb7f0509 100644 --- a/apps/mobile/src/modules/discover/search-tabs/SearchFeedCard.tsx +++ b/apps/mobile/src/modules/discover/search-tabs/SearchFeedCard.tsx @@ -14,49 +14,48 @@ type SearchResultItem = Awaited>["da export const SearchFeedCard = ({ item }: { item: SearchResultItem }) => { const isSubscribed = useSubscriptionByFeedId(item.feed?.id ?? "") - const iconColor = useColor("text") + const iconColor = useColor("secondaryLabel") return ( - - <> - - - - {item.analytics?.subscriptionCount} followers - - - {item.analytics?.updatesPerWeek ? ( - <> - - - {item.analytics.updatesPerWeek} entries/week - - - ) : item.analytics?.latestEntryPublishedAt ? ( - <> - - Updated - - - ) : null} - + + + + + + {item.analytics?.subscriptionCount} followers + + + + {item.analytics?.updatesPerWeek ? ( + <> + + + {item.analytics.updatesPerWeek} entries/week + + + ) : item.analytics?.latestEntryPublishedAt ? ( + <> + + Updated + + + ) : null} - {/* Subscribe */} {isSubscribed ? ( - - Followed + + Followed ) : ( - + Follow )} - + ) } diff --git a/apps/mobile/src/modules/login/index.tsx b/apps/mobile/src/modules/login/index.tsx index 5854eeef6..a52b60e8d 100644 --- a/apps/mobile/src/modules/login/index.tsx +++ b/apps/mobile/src/modules/login/index.tsx @@ -49,7 +49,7 @@ export function Login() { lineHeight, }} > - {`${isRegister ? t("signin.sign_up_to") : t("signin.sign_in_to")} `} + {`${isRegister ? t("signin.sign_up_to") : t("signin.sign_in_to")} `} Folo {isEmail ? ( diff --git a/apps/mobile/src/modules/login/social.tsx b/apps/mobile/src/modules/login/social.tsx index a27a4bbaf..2b5555e7b 100644 --- a/apps/mobile/src/modules/login/social.tsx +++ b/apps/mobile/src/modules/login/social.tsx @@ -5,14 +5,23 @@ import { useTranslation } from "react-i18next" import { Text, TouchableOpacity, View } from "react-native" import { Image } from "@/src/components/ui/image/Image" +import { PlatformActivityIndicator } from "@/src/components/ui/loading/PlatformActivityIndicator" import { signIn, useAuthProviders } from "@/src/lib/auth" export function SocialLogin({ onPressEmail }: { onPressEmail: () => void }) { - const { data: authProviders } = useAuthProviders() + const { data: authProviders, isLoading } = useAuthProviders() const { colorScheme } = useColorScheme() const providers = Object.entries(authProviders || []) const { t } = useTranslation() + if (isLoading) { + return ( + + + + ) + } + return ( {providers.map(([key, provider]) => {