fix(settings): navigate to About tab when clicking update badge

- Add defaultTab prop to SettingsPage for external tab control
- UpdateBadge click now opens settings directly to About tab
- Settings button still opens to General tab (default behavior)
- Change update badge text from version number to "Update available"
This commit is contained in:
Jason
2026-01-06 11:27:32 +08:00
parent 0020889a8f
commit 2c4c2ce83d
6 changed files with 18 additions and 5 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ export function UpdateBadge({ className = "", onClick }: UpdateBadgeProps) {
>
<Download className="w-3 h-3 text-blue-500 dark:text-blue-400" />
<span className="text-gray-700 dark:text-gray-300 font-medium">
v{updateInfo.availableVersion}
{t("settings.updateBadge")}
</span>
<button
onClick={(e) => {
+4 -2
View File
@@ -52,12 +52,14 @@ interface SettingsDialogProps {
open: boolean;
onOpenChange: (open: boolean) => void;
onImportSuccess?: () => void | Promise<void>;
defaultTab?: string;
}
export function SettingsPage({
open,
onOpenChange,
onImportSuccess,
defaultTab = "general",
}: SettingsDialogProps) {
const { t } = useTranslation();
const {
@@ -98,10 +100,10 @@ export function SettingsPage({
useEffect(() => {
if (open) {
setActiveTab("general");
setActiveTab(defaultTab);
resetStatus();
}
}, [open, resetStatus]);
}, [open, resetStatus, defaultTab]);
useEffect(() => {
if (requiresRestart) {