diff --git a/src/i18n/locale/en.json b/src/i18n/locale/en.json index a1841d15e0..67b244955e 100644 --- a/src/i18n/locale/en.json +++ b/src/i18n/locale/en.json @@ -223,6 +223,7 @@ } }, "label": { + "add_repository_info": "You have to add a extension repository to be able to install extensions", "installation_failed": "Could not install the extension", "installed_successfully": "Extension installed", "installing_file": "Installing extension fileā€¦", @@ -249,9 +250,9 @@ } }, "label": { - "description": "Add custom repositories from which extensions can be installed", + "description": "Add repositories from which extensions can be installed", "disclaimer": "Suwayomi does not provide any support for 3rd party repositories or extensions!
Use with caution as there could be malicious actors making those repositories.
You as the user need to verify the security and that you trust any repository or extension.", - "title": "Custom repositories" + "title": "Extension repositories" } } } diff --git a/src/screens/Extensions.tsx b/src/screens/Extensions.tsx index 1ee21e0f5d..503c574bff 100644 --- a/src/screens/Extensions.tsx +++ b/src/screens/Extensions.tsx @@ -11,9 +11,10 @@ import { fromEvent } from 'file-selector'; import IconButton from '@mui/material/IconButton'; import AddIcon from '@mui/icons-material/Add'; import { StringParam, useQueryParam } from 'use-query-params'; -import { Tooltip, useMediaQuery } from '@mui/material'; +import { Button, Stack, Tooltip, Typography, useMediaQuery } from '@mui/material'; import { useTranslation } from 'react-i18next'; import { useTheme } from '@mui/material/styles'; +import { Link } from 'react-router-dom'; import { requestManager } from '@/lib/requests/RequestManager.ts'; import { extensionDefaultLangs, DefaultLanguage, langSortCmp } from '@/util/language'; import { useLocalStorage } from '@/util/useLocalStorage'; @@ -99,7 +100,8 @@ export function Extensions() { const isMobileWidth = useMediaQuery(theme.breakpoints.down('sm')); const { data: serverSettingsData } = requestManager.useGetServerSettings(); - const areMultipleReposInUse = !!serverSettingsData?.settings.extensionRepos.length; // tachiyomi repo is used by default + const areReposDefined = !!serverSettingsData?.settings.extensionRepos.length; + const areMultipleReposInUse = (serverSettingsData?.settings.extensionRepos.length ?? 0) > 1; const inputRef = useRef(null); const { setTitle, setAction } = useContext(NavBarContext); @@ -206,6 +208,18 @@ export function Extensions() { return ; } + const showAddRepoInfo = !allExtensions?.length && !areReposDefined; + if (showAddRepoInfo) { + return ( + + {t('extension.label.add_repository_info')} + + + ); + } + return ( <> {toasts}