diff --git a/front/packages/primitives/src/links.tsx b/front/packages/primitives/src/links.tsx index 003adf29..10942d2e 100644 --- a/front/packages/primitives/src/links.tsx +++ b/front/packages/primitives/src/links.tsx @@ -99,7 +99,7 @@ export const Link = ({ target, children, ...props -}: { href?: string | null; target?: string; replace?: boolean } & PressableProps) => { +}: { href?: string | UrlObject | null; target?: string; replace?: boolean } & PressableProps) => { const linkProps = useLink({ href: href ?? "#", replace, @@ -114,7 +114,8 @@ export const Link = ({ onPress={(e?: any) => { props?.onPress?.(e); if (e?.defaultPrevented) return; - if (Platform.OS !== "web" && href?.includes("://")) Linking.openURL(href); + if (Platform.OS !== "web" && typeof href === "string" && href?.includes("://")) + Linking.openURL(href); else linkProps.onPress(e); }} > diff --git a/front/packages/primitives/src/types.d.ts b/front/packages/primitives/src/types.d.ts index 96b1ef58..4f66516d 100644 --- a/front/packages/primitives/src/types.d.ts +++ b/front/packages/primitives/src/types.d.ts @@ -41,7 +41,6 @@ declare module "react-native" { } interface ViewProps { dataSet?: Record; - href?: string; hrefAttrs?: { rel: "noreferrer"; target?: "_blank"; diff --git a/front/packages/ui/src/login/server-url.tsx b/front/packages/ui/src/login/server-url.tsx index 4c3f9a40..c4b40712 100644 --- a/front/packages/ui/src/login/server-url.tsx +++ b/front/packages/ui/src/login/server-url.tsx @@ -19,12 +19,12 @@ */ import { QueryIdentifier, QueryPage, ServerInfo, ServerInfoP, useFetch } from "@kyoo/models"; -import { Button, P, Input, ts, H1, HR } from "@kyoo/primitives"; +import { Button, P, Link, Input, ts, H1, HR } from "@kyoo/primitives"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import { Platform, View } from "react-native"; +import { ImageBackground, Platform, View } from "react-native"; import { useRouter } from "solito/router"; -import { Theme, useYoshiki } from "yoshiki/native"; +import { Theme, percent, useYoshiki } from "yoshiki/native"; import { DefaultLayout } from "../layout"; export const cleanApiUrl = (apiUrl: string) => { @@ -65,6 +65,25 @@ export const ServerUrlPage: QueryPage = () => { )} + + {data && + Object.values(data.oidc).map((x) => ( + + {x.logoUrl != null ? ( + + ) : ( + t("login.via", { provider: x.displayName }) + )} + + ))} +