mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Add oidcs on the server-url page
This commit is contained in:
parent
e8b4a26eda
commit
35e1cc7253
@ -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);
|
||||
}}
|
||||
>
|
||||
|
1
front/packages/primitives/src/types.d.ts
vendored
1
front/packages/primitives/src/types.d.ts
vendored
@ -41,7 +41,6 @@ declare module "react-native" {
|
||||
}
|
||||
interface ViewProps {
|
||||
dataSet?: Record<string, string>;
|
||||
href?: string;
|
||||
hrefAttrs?: {
|
||||
rel: "noreferrer";
|
||||
target?: "_blank";
|
||||
|
@ -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 = () => {
|
||||
)}
|
||||
</View>
|
||||
<View {...css({ marginTop: ts(5) })}>
|
||||
<View {...css({ flexDirection: "row", width: percent(100), alignItems: "center" })}>
|
||||
{data &&
|
||||
Object.values(data.oidc).map((x) => (
|
||||
<Link
|
||||
key={x.displayName}
|
||||
href={{ pathname: x.link, query: { apiUrl } }}
|
||||
{...css({ justifyContent: "center" })}
|
||||
>
|
||||
{x.logoUrl != null ? (
|
||||
<ImageBackground
|
||||
source={{ uri: x.logoUrl }}
|
||||
{...css({ width: ts(3), height: ts(3), margin: ts(1) })}
|
||||
/>
|
||||
) : (
|
||||
t("login.via", { provider: x.displayName })
|
||||
)}
|
||||
</Link>
|
||||
))}
|
||||
</View>
|
||||
<HR />
|
||||
<View {...css({ flexDirection: "row", gap: ts(2) })}>
|
||||
<Button
|
||||
|
Loading…
x
Reference in New Issue
Block a user