feat: add upgrade to premium option in settings menu (#1505)

This commit is contained in:
Huang Xin
2025-07-01 15:15:25 +08:00
committed by GitHub
parent 49e6877810
commit b959bf070c
20 changed files with 47 additions and 21 deletions
@@ -417,5 +417,6 @@
"Cloud Sync Storage": "مساحة المزامنة السحابية",
"Parallel Read": "القراءة المتزامنة",
"Disable": "تعطيل",
"Enable": "تمكين"
"Enable": "تمكين",
"Upgrade to Readest Premium": "ترقية إلى Readest Premium"
}
@@ -401,5 +401,6 @@
"Cloud Sync Storage": "Cloud-Speicher",
"Parallel Read": "Paralleles Lesen",
"Disable": "Deaktivieren",
"Enable": "Aktivieren"
"Enable": "Aktivieren",
"Upgrade to Readest Premium": "Upgrade auf Readest Premium"
}
@@ -401,5 +401,6 @@
"{{percentage}}% of Cloud Sync Space Used.": "{{percentage}}% του χώρου συγχρονισμού στο cloud χρησιμοποιήθηκε.",
"Cloud Sync Storage": "Χώρος συγχρονισμού cloud",
"Disable": "Απενεργοποίηση",
"Enable": "Ενεργοποίηση"
"Enable": "Ενεργοποίηση",
"Upgrade to Readest Premium": "Αναβάθμιση στο Readest Premium"
}
@@ -405,5 +405,6 @@
"{{percentage}}% of Cloud Sync Space Used.": "{{percentage}}% del espacio de sincronización en la nube utilizado.",
"Cloud Sync Storage": "Almacenamiento en la nube",
"Disable": "Desactivar",
"Enable": "Activar"
"Enable": "Activar",
"Upgrade to Readest Premium": "Actualizar a Readest Premium"
}
@@ -405,5 +405,6 @@
"{{percentage}}% of Cloud Sync Space Used.": "{{percentage}}% de lespace de synchronisation cloud utilisé.",
"Cloud Sync Storage": "Stockage de synchronisation cloud",
"Disable": "Désactiver",
"Enable": "Activer"
"Enable": "Activer",
"Upgrade to Readest Premium": "Passer à Readest Premium"
}
@@ -401,5 +401,6 @@
"{{percentage}}% of Cloud Sync Space Used.": "{{percentage}}% क्लाउड सिंक स्पेस का उपयोग किया गया है।",
"Cloud Sync Storage": "क्लाउड सिंक स्टोरेज",
"Disable": "अक्षम करें",
"Enable": "सक्षम करें"
"Enable": "सक्षम करें",
"Upgrade to Readest Premium": "Readest प्रीमियम में अपग्रेड करें"
}
@@ -397,5 +397,6 @@
"{{percentage}}% of Cloud Sync Space Used.": "{{percentage}}% ruang sinkronisasi cloud terpakai",
"Cloud Sync Storage": "Ruang cloud",
"Disable": "Nonaktifkan",
"Enable": "Aktifkan"
"Enable": "Aktifkan",
"Upgrade to Readest Premium": "Tingkatkan ke Readest Premium"
}
@@ -405,5 +405,6 @@
"{{percentage}}% of Cloud Sync Space Used.": "{{percentage}}% dello spazio cloud usato",
"Cloud Sync Storage": "Spazio cloud",
"Disable": "Disabilita",
"Enable": "Abilita"
"Enable": "Abilita",
"Upgrade to Readest Premium": "Aggiorna a Readest Premium"
}
@@ -397,5 +397,6 @@
"{{percentage}}% of Cloud Sync Space Used.": "クラウド同期スペースの使用量は{{percentage}}%です。",
"Cloud Sync Storage": "クラウド同期容量",
"Disable": "無効にする",
"Enable": "有効にする"
"Enable": "有効にする",
"Upgrade to Readest Premium": "Readest Premiumにアップグレード"
}
@@ -397,5 +397,6 @@
"{{percentage}}% of Cloud Sync Space Used.": "{{percentage}}%의 클라우드 동기화 공간 사용됨.",
"Cloud Sync Storage": "클라우드 저장 공간",
"Disable": "비활성화",
"Enable": "활성화"
"Enable": "활성화",
"Upgrade to Readest Premium": "Readest Premium으로 업그레이드"
}
@@ -401,5 +401,6 @@
"{{percentage}}% of Cloud Sync Space Used.": "{{percentage}}% van de cloud-synchronisatie ruimte gebruikt.",
"Cloud Sync Storage": "Cloud Sync Opslag",
"Disable": "Uitschakelen",
"Enable": "Inschakelen"
"Enable": "Inschakelen",
"Upgrade to Readest Premium": "Upgrade naar Readest Premium"
}
@@ -409,5 +409,6 @@
"{{percentage}}% of Cloud Sync Space Used.": "Użyto {{percentage}}% przestrzeni synchronizacji w chmurze.",
"Cloud Sync Storage": "Miejsce w chmurze",
"Disable": "Wyłącz",
"Enable": "Włącz"
"Enable": "Włącz",
"Upgrade to Readest Premium": "Uaktualnij do Readest Premium"
}
@@ -405,5 +405,6 @@
"{{percentage}}% of Cloud Sync Space Used.": "{{percentage}}% do espaço de sincronização na nuvem utilizado.",
"Cloud Sync Storage": "Armazenamento na Nuvem",
"Disable": "Desativar",
"Enable": "Ativar"
"Enable": "Ativar",
"Upgrade to Readest Premium": "Atualizar para Readest Premium"
}
@@ -409,5 +409,6 @@
"{{percentage}}% of Cloud Sync Space Used.": "Использовано {{percentage}}% облачного пространства для синхронизации.",
"Cloud Sync Storage": "Облачное хранилище",
"Disable": "Отключить",
"Enable": "Включить"
"Enable": "Включить",
"Upgrade to Readest Premium": "Обновить до Readest Premium"
}
@@ -401,5 +401,6 @@
"{{percentage}}% of Cloud Sync Space Used.": "Bulut Senkronizasyon Alanının %{{percentage}}'si Kullanıldı.",
"Cloud Sync Storage": "Bulut Senkronizasyon Depolama",
"Disable": "Devre Dışı Bırak",
"Enable": "Etkinleştir"
"Enable": "Etkinleştir",
"Upgrade to Readest Premium": "Readest Premiuma Yükselt"
}
@@ -409,5 +409,6 @@
"{{percentage}}% of Cloud Sync Space Used.": "Використано {{percentage}}% хмарного сховища.",
"Cloud Sync Storage": "Облачне хранилище",
"Disable": "Вимкнути",
"Enable": "Увімкнути"
"Enable": "Увімкнути",
"Upgrade to Readest Premium": "Оновити до Readest Premium"
}
@@ -397,5 +397,6 @@
"{{percentage}}% of Cloud Sync Space Used.": "Đã sử dụng {{percentage}}% không gian đồng bộ đám mây.",
"Cloud Sync Storage": "Lưu trữ đồng bộ đám mây",
"Disable": "Tắt",
"Enable": "Bật"
"Enable": "Bật",
"Upgrade to Readest Premium": "Đăng ký Readest Premium"
}
@@ -397,5 +397,6 @@
"{{percentage}}% of Cloud Sync Space Used.": "已使用 {{percentage}}% 的云同步空间。",
"Cloud Sync Storage": "云同步空间",
"Disable": "禁用",
"Enable": "启用"
"Enable": "启用",
"Upgrade to Readest Premium": "升级到 Readest Premium"
}
@@ -397,5 +397,6 @@
"{{percentage}}% of Cloud Sync Space Used.": "已使用 {{percentage}}% 的雲同步空間。",
"Cloud Sync Storage": "雲同步空間",
"Disable": "禁用",
"Enable": "啟用"
"Enable": "啟用",
"Upgrade to Readest Premium": "升級到 Readest Premium"
}
@@ -33,6 +33,7 @@ const SettingsMenu: React.FC<SettingsMenuProps> = ({ setIsDropdownOpen }) => {
const router = useRouter();
const { envConfig, appService } = useEnv();
const { user } = useAuth();
const { userPlan, quotas } = useQuotaStats();
const { themeMode, setThemeMode } = useThemeStore();
const { settings, setSettings, saveSettings } = useSettingsStore();
const [isAutoUpload, setIsAutoUpload] = useState(settings.autoUpload);
@@ -47,8 +48,6 @@ const SettingsMenu: React.FC<SettingsMenuProps> = ({ setIsDropdownOpen }) => {
const [isTelemetryEnabled, setIsTelemetryEnabled] = useState(settings.telemetryEnabled);
const iconSize = useResponsiveSize(16);
const { quotas } = useQuotaStats();
const showAboutReadest = () => {
setAboutDialogVisible(true);
setIsDropdownOpen?.(false);
@@ -152,6 +151,11 @@ const SettingsMenu: React.FC<SettingsMenuProps> = ({ setIsDropdownOpen }) => {
setIsTelemetryEnabled(settings.telemetryEnabled);
};
const handleUpgrade = () => {
navigateToProfile(router);
setIsDropdownOpen?.(false);
};
const avatarUrl = user?.user_metadata?.['picture'] || user?.user_metadata?.['avatar_url'];
const userFullName = user?.user_metadata?.['full_name'];
const userDisplayName = userFullName ? userFullName.split(' ')[0] : null;
@@ -248,6 +252,9 @@ const SettingsMenu: React.FC<SettingsMenuProps> = ({ setIsDropdownOpen }) => {
onClick={cycleThemeMode}
/>
<hr className='border-base-200 my-1' />
{user && userPlan === 'free' && !appService?.isIOSApp && (
<MenuItem label={_('Upgrade to Readest Premium')} onClick={handleUpgrade} />
)}
{isWebAppPlatform() && <MenuItem label={_('Download Readest')} onClick={downloadReadest} />}
<MenuItem label={_('About Readest')} onClick={showAboutReadest} />
<MenuItem