From c7b361bcac657832c368991fd550cb1aee85a042 Mon Sep 17 00:00:00 2001 From: mrjvs Date: Fri, 1 Dec 2023 23:29:24 +0100 Subject: [PATCH 1/5] add hover to locale dropdown --- src/components/form/Dropdown.tsx | 2 +- themes/default.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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/themes/default.ts b/themes/default.ts index f0dd5113..bc855bc4 100644 --- a/themes/default.ts +++ b/themes/default.ts @@ -97,6 +97,7 @@ export const defaultTheme = { dropdown: { background: "#171728", altBackground: "#151525", + hoverBackground: "#202036", highlight: "#afa349", highlightHover: "#FCEC61", text: "#846D95", From 83bc9637b0d1561c9f930e9da66bd29e385826ee Mon Sep 17 00:00:00 2001 From: mrjvs Date: Fri, 1 Dec 2023 23:36:48 +0100 Subject: [PATCH 2/5] Prevent language duplication in search --- src/components/player/atoms/settings/CaptionsView.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 ( Date: Sat, 2 Dec 2023 00:02:09 +0100 Subject: [PATCH 3/5] make email an optional setting + add device name validation --- src/assets/locales/en.json | 1 + src/components/layout/Footer.tsx | 3 +++ src/pages/Dmca.tsx | 8 ++++++-- src/pages/parts/auth/AccountCreatePart.tsx | 16 ++++++++++++++-- src/pages/parts/auth/LoginFormPart.tsx | 9 ++++++--- src/setup/App.tsx | 7 +++++-- src/setup/config.ts | 5 +++++ 7 files changed, 40 insertions(+), 9 deletions(-) diff --git a/src/assets/locales/en.json b/src/assets/locales/en.json index 78653fed..d4adb9a1 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 entire a device name", "submit": "Login", "passphraseLabel": "12-Word passphrase", "passphrasePlaceholder": "Passphrase" 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/pages/Dmca.tsx b/src/pages/Dmca.tsx index 4aff3985..d0ceebd3 100644 --- a/src/pages/Dmca.tsx +++ b/src/pages/Dmca.tsx @@ -4,10 +4,14 @@ import { Icon, Icons } from "@/components/Icon"; import { ThinContainer } from "@/components/layout/ThinContainer"; import { Heading1, Paragraph } from "@/components/utils/Text"; import { PageTitle } from "@/pages/parts/util/PageTitle"; +import { conf } from "@/setup/config"; import { SubPageLayout } from "./layouts/SubPageLayout"; -// TODO make email a constant +export function shouldHaveDmcaPage() { + return !!conf().DMCA_EMAIL; +} + export function DmcaPage() { const { t } = useTranslation(); @@ -19,7 +23,7 @@ export function DmcaPage() { {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}