diff --git a/index.js b/index.js index aaf82f8..452430f 100644 --- a/index.js +++ b/index.js @@ -1,13 +1,13 @@ +// FIXME: This is never loaded by expo import { AppRegistry } from 'react-native'; -import * as Sentry from '@sentry/react-native'; -import Config from 'react-native-config'; +// import * as Sentry from '@sentry/react-native'; import App from './src/App'; import { name as appName } from './app.json'; -if (Config.SENTRY_DSN) { - Sentry.init({ dsn: Config.SENTRY_DSN }); -} +// if (Config.SENTRY_DSN) { +// Sentry.init({ dsn: Config.SENTRY_DSN }); +// } AppRegistry.registerComponent(appName, () => App); diff --git a/src/App.js b/src/App.js index 05241a1..33773f3 100644 --- a/src/App.js +++ b/src/App.js @@ -5,6 +5,7 @@ import { ApolloClient, HttpLink, InMemoryCache, ApolloProvider } from '@apollo/c import { StripeProvider } from '@stripe/stripe-react-native'; import { LogBox } from 'react-native'; +import { loadTheme } from './theme'; import Dusken from './Dusken'; import { store, persistor } from './reduxStore'; @@ -14,7 +15,9 @@ const apolloClient = new ApolloClient({ 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.']) +LogBox.ignoreLogs(['In React 18, SSRProvider is not necessary and is a noop. You can remove it from your app.']); + +loadTheme(); export default function App() { return ( diff --git a/src/Navigation.js b/src/Navigation.js index e655c92..1adc7b7 100644 --- a/src/Navigation.js +++ b/src/Navigation.js @@ -2,7 +2,7 @@ import React from 'react'; import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; import { NavigationContainer } from '@react-navigation/native'; import { createNativeStackNavigator } from '@react-navigation/native-stack'; -import {SimpleLineIcons as Icon} from '@expo/vector-icons'; +import { SimpleLineIcons as Icon } from '@expo/vector-icons'; import EventList from './modules/events/EventList'; import EventDetail from './modules/events/EventDetail'; diff --git a/src/api.js b/src/api.js index bb1af04..b546e06 100644 --- a/src/api.js +++ b/src/api.js @@ -44,7 +44,7 @@ export function requestLogin(username, password) { (data) => { console.log(data); dispatch(loginFailure(data || { non_field_errors: ['Kunne ikke logge inn, prøv igjen'] })); - } + }, ); }; } @@ -75,7 +75,7 @@ export function requestUserData(authToken) { }, (data) => { dispatch(userDataFailure(data || { non_field_errors: ['Kunne ikke hente brukerdata'] })); - } + }, ); }; } @@ -111,7 +111,7 @@ export function requestRegisterUser({ firstName, lastName, email, phoneNumber, p }, (data) => { dispatch(registerUserFailure(data || { non_field_errors: ['Kunne ikke registrere bruker, prøv igjen'] })); - } + }, ); }; } @@ -146,7 +146,7 @@ export function requestMembershipCharge(authToken, stripeToken, membershipType) }, (data) => { dispatch(membershipChargeFailure(data.detail || 'Kunne ikke belaste bankkortet, prøv igjen')); - } + }, ); }; } diff --git a/src/modules/about/About.js b/src/modules/about/About.js index 6592953..17542d4 100644 --- a/src/modules/about/About.js +++ b/src/modules/about/About.js @@ -1,8 +1,8 @@ import React from 'react'; import { Text, View, Platform, StyleSheet, Image, Linking, TouchableOpacity, ScrollView } from 'react-native'; -import {SimpleLineIcons as SimpleIcon, FontAwesome5 as FAIcon} from '@expo/vector-icons'; -import {Button} from 'react-native-ui-lib'; +import { SimpleLineIcons as SimpleIcon, FontAwesome5 as FAIcon } from '@expo/vector-icons'; +import { Button } from 'react-native-ui-lib'; import theme from '../../theme'; const CHATEAU_NEUF_ADDRESS = 'Det Norske Studentersamfund, Slemdalsveien 15, 0369 Oslo'; @@ -90,9 +90,7 @@ const About = () => ( Åpningstider - @@ -100,10 +98,8 @@ const About = () => ( Ta kontakt - @@ -111,7 +107,8 @@ const About = () => ( @@ -171,7 +168,7 @@ const styles = StyleSheet.create({ }, icon: { fontSize: 16, - marginRight: 4 + marginRight: 4, }, largeIcon: { fontSize: 40, diff --git a/src/modules/events/EventDetail.js b/src/modules/events/EventDetail.js index e49e54f..919952e 100644 --- a/src/modules/events/EventDetail.js +++ b/src/modules/events/EventDetail.js @@ -1,5 +1,15 @@ import React from 'react'; -import { Linking, StyleSheet, ScrollView, Text, Platform, View, Image, TouchableOpacity, useWindowDimensions } from 'react-native'; +import { + Linking, + StyleSheet, + ScrollView, + Text, + Platform, + View, + Image, + TouchableOpacity, + useWindowDimensions, +} from 'react-native'; import RenderHtml from 'react-native-render-html'; import moment from 'moment'; import { Icon } from 'native-base'; @@ -150,51 +160,52 @@ const EventDetail = ({ }) => { const { width } = useWindowDimensions(); return ( - - {event.thumbnail.medium_large && } - - {/* Date and title */} - - - - {format(event.start_time, FORMAT_DAY)} - {format(event.start_time, FORMAT_MONTH)} - + + {event.thumbnail.medium_large && } + + {/* Date and title */} + + + + {format(event.start_time, FORMAT_DAY)} + {format(event.start_time, FORMAT_MONTH)} + + + + + + {event.title.decoded} + - - - {event.title.decoded} - - + {/* Time and calendar */} + + + + + + {formatTimeFull(event)} + {formatRelative(event.start_time)} + + + {/* Location and maps */} + onLocationPress(event.venue)}> + + + + + {event.venue} + + + + + + + + - {/* Time and calendar */} - - - - - - {formatTimeFull(event)} - {formatRelative(event.start_time)} - - - {/* Location and maps */} - onLocationPress(event.venue)}> - - - - - {event.venue} - - - - - - - - - - ) + + ); }; export default EventDetail; diff --git a/src/modules/events/EventList.js b/src/modules/events/EventList.js index aea9282..7fb7e12 100644 --- a/src/modules/events/EventList.js +++ b/src/modules/events/EventList.js @@ -1,5 +1,7 @@ import { StyleSheet, View, Platform, SectionList, TouchableOpacity } from 'react-native'; -import { Card, Text, Button, Spinner, ArrowForwardIcon, HStack } from 'native-base'; +import { Card, Text, Spinner, ArrowForwardIcon, HStack } from 'native-base'; +import { Button } from 'react-native-ui-lib'; + import React from 'react'; import moment from 'moment'; import 'moment/locale/nb'; diff --git a/src/modules/login/Login.js b/src/modules/login/Login.js index 32b9c8f..39d0b78 100644 --- a/src/modules/login/Login.js +++ b/src/modules/login/Login.js @@ -1,6 +1,7 @@ import React from 'react'; import { Linking, StyleSheet, View } from 'react-native'; -import { ScrollView, Spinner, Button, Text } from 'native-base'; +import { ScrollView, Spinner, Text } from 'native-base'; +import { Button } from 'react-native-ui-lib'; import theme from '../../theme'; import useLogin from './useLogin'; @@ -36,7 +37,7 @@ const Login = () => { onSubmitEditing={onSubmit} returnKeyType="send" /> - @@ -23,7 +24,7 @@ const MembershipInfo = ({ onRegister, onLogin }) => ( Allerede medlem? - diff --git a/src/modules/membership/Proof.js b/src/modules/membership/Proof.js index ef23184..58f5b06 100644 --- a/src/modules/membership/Proof.js +++ b/src/modules/membership/Proof.js @@ -1,6 +1,7 @@ import React, { useEffect, useRef } from 'react'; import { Image, ScrollView, StyleSheet, Text, TouchableOpacity, View, RefreshControl } from 'react-native'; -import { Button, Text as NBText, Spinner } from 'native-base'; +import { Text as NBText, Spinner } from 'native-base'; +import { Button } from 'react-native-ui-lib'; import Confetti from 'react-native-confetti'; import theme from '../../theme'; @@ -58,7 +59,7 @@ const PurchaseButton = ({ user, isChargingMembership, isLoadingMembershipType, o {isChargingMembership && } {isRegisteringUser && } diff --git a/src/theme.js b/src/theme.js index d385601..32ab099 100644 --- a/src/theme.js +++ b/src/theme.js @@ -1,6 +1,8 @@ import { Platform } from 'react-native'; +import { Colors } from 'react-native-ui-lib'; const colors = { + primary: '#f58220', danger: '#d9534f', }; @@ -20,4 +22,9 @@ const card = { margin: 8, backgroundColor: '#fff', }; + +export function loadTheme() { + Colors.loadDesignTokens({ primaryColor: colors.primary }); +} + export default { card, colors };