remove remaining native-base usage
This commit is contained in:
12 files changed
+37
-91
No files matched your search
@@ -2,7 +2,6 @@ import { ApolloClient, HttpLink, InMemoryCache, ApolloProvider } from '@apollo/c
|
||||
import { StripeProvider } from '@stripe/stripe-react-native';
|
||||
import Constants from 'expo-constants';
|
||||
import React from 'react';
|
||||
import { LogBox } from 'react-native';
|
||||
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
||||
import { Provider } from 'react-redux';
|
||||
import { PersistGate } from 'redux-persist/integration/react';
|
||||
@@ -16,8 +15,6 @@ const apolloClient = new ApolloClient({
|
||||
link: new HttpLink({ uri: `${process.env.EXPO_PUBLIC_DUSKEN_API_URL}/api/graphql/` }),
|
||||
cache: new InMemoryCache(),
|
||||
});
|
||||
// FIXME: Replace unmaintained native-base with https://wix.github.io/react-native-ui-lib/ which produces this warning
|
||||
LogBox.ignoreLogs(['In React 18, SSRProvider is not necessary and is a noop. You can remove it from your app.']);
|
||||
|
||||
loadTheme();
|
||||
|
||||
|
||||
+1
-6
@@ -1,4 +1,3 @@
|
||||
import { NativeBaseProvider } from 'native-base';
|
||||
import React, { useEffect } from 'react';
|
||||
|
||||
import Navigation from './Navigation';
|
||||
@@ -17,11 +16,7 @@ const Dusken = () => {
|
||||
}
|
||||
});
|
||||
|
||||
return (
|
||||
<NativeBaseProvider>
|
||||
<Navigation />
|
||||
</NativeBaseProvider>
|
||||
);
|
||||
return <Navigation />;
|
||||
};
|
||||
|
||||
export default Dusken;
|
||||
+8
-8
@@ -4,14 +4,14 @@ import { NavigationContainer } from '@react-navigation/native';
|
||||
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
||||
import React from 'react';
|
||||
|
||||
import About from './modules/about/About';
|
||||
import EventDetail from './modules/events/EventDetail';
|
||||
import EventList from './modules/events/EventList';
|
||||
import Login from './modules/login/Login';
|
||||
import Membership from './modules/membership/Membership';
|
||||
import UserRegister from './modules/register/UserRegister';
|
||||
import theme from './theme';
|
||||
import type { EventStackParamList, HomeTabParamList, UserStackParamList } from './types/navigation';
|
||||
import About from 'src/modules/about/About';
|
||||
import EventDetail from 'src/modules/events/EventDetail';
|
||||
import EventList from 'src/modules/events/EventList';
|
||||
import Login from 'src/modules/login/Login';
|
||||
import Membership from 'src/modules/membership/Membership';
|
||||
import UserRegister from 'src/modules/register/UserRegister';
|
||||
import theme from 'src/theme';
|
||||
import type { EventStackParamList, HomeTabParamList, UserStackParamList } from 'src/types/navigation';
|
||||
|
||||
// This looks ugly, even though it's a recommended style from the branding profile.
|
||||
// TODO: Change this
|
||||
|
||||
@@ -6,7 +6,7 @@ import theme from 'src/theme';
|
||||
const PrivacyButton = () => (
|
||||
<TouchableOpacity
|
||||
style={styles.button}
|
||||
onPress={() => Linking.openURL(process.env.EXPO_PUBLIC_DUSKEN_PRIVACY_POLICY_URL)}
|
||||
onPress={() => Linking.openURL(process.env.EXPO_PUBLIC_DUSKEN_PRIVACY_POLICY_URL || '')}
|
||||
>
|
||||
<Text style={styles.linkText}>Personvern</Text>
|
||||
</TouchableOpacity>
|
||||
|
||||
@@ -72,7 +72,7 @@ const openMap = () => {
|
||||
/** FIXME: Values here are pretty hardcoded. Should fetch config from a JSON-file or API */
|
||||
const About = () => (
|
||||
<ScrollView>
|
||||
<View style={styles.card}>
|
||||
<View style={theme.card}>
|
||||
<Text style={[styles.header, { marginTop: 8 }]}>Det Norske Studentersamfund</Text>
|
||||
<TouchableOpacity onPress={() => Linking.openURL('https://www.studentersamfundet.no/')}>
|
||||
<Image style={styles.logo} source={logo} />
|
||||
@@ -167,7 +167,6 @@ const styles = StyleSheet.create({
|
||||
paddingBottom: 10,
|
||||
lineHeight: 25,
|
||||
},
|
||||
card: theme.card,
|
||||
featuredImage: {
|
||||
height: 230,
|
||||
width: null,
|
||||
|
||||
@@ -166,11 +166,11 @@ const EventDetail = ({
|
||||
return (
|
||||
<ScrollView>
|
||||
{event.thumbnail.medium_large && <Image source={{ uri: event.thumbnail.medium_large }} style={styles.image} />}
|
||||
<View style={styles.card}>
|
||||
<View style={theme.card}>
|
||||
{/* Date and title */}
|
||||
<View style={styles.dateAndTitle}>
|
||||
<View style={styles.dateContainer}>
|
||||
<View style={[styles.card, styles.dateCard]}>
|
||||
<View style={[theme.card, styles.dateCard]}>
|
||||
<Text style={styles.day}>{format(event.start_time, FORMAT_DAY)}</Text>
|
||||
<Text style={styles.month}>{format(event.start_time, FORMAT_MONTH)}</Text>
|
||||
<Year startTime={event.start_time} />
|
||||
@@ -229,7 +229,6 @@ const styles = StyleSheet.create({
|
||||
fontWeight: 'bold',
|
||||
color: theme.colors.neufBlack,
|
||||
},
|
||||
card: theme.card,
|
||||
image: {
|
||||
height: 260,
|
||||
width: null,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { SimpleLineIcons as Icon } from '@expo/vector-icons';
|
||||
import moment from 'moment';
|
||||
import { Card, Text, Spinner, ArrowForwardIcon, HStack } from 'native-base';
|
||||
import React from 'react';
|
||||
import { StyleSheet, View, Platform, SectionList, TouchableOpacity } from 'react-native';
|
||||
import { StyleSheet, View, Platform, SectionList, TouchableOpacity, ActivityIndicator, Text } from 'react-native';
|
||||
import { Button } from 'react-native-ui-lib';
|
||||
import 'moment/locale/nb';
|
||||
|
||||
@@ -33,7 +33,7 @@ const EventList = () => {
|
||||
}}
|
||||
style={styles.listItem}
|
||||
>
|
||||
<HStack>
|
||||
<View style={styles.row}>
|
||||
<View style={{ flex: 5 }}>
|
||||
<Text style={styles.listItemTitle} numberOfLines={1}>
|
||||
{item.title.decoded}
|
||||
@@ -41,9 +41,9 @@ const EventList = () => {
|
||||
<Text style={styles.listItemTime}>{formatTime(item.start_time)}</Text>
|
||||
</View>
|
||||
<View style={styles.arrow}>
|
||||
<ArrowForwardIcon size={4} color={theme.colors.neufBlack} marginTop={3} />
|
||||
<Icon name="arrow-right" style={{ color: theme.colors.neufBlack, marginTop: 3 }} />
|
||||
</View>
|
||||
</HStack>
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
);
|
||||
|
||||
@@ -52,23 +52,21 @@ const EventList = () => {
|
||||
const Footer = () =>
|
||||
!loading && (
|
||||
<View style={{ paddingVertical: 20 }}>
|
||||
<Spinner color={theme.colors.neufOrange} />
|
||||
<ActivityIndicator color={theme.colors.neufOrange} />
|
||||
</View>
|
||||
);
|
||||
|
||||
if (error) {
|
||||
return (
|
||||
<View>
|
||||
<Card style={{ margin: 4 }}>
|
||||
<View>
|
||||
<Text style={styles.loadingText}>Kunne ikke hente programmet...</Text>
|
||||
</View>
|
||||
<View>
|
||||
<Button onPress={handleRefresh}>
|
||||
<Text>Prøv igjen</Text>
|
||||
</Button>
|
||||
</View>
|
||||
</Card>
|
||||
<View style={theme.card}>
|
||||
<View>
|
||||
<Text style={styles.loadingText}>Kunne ikke hente programmet...</Text>
|
||||
</View>
|
||||
<View>
|
||||
<Button onPress={handleRefresh}>
|
||||
<Text>Prøv igjen</Text>
|
||||
</Button>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
@@ -85,7 +83,7 @@ const EventList = () => {
|
||||
onEndReachedThreshold={10}
|
||||
initialNumToRender={10}
|
||||
ListFooterComponent={Footer}
|
||||
style={[styles.card, styles.list]}
|
||||
style={[theme.card, styles.list]}
|
||||
ListHeaderComponent={Header}
|
||||
/>
|
||||
);
|
||||
@@ -125,7 +123,6 @@ const styles = StyleSheet.create({
|
||||
textAlign: 'center',
|
||||
paddingBottom: 8,
|
||||
},
|
||||
card: theme.card,
|
||||
list: {
|
||||
padding: 0,
|
||||
marginTop: 0,
|
||||
@@ -139,4 +136,5 @@ const styles = StyleSheet.create({
|
||||
flex: 1,
|
||||
alignItems: 'flex-end',
|
||||
},
|
||||
row: { flex: 1, flexDirection: 'row' },
|
||||
});
|
||||
@@ -1,6 +1,5 @@
|
||||
import { ScrollView } from 'native-base';
|
||||
import React from 'react';
|
||||
import { ActivityIndicator, Linking, StyleSheet, View, Text } from 'react-native';
|
||||
import { ActivityIndicator, Linking, StyleSheet, View, Text, ScrollView } from 'react-native';
|
||||
import { Button } from 'react-native-ui-lib';
|
||||
|
||||
import FormErrors from 'src/components/FormErrors';
|
||||
@@ -14,7 +13,7 @@ const Login = () => {
|
||||
|
||||
return (
|
||||
<ScrollView>
|
||||
<View style={styles.card}>
|
||||
<View style={theme.card}>
|
||||
<FormErrors errors={errors} />
|
||||
<FormInput
|
||||
name="email"
|
||||
@@ -67,5 +66,4 @@ const styles = StyleSheet.create({
|
||||
marginTop: 32,
|
||||
marginBottom: 16,
|
||||
},
|
||||
card: theme.card,
|
||||
});
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { View, StyleSheet, ActivityIndicator } from 'react-native';
|
||||
import { View, ActivityIndicator } from 'react-native';
|
||||
|
||||
import PrivacyButton from 'src/components/PrivacyButton';
|
||||
import theme from 'src/theme';
|
||||
@@ -14,7 +14,7 @@ const Membership = () => {
|
||||
|
||||
if (isFetchingUserData) {
|
||||
return (
|
||||
<View style={styles.card}>
|
||||
<View style={theme.card}>
|
||||
<ActivityIndicator color={theme.colors.neufOrange} />
|
||||
</View>
|
||||
);
|
||||
@@ -37,40 +37,3 @@ const Membership = () => {
|
||||
);
|
||||
};
|
||||
export default Membership;
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
card: theme.card,
|
||||
paragraph: {
|
||||
textAlign: 'center',
|
||||
fontSize: 16,
|
||||
color: theme.colors.neufBlack,
|
||||
paddingBottom: 10,
|
||||
lineHeight: 25,
|
||||
},
|
||||
button: {
|
||||
marginTop: 6,
|
||||
marginBottom: 16,
|
||||
},
|
||||
em: {
|
||||
fontSize: 16,
|
||||
color: theme.colors.neufBlack,
|
||||
fontStyle: 'italic',
|
||||
textAlign: 'center',
|
||||
marginVertical: 10,
|
||||
},
|
||||
headerTitle: {
|
||||
textAlign: 'center',
|
||||
fontWeight: 'bold',
|
||||
fontSize: 20,
|
||||
color: theme.colors.neufBlack,
|
||||
paddingVertical: 10,
|
||||
lineHeight: 25,
|
||||
},
|
||||
header: {
|
||||
fontSize: 16,
|
||||
fontWeight: 'bold',
|
||||
color: theme.colors.neufBlack,
|
||||
lineHeight: 25,
|
||||
paddingLeft: 2,
|
||||
},
|
||||
});
|
||||
@@ -10,7 +10,7 @@ interface MembershipInfoProps {
|
||||
}
|
||||
const MembershipInfo = ({ onRegister, onLogin }: MembershipInfoProps) => (
|
||||
<ScrollView>
|
||||
<View style={styles.card}>
|
||||
<View style={theme.card}>
|
||||
<Text style={styles.headerTitle}>Hei 👋</Text>
|
||||
<Text style={styles.paragraph}>
|
||||
Her kan du bli medlem i Det Norske Studentersamfund - Chateau Neuf og ha medlemsbeviset ditt på telefonen
|
||||
@@ -38,7 +38,6 @@ const MembershipInfo = ({ onRegister, onLogin }: MembershipInfoProps) => (
|
||||
export default MembershipInfo;
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
card: theme.card,
|
||||
paragraph: {
|
||||
textAlign: 'center',
|
||||
fontSize: 16,
|
||||
|
||||
@@ -185,7 +185,7 @@ const Proof = ({ onLogoutPress, fetchUser, isFetchingUserData }: ProofProps) =>
|
||||
<View>
|
||||
<UserConfetti user={user} confettiRef={confettiRef} />
|
||||
<ScrollView refreshControl={<RefreshControl refreshing={isFetchingUserData} onRefresh={fetchUser} />}>
|
||||
<View style={[styles.card, { paddingVertical: 16 }]}>
|
||||
<View style={[theme.card, { paddingVertical: 16 }]}>
|
||||
<MembershipName user={user} />
|
||||
<Logo user={user} />
|
||||
<MembershipStatus user={user} onMembershipPress={onMembershipPress} />
|
||||
@@ -220,7 +220,6 @@ const Proof = ({ onLogoutPress, fetchUser, isFetchingUserData }: ProofProps) =>
|
||||
export default Proof;
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
card: theme.card,
|
||||
membershipStatus: {
|
||||
marginVertical: 16,
|
||||
},
|
||||
|
||||
@@ -21,7 +21,7 @@ const UserRegister = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<View style={styles.card}>
|
||||
<View style={theme.card}>
|
||||
<ScrollView>
|
||||
<FormInput
|
||||
name="firstName"
|
||||
@@ -113,5 +113,4 @@ const styles = StyleSheet.create({
|
||||
errorBox: {
|
||||
marginVertical: 10,
|
||||
},
|
||||
card: theme.card,
|
||||
});
|
||||
Reference in new issue
Block a user