Rename "ExtensionSettings" to "BrowseSettings" (#600)
This commit is contained in:
@@ -35,7 +35,7 @@ import { DownloadSettings } from '@/screens/settings/DownloadSettings.tsx';
|
|||||||
import { ServerSettings } from '@/screens/settings/ServerSettings.tsx';
|
import { ServerSettings } from '@/screens/settings/ServerSettings.tsx';
|
||||||
import { ServerUpdateChecker } from '@/components/settings/ServerUpdateChecker.tsx';
|
import { ServerUpdateChecker } from '@/components/settings/ServerUpdateChecker.tsx';
|
||||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||||
import { ExtensionSettings } from '@/screens/settings/ExtensionSettings.tsx';
|
import { BrowseSettings } from '@/screens/settings/BrowseSettings.tsx';
|
||||||
import { WebUISettings } from '@/screens/settings/WebUISettings.tsx';
|
import { WebUISettings } from '@/screens/settings/WebUISettings.tsx';
|
||||||
import { Migrate } from '@/screens/Migrate.tsx';
|
import { Migrate } from '@/screens/Migrate.tsx';
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ export const App: React.FC = () => (
|
|||||||
<Route path="backup" element={<Backup />} />
|
<Route path="backup" element={<Backup />} />
|
||||||
<Route path="server" element={<ServerSettings />} />
|
<Route path="server" element={<ServerSettings />} />
|
||||||
<Route path="webUI" element={<WebUISettings />} />
|
<Route path="webUI" element={<WebUISettings />} />
|
||||||
<Route path="extensionSettings" element={<ExtensionSettings />} />
|
<Route path="browseSettings" element={<BrowseSettings />} />
|
||||||
</Route>
|
</Route>
|
||||||
|
|
||||||
{/* Manga Routes */}
|
{/* Manga Routes */}
|
||||||
|
|||||||
@@ -275,8 +275,7 @@
|
|||||||
"title": "Extension repositories"
|
"title": "Extension repositories"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"title": "Extension Settings"
|
|
||||||
},
|
},
|
||||||
"state": {
|
"state": {
|
||||||
"label": {
|
"label": {
|
||||||
@@ -684,6 +683,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"settings": {
|
"settings": {
|
||||||
|
"browse": {
|
||||||
|
"title": "Browse settings"
|
||||||
|
},
|
||||||
"about": {
|
"about": {
|
||||||
"server": {
|
"server": {
|
||||||
"label": {
|
"label": {
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ export function Extensions() {
|
|||||||
{FileInputComponent}
|
{FileInputComponent}
|
||||||
<Stack sx={{ paddingTop: '20px' }} alignItems="center" justifyContent="center" rowGap="10px">
|
<Stack sx={{ paddingTop: '20px' }} alignItems="center" justifyContent="center" rowGap="10px">
|
||||||
<Typography>{t('extension.label.add_repository_info')}</Typography>
|
<Typography>{t('extension.label.add_repository_info')}</Typography>
|
||||||
<Button component={Link} variant="contained" to="/settings/extensionSettings">
|
<Button component={Link} variant="contained" to="/browse/extensionSettings">
|
||||||
{t('settings.title')}
|
{t('settings.title')}
|
||||||
</Button>
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ export function Settings() {
|
|||||||
secondary={t('settings.clear_cache.label.description')}
|
secondary={t('settings.clear_cache.label.description')}
|
||||||
/>
|
/>
|
||||||
</ListItemButton>
|
</ListItemButton>
|
||||||
<ListItemLink to="/settings/extensionSettings">
|
<ListItemLink to="/settings/browseSettings">
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
<ExploreOutlinedIcon />
|
<ExploreOutlinedIcon />
|
||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
|
|||||||
@@ -22,27 +22,27 @@ import { useLocalStorage } from '@/util/useLocalStorage.tsx';
|
|||||||
|
|
||||||
type ExtensionsSettings = Pick<GqlServerSettings, 'maxSourcesInParallel' | 'localSourcePath' | 'extensionRepos'>;
|
type ExtensionsSettings = Pick<GqlServerSettings, 'maxSourcesInParallel' | 'localSourcePath' | 'extensionRepos'>;
|
||||||
|
|
||||||
const extractExtensionSettings = (settings: GqlServerSettings): ExtensionsSettings => ({
|
const extractBrowseSettings = (settings: GqlServerSettings): ExtensionsSettings => ({
|
||||||
maxSourcesInParallel: settings.maxSourcesInParallel,
|
maxSourcesInParallel: settings.maxSourcesInParallel,
|
||||||
localSourcePath: settings.localSourcePath,
|
localSourcePath: settings.localSourcePath,
|
||||||
extensionRepos: settings.extensionRepos,
|
extensionRepos: settings.extensionRepos,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const ExtensionSettings = () => {
|
export const BrowseSettings = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { setTitle, setAction } = useContext(NavBarContext);
|
const { setTitle, setAction } = useContext(NavBarContext);
|
||||||
|
|
||||||
useSetDefaultBackTo('settings');
|
useSetDefaultBackTo('settings');
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setTitle(t('extension.settings.title'));
|
setTitle(t('settings.browse.title'));
|
||||||
setAction(null);
|
setAction(null);
|
||||||
}, [t]);
|
}, [t]);
|
||||||
|
|
||||||
const [showNsfw, setShowNsfw] = useLocalStorage<boolean>('showNsfw', true);
|
const [showNsfw, setShowNsfw] = useLocalStorage<boolean>('showNsfw', true);
|
||||||
|
|
||||||
const { data } = requestManager.useGetServerSettings();
|
const { data } = requestManager.useGetServerSettings();
|
||||||
const serverSettings = data ? extractExtensionSettings(data.settings) : undefined;
|
const serverSettings = data ? extractBrowseSettings(data.settings) : undefined;
|
||||||
const [mutateSettings] = requestManager.useUpdateServerSettings();
|
const [mutateSettings] = requestManager.useUpdateServerSettings();
|
||||||
|
|
||||||
const updateSetting = <Setting extends keyof ExtensionsSettings>(
|
const updateSetting = <Setting extends keyof ExtensionsSettings>(
|
||||||
Reference in New Issue
Block a user