mirror of
https://github.com/Jellify-Music/App.git
synced 2026-05-08 04:19:34 -05:00
styling input form
This commit is contained in:
@@ -1,18 +1,17 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useState } from "react";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { useColorScheme } from "react-native";
|
|
||||||
import AsyncStorage from "@react-native-async-storage/async-storage";
|
import AsyncStorage from "@react-native-async-storage/async-storage";
|
||||||
import { useMutation } from "@tanstack/react-query";
|
import { useMutation } from "@tanstack/react-query";
|
||||||
import { AsyncStorageKeys } from "../../../enums/async-storage-keys";
|
import { AsyncStorageKeys } from "../../../enums/async-storage-keys";
|
||||||
import { JellifyServer } from "../../../types/JellifyServer";
|
import { JellifyServer } from "../../../types/JellifyServer";
|
||||||
import { mutateServer, serverMutation } from "../../../api/mutators/functions/storage";
|
import { mutateServer, serverMutation } from "../../../api/mutators/functions/storage";
|
||||||
import { useApiClientContext } from "../../jellyfin-api-provider";
|
import { useApiClientContext } from "../../jellyfin-api-provider";
|
||||||
import { Button, Input, SizableText, useTheme, View, YStack, Stack, XStack, getFontSizeToken, Paragraph, H2 } from "tamagui";
|
import { Button, useTheme, View, XStack } from "tamagui";
|
||||||
import { CheckboxWithLabel } from "../../helpers/checkbox-with-label";
|
|
||||||
import { SwitchWithLabel } from "../../helpers/switch-with-label";
|
import { SwitchWithLabel } from "../../helpers/switch-with-label";
|
||||||
import { buildApiClient } from "../../../api/client";
|
import { buildApiClient } from "../../../api/client";
|
||||||
import { useAuthenticationContext } from "../provider";
|
import { useAuthenticationContext } from "../provider";
|
||||||
import { Heading } from "../../helpers/text";
|
import { Heading } from "../../helpers/text";
|
||||||
|
import Input from "../../helpers/input";
|
||||||
|
|
||||||
const http = "http://"
|
const http = "http://"
|
||||||
const https = "https://"
|
const https = "https://"
|
||||||
@@ -67,8 +66,8 @@ export default function ServerAddress(): React.JSX.Element {
|
|||||||
label="HTTPS"
|
label="HTTPS"
|
||||||
size="$2"
|
size="$2"
|
||||||
width={150} />
|
width={150} />
|
||||||
|
|
||||||
<Input
|
<Input
|
||||||
flexGrow={1}
|
|
||||||
placeholder="jellyfin.org"
|
placeholder="jellyfin.org"
|
||||||
onChangeText={setServerAddress} />
|
onChangeText={setServerAddress} />
|
||||||
</XStack>
|
</XStack>
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import React, { SetStateAction } from 'react';
|
||||||
|
import { Input as TamaguiInput} from 'tamagui';
|
||||||
|
import { styles } from './text';
|
||||||
|
|
||||||
|
interface InputProps {
|
||||||
|
onChangeText: React.Dispatch<SetStateAction<string | undefined>>,
|
||||||
|
placeholder: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function Input(props: InputProps): React.JSX.Element {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<TamaguiInput
|
||||||
|
style={styles.text}
|
||||||
|
flexGrow={1}
|
||||||
|
placeholder={props.placeholder}
|
||||||
|
onChangeText={props.onChangeText}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -1,15 +1,16 @@
|
|||||||
import { StyleSheet } from "react-native"
|
import { StyleSheet } from "react-native"
|
||||||
import { H1, SizeTokens, Label as TamaguiLabel } from "tamagui"
|
import { H1, SizeTokens, Label as TamaguiLabel } from "tamagui"
|
||||||
|
import { Fonts } from '../../enums/assets/fonts';
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
export const styles = StyleSheet.create({
|
||||||
heading: {
|
heading: {
|
||||||
fontFamily: 'Aileron-Black'
|
fontFamily: Fonts.Black
|
||||||
},
|
},
|
||||||
label: {
|
label: {
|
||||||
fontFamily: 'Aileron-SemiBold'
|
fontFamily: Fonts.Heavy
|
||||||
},
|
},
|
||||||
text: {
|
text: {
|
||||||
fontFamily: 'Aileron-Regular'
|
fontFamily: Fonts.Regular
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
export enum Fonts {
|
||||||
|
Black = "Aileron-Black",
|
||||||
|
BlackItalic = "Aileron-BlackItalic",
|
||||||
|
Bold = "Aileron-Bold",
|
||||||
|
BoldItalic = "Aileron-BoldItalic",
|
||||||
|
Heavy = "Aileron-Heavy",
|
||||||
|
HeavyItalic = "Aileron-HeavyItalic",
|
||||||
|
Regular = "Aileron-Regular"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user