diff --git a/src/assets/locales/en.json b/src/assets/locales/en.json index 78653fed..8d9b0b72 100644 --- a/src/assets/locales/en.json +++ b/src/assets/locales/en.json @@ -16,6 +16,7 @@ "title": "Login to your account", "description": "Please enter your passphrase to login to your account", "validationError": "Invalid or incomplete passphrase", + "deviceLengthError": "Please enter a device name", "submit": "Login", "passphraseLabel": "12-Word passphrase", "passphrasePlaceholder": "Passphrase" diff --git a/src/components/form/Dropdown.tsx b/src/components/form/Dropdown.tsx index c1e36c01..febe923f 100644 --- a/src/components/form/Dropdown.tsx +++ b/src/components/form/Dropdown.tsx @@ -21,7 +21,7 @@ export function Dropdown(props: DropdownProps) { {() => ( <> - + {props.selectedItem.leftIcon ? props.selectedItem.leftIcon diff --git a/src/components/layout/Footer.tsx b/src/components/layout/Footer.tsx index 3704c446..ec4951a6 100644 --- a/src/components/layout/Footer.tsx +++ b/src/components/layout/Footer.tsx @@ -4,6 +4,7 @@ import { useHistory } from "react-router-dom"; import { Icon, Icons } from "@/components/Icon"; import { BrandPill } from "@/components/layout/BrandPill"; import { WideContainer } from "@/components/layout/WideContainer"; +import { shouldHaveDmcaPage } from "@/pages/Dmca"; import { conf } from "@/setup/config"; function FooterLink(props: { @@ -30,6 +31,8 @@ function Dmca() { const { t } = useTranslation(); const history = useHistory(); + if (!shouldHaveDmcaPage()) return null; + return ( history.push("/dmca")}> {t("footer.links.dmca")} diff --git a/src/components/player/atoms/settings/CaptionsView.tsx b/src/components/player/atoms/settings/CaptionsView.tsx index 437d5fde..bfee8b5f 100644 --- a/src/components/player/atoms/settings/CaptionsView.tsx +++ b/src/components/player/atoms/settings/CaptionsView.tsx @@ -130,10 +130,12 @@ export function CaptionsView({ id }: { id: string }) { [selectLanguage, setCurrentlyDownloading] ); - const content = subtitleList.map((v) => { + const content = subtitleList.map((v, i) => { return ( {t("screens.dmca.text")} - dmca@movie-web.app + {conf().DMCA_EMAIL ?? ""} diff --git a/src/pages/parts/auth/AccountCreatePart.tsx b/src/pages/parts/auth/AccountCreatePart.tsx index 3de705f7..7fa90ff7 100644 --- a/src/pages/parts/auth/AccountCreatePart.tsx +++ b/src/pages/parts/auth/AccountCreatePart.tsx @@ -32,11 +32,18 @@ export function AccountCreatePart(props: AccountCreatePartProps) { const [colorB, setColorB] = useState("#2E65CF"); const [userIcon, setUserIcon] = useState(UserIcons.USER); const { t } = useTranslation(); - // TODO validate device and account before next step + const [hasDeviceError, setHasDeviceError] = useState(false); const nextStep = useCallback(() => { + setHasDeviceError(false); + const validatedDevice = device.trim(); + if (validatedDevice.length === 0) { + setHasDeviceError(true); + return; + } + props.onNext?.({ - device, + device: validatedDevice, profile: { colorA, colorB, @@ -75,6 +82,11 @@ export function AccountCreatePart(props: AccountCreatePartProps) { value={userIcon} onInput={setUserIcon} /> + {hasDeviceError ? ( +

+ {t("auth.login.deviceLengthError")} +

+ ) : null}