diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 05cb2c05..c0d2d545 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -373,7 +373,8 @@ "playing": "Playing {{game}}", "achievements_unlocked": "Achievements Unlocked", "earned_points": "Earned points", - "show_achievements_on_profile": "Show your achievements and earned points on your profile" + "show_achievements_on_profile": "Show your achievements on your profile", + "show_points_on_profile": "Show your earned points on your profile" }, "achievement": { "achievement_unlocked": "Achievement unlocked", @@ -400,6 +401,7 @@ "show_and_compare_achievements": "Show and compare your achievements to other users", "animated_profile_banner": "Animated profile banner", "hydra_cloud": "Hydra Cloud", - "hydra_cloud_feature_found": "You've just discovered a Hydra Cloud feature!" + "hydra_cloud_feature_found": "You've just discovered a Hydra Cloud feature!", + "learn_more": "Learn More" } } diff --git a/src/locales/pt-BR/translation.json b/src/locales/pt-BR/translation.json index 64d1370f..de33fd14 100644 --- a/src/locales/pt-BR/translation.json +++ b/src/locales/pt-BR/translation.json @@ -373,7 +373,8 @@ "playing": "Jogando {{game}}", "achievements_unlocked": "Conquistas desbloqueadas", "earned_points": "Pontos ganhos", - "show_achievements_on_profile": "Exiba suas conquistas e pontos no perfil" + "show_achievements_on_profile": "Exiba suas conquistas no perfil", + "show_points_on_profile": "Exiba seus pontos ganhos no perfil" }, "achievement": { "achievement_unlocked": "Conquista desbloqueada", @@ -400,6 +401,7 @@ "show_and_compare_achievements": "Exiba e compare suas conquistas com outros usuários", "animated_profile_banner": "Banner animado no perfil", "cloud_saving": "Saves de jogos em nuvem", - "hydra_cloud_feature_found": "Você descobriu uma funcionalidade Hydra Cloud!" + "hydra_cloud_feature_found": "Você descobriu uma funcionalidade Hydra Cloud!", + "learn_more": "Saiba mais" } } diff --git a/src/renderer/src/app.tsx b/src/renderer/src/app.tsx index 3a489810..29110aec 100644 --- a/src/renderer/src/app.tsx +++ b/src/renderer/src/app.tsx @@ -58,7 +58,8 @@ export function App() { clearUserDetails, } = useUserDetails(); - const { hideHydraCloudModal, isHydraCloudModalVisible } = useSubscription(); + const { hideHydraCloudModal, isHydraCloudModalVisible, hydraCloudFeature } = + useSubscription(); const dispatch = useAppDispatch(); @@ -252,6 +253,7 @@ export function App() { {userDetails && ( diff --git a/src/renderer/src/features/subscription-slice.ts b/src/renderer/src/features/subscription-slice.ts index 60108680..d192ef6f 100644 --- a/src/renderer/src/features/subscription-slice.ts +++ b/src/renderer/src/features/subscription-slice.ts @@ -1,19 +1,26 @@ -import { createSlice } from "@reduxjs/toolkit"; +import { createSlice, type PayloadAction } from "@reduxjs/toolkit"; +import type { HydraCloudFeature } from "@types"; export interface SubscriptionState { isHydraCloudModalVisible: boolean; + feature: HydraCloudFeature | ""; } const initialState: SubscriptionState = { isHydraCloudModalVisible: false, + feature: "", }; export const subscriptionSlice = createSlice({ name: "subscription", initialState, reducers: { - setHydraCloudModalVisible: (state) => { + setHydraCloudModalVisible: ( + state, + action: PayloadAction + ) => { state.isHydraCloudModalVisible = true; + state.feature = action.payload; }, setHydraCloudModalHidden: (state) => { state.isHydraCloudModalVisible = false; diff --git a/src/renderer/src/hooks/use-subscription.ts b/src/renderer/src/hooks/use-subscription.ts index 930fa552..273eb0ef 100644 --- a/src/renderer/src/hooks/use-subscription.ts +++ b/src/renderer/src/hooks/use-subscription.ts @@ -4,17 +4,21 @@ import { setHydraCloudModalVisible, setHydraCloudModalHidden, } from "@renderer/features"; +import { HydraCloudFeature } from "@types"; export function useSubscription() { const dispatch = useAppDispatch(); - const { isHydraCloudModalVisible } = useAppSelector( + const { isHydraCloudModalVisible, feature } = useAppSelector( (state) => state.subscription ); - const showHydraCloudModal = useCallback(() => { - dispatch(setHydraCloudModalVisible()); - }, [dispatch]); + const showHydraCloudModal = useCallback( + (feature: HydraCloudFeature) => { + dispatch(setHydraCloudModalVisible(feature)); + }, + [dispatch] + ); const hideHydraCloudModal = useCallback(() => { dispatch(setHydraCloudModalHidden()); @@ -22,6 +26,7 @@ export function useSubscription() { return { isHydraCloudModalVisible, + hydraCloudFeature: feature, showHydraCloudModal, hideHydraCloudModal, }; diff --git a/src/renderer/src/pages/achievements/achievement-list.tsx b/src/renderer/src/pages/achievements/achievement-list.tsx index 12c1b957..6e6944de 100644 --- a/src/renderer/src/pages/achievements/achievement-list.tsx +++ b/src/renderer/src/pages/achievements/achievement-list.tsx @@ -56,7 +56,7 @@ export function AchievementList({ achievements }: AchievementListProps) { ) : ( )} diff --git a/src/renderer/src/pages/shared-modals/hydra-cloud/hydra-cloud-modal.tsx b/src/renderer/src/pages/shared-modals/hydra-cloud/hydra-cloud-modal.tsx index b28eff92..fd44ce30 100644 --- a/src/renderer/src/pages/shared-modals/hydra-cloud/hydra-cloud-modal.tsx +++ b/src/renderer/src/pages/shared-modals/hydra-cloud/hydra-cloud-modal.tsx @@ -3,11 +3,16 @@ import { SPACING_UNIT } from "@renderer/theme.css"; import { useTranslation } from "react-i18next"; export interface HydraCloudModalProps { + feature: string; visible: boolean; onClose: () => void; } -export const HydraCloudModal = ({ visible, onClose }: HydraCloudModalProps) => { +export const HydraCloudModal = ({ + feature, + visible, + onClose, +}: HydraCloudModalProps) => { const { t } = useTranslation("hydra_cloud"); const handleClickOpenCheckout = () => { @@ -17,6 +22,7 @@ export const HydraCloudModal = ({ visible, onClose }: HydraCloudModalProps) => { return (
{ }} > {t("hydra_cloud_feature_found")} - +
); diff --git a/src/types/index.ts b/src/types/index.ts index 54a3993e..7c0aea2b 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -14,6 +14,11 @@ export type GameShop = "steam" | "epic"; export type FriendRequestAction = "ACCEPTED" | "REFUSED" | "CANCEL"; +export type HydraCloudFeature = + | "achievements" + | "backup" + | "achievements-points"; + export interface GameRepack { id: number; title: string;