11import * as React from 'react' ;
22import { StyleSheet , View , Text , TextInput , Pressable , ActivityIndicator } from 'react-native' ;
3+ import { theme } from '../theme' ;
34
45type Props = {
56 onLoginSuccess : ( user : string ) => void ;
@@ -77,7 +78,7 @@ export function LoginForm({ onLoginSuccess }: Props) {
7778 * @param password The password to authenticate.
7879 * @returns username if the username and password are correct, null otherwise.
7980 */
80- async function authUser ( username : string , password : string ) : Promise < string | null > {
81+ function authUser ( username : string , password : string ) : Promise < string | null > {
8182 return new Promise ( ( resolve ) =>
8283 setTimeout ( ( ) => {
8384 const hasValidCredentials = username === 'admin' && password === 'admin1' ;
@@ -98,17 +99,17 @@ const styles = StyleSheet.create({
9899 } ,
99100 textLabel : {
100101 fontSize : 16 ,
101- color : '#444' ,
102+ color : theme . colors . label ,
102103 } ,
103104 textInput : {
104105 fontSize : 20 ,
105106 padding : 8 ,
106107 marginVertical : 8 ,
107- borderColor : 'black' ,
108+ borderColor : theme . colors . text ,
108109 borderWidth : 1 ,
109110 } ,
110111 button : {
111- backgroundColor : '#3256a8' ,
112+ backgroundColor : theme . colors . button ,
112113 padding : 16 ,
113114 alignItems : 'center' ,
114115 justifyContent : 'center' ,
@@ -118,10 +119,10 @@ const styles = StyleSheet.create({
118119 buttonText : {
119120 fontSize : 20 ,
120121 fontWeight : '600' ,
121- color : 'white' ,
122+ color : theme . colors . buttonText ,
122123 } ,
123124 validator : {
124- color : 'red' ,
125+ color : theme . colors . validator ,
125126 fontSize : 18 ,
126127 marginTop : 8 ,
127128 } ,
0 commit comments