feat: Migrate off some more native-base components
This commit is contained in:
6 files changed
+25
-18
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import React from 'react';
|
||||
import { Alert, HStack, Text } from 'native-base';
|
||||
import { Text } from 'react-native';
|
||||
import { Alert, HStack } from 'native-base';
|
||||
|
||||
const FormErrors = ({ errors }) => {
|
||||
if (!Object.keys(errors).length || !['non_field_errors', 'detail'].some((errorField) => errorField in errors)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { Linking, StyleSheet, View } from 'react-native';
|
||||
import { ScrollView, Spinner, Text } from 'native-base';
|
||||
import { ActivityIndicator, Linking, StyleSheet, View, Text } from 'react-native';
|
||||
import { ScrollView } from 'native-base';
|
||||
import { Button } from 'react-native-ui-lib';
|
||||
|
||||
import theme from '../../theme';
|
||||
@@ -50,7 +50,7 @@ const Login = () => {
|
||||
>
|
||||
<Text>Glemt passord?</Text>
|
||||
</Button>
|
||||
{isLoggingIn && <Spinner color="#f58220" />}
|
||||
{isLoggingIn && <ActivityIndicator color="#f58220" />}
|
||||
</View>
|
||||
</ScrollView>
|
||||
);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import React from 'react';
|
||||
import { View, StyleSheet } from 'react-native';
|
||||
import { Spinner } from 'native-base';
|
||||
import { View, StyleSheet, ActivityIndicator } from 'react-native';
|
||||
|
||||
import theme from '../../theme';
|
||||
import useMembership from './useMembership';
|
||||
@@ -14,7 +13,7 @@ const Membership = () => {
|
||||
if (isFetchingUserData) {
|
||||
return (
|
||||
<View style={styles.card}>
|
||||
<Spinner color="#f58220" />
|
||||
<ActivityIndicator color="#f58220" />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import React from 'react';
|
||||
|
||||
import { ScrollView, Text, View, StyleSheet } from 'react-native';
|
||||
import { Text as NBText } from 'native-base';
|
||||
import { Button } from 'react-native-ui-lib';
|
||||
import theme from '../../theme';
|
||||
|
||||
@@ -14,7 +13,7 @@ const MembershipInfo = ({ onRegister, onLogin }) => (
|
||||
</Text>
|
||||
<View style={styles.button}>
|
||||
<Button onPress={onRegister} fullWidth>
|
||||
<NBText>Bli medlem</NBText>
|
||||
<Text>Bli medlem</Text>
|
||||
</Button>
|
||||
</View>
|
||||
<Text style={styles.header}>Hva får jeg?</Text>
|
||||
@@ -25,7 +24,7 @@ const MembershipInfo = ({ onRegister, onLogin }) => (
|
||||
<Text style={styles.em}>Allerede medlem?</Text>
|
||||
<View style={styles.button}>
|
||||
<Button onPress={onLogin} fullWidth>
|
||||
<NBText>Logg inn</NBText>
|
||||
<Text>Logg inn</Text>
|
||||
</Button>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
import { Image, ScrollView, StyleSheet, Text, TouchableOpacity, View, RefreshControl } from 'react-native';
|
||||
import { Text as NBText, Spinner } from 'native-base';
|
||||
import {
|
||||
Image,
|
||||
ScrollView,
|
||||
StyleSheet,
|
||||
Text,
|
||||
TouchableOpacity,
|
||||
View,
|
||||
RefreshControl,
|
||||
ActivityIndicator,
|
||||
} from 'react-native';
|
||||
import { Button } from 'react-native-ui-lib';
|
||||
import Confetti from 'react-native-confetti';
|
||||
|
||||
@@ -56,14 +64,14 @@ const PurchaseButton = ({ user, isChargingMembership, isLoadingMembershipType, o
|
||||
|
||||
return (
|
||||
<View>
|
||||
{isChargingMembership && <Spinner color="#f58220" />}
|
||||
{isChargingMembership && <ActivityIndicator color="#f58220" />}
|
||||
<Button
|
||||
onPress={onChargePress}
|
||||
fullWidth
|
||||
disabled={isChargingMembership || isLoadingMembershipType}
|
||||
style={styles.purchaseButton}
|
||||
>
|
||||
<NBText>{`Kjøp medlemskap (${membershipPrice} NOK)`}</NBText>
|
||||
<Text>{`Kjøp medlemskap (${membershipPrice} NOK)`}</Text>
|
||||
</Button>
|
||||
<View style={styles.purchaseText}>
|
||||
<Text style={styles.purchaseTextInner}>Medlemskapet er gyldig i ett år</Text>
|
||||
@@ -174,7 +182,7 @@ const Proof = ({ onLogoutPress, user, fetchUser, isFetchingUserData }) => {
|
||||
</View>
|
||||
<View>
|
||||
<Button onPress={onLogoutPress} style={styles.logoutButton} small>
|
||||
<NBText>Logg ut</NBText>
|
||||
<Text>Logg ut</Text>
|
||||
</Button>
|
||||
</View>
|
||||
</ScrollView>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import React from 'react';
|
||||
import { Spinner, Text, ScrollView } from 'native-base';
|
||||
import { ScrollView } from 'native-base';
|
||||
import { Button } from 'react-native-ui-lib';
|
||||
|
||||
import { StyleSheet, View } from 'react-native';
|
||||
import { ActivityIndicator, StyleSheet, View, Text } from 'react-native';
|
||||
import * as EmailValidator from 'email-validator';
|
||||
|
||||
import theme from '../../theme';
|
||||
@@ -73,7 +73,7 @@ const UserRegister = () => {
|
||||
<Button fullWidth disabled={isDisabled} onPress={onSubmit} style={styles.registerButton}>
|
||||
<Text>Registrer meg</Text>
|
||||
</Button>
|
||||
{isRegisteringUser && <Spinner color="#f58220" />}
|
||||
{isRegisteringUser && <ActivityIndicator color="#f58220" />}
|
||||
</View>
|
||||
</ScrollView>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user