Skip to content

Commit

Permalink
Fix crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Navar committed Jun 28, 2023
1 parent a39b3fb commit 2565f4f
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 8 deletions.
6 changes: 5 additions & 1 deletion drink-tracker-expo/screens/About.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Alert, Button, Linking } from 'react-native';
import { Alert, Button, Linking, StatusBar } from 'react-native';
import { InnerLayout, Row, StyledLayout } from '../styling/commonStyles';
import { Text } from 'react-native-ui-lib';
import { NavigationProps, Screens } from '../commonTypes';
Expand All @@ -26,6 +26,10 @@ const About = (props: NavigationProps) => {

return (
<StyledLayout>
<StatusBar
animated={true}
backgroundColor="#61dafb"
/>
<Row>
<BackButton onPress={onPressBack} />
</Row>
Expand Down
6 changes: 5 additions & 1 deletion drink-tracker-expo/screens/DebugScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Button } from 'react-native';
import { Button, StatusBar } from 'react-native';
import { StyledLayout } from '../styling/commonStyles';
import { NavigationProps, Screens } from '../commonTypes';
import { getAllSessions, storeSessionsLocally } from '../api';
Expand All @@ -22,6 +22,10 @@ const Debug = (props: NavigationProps) => {

return (
<StyledLayout>
<StatusBar
animated={true}
backgroundColor="#61dafb"
/>
<Button title="store dummy sessions" onPress={storeDummySessions} />
<Button
title="console log all stored sessions"
Expand Down
8 changes: 6 additions & 2 deletions drink-tracker-expo/screens/DrinkingLimits.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Button, Keyboard } from 'react-native';
import { Button, Keyboard, StatusBar } from 'react-native';
import { Incubator, NumberInput, Text } from 'react-native-ui-lib';
import {
InnerLayout,
Expand All @@ -9,7 +9,7 @@ import {
toastStyles,
} from '../styling/commonStyles';
import { NavigationProps } from '../commonTypes';
import { storeDrinkingLimits } from '../api/guestAccountAPI';
import { getDrinkingLimits, storeDrinkingLimits } from '../api/guestAccountAPI';
import { BackButton } from '../components/BackButton';

type DrinkingLimitsProps = {
Expand Down Expand Up @@ -74,6 +74,10 @@ const DrinkingLimits = (props: DrinkingLimitsProps) => {

return (
<StyledLayout>
<StatusBar
animated={true}
backgroundColor="#61dafb"
/>
<Row>
<BackButton onPress={onPressBack} />
</Row>
Expand Down
6 changes: 5 additions & 1 deletion drink-tracker-expo/screens/Feedback.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Button } from 'react-native';
import { Button, StatusBar } from 'react-native';
import { StyledLayout, toastStyles } from '../styling/commonStyles';
import { Incubator, Text, TextField } from 'react-native-ui-lib';

Expand Down Expand Up @@ -27,6 +27,10 @@ const Feedback = () => {

return (
<StyledLayout>
<StatusBar
animated={true}
backgroundColor="#61dafb"
/>
<TextField
value={feedback}
onChangeText={setFeedback}
Expand Down
6 changes: 5 additions & 1 deletion drink-tracker-expo/screens/HomeScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Button } from 'react-native';
import { Button, StatusBar } from 'react-native';
import { DrinkingSession, NavigationProps, Screens } from '../commonTypes';
import { NewSessionModal } from '../components/NewSessionModal';
import { SessionCard } from '../components/SessionCard';
Expand Down Expand Up @@ -71,6 +71,10 @@ export const HomeScreen = (props: NavigationProps) => {

return (
<StyledLayout>
<StatusBar
animated={true}
backgroundColor="#61dafb"
/>
<Row>
<View />
<Button
Expand Down
2 changes: 1 addition & 1 deletion drink-tracker-expo/screens/SessionScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export const SessionScreen = (props: SessionScreenProps) => {
/>
) : (
<Text>You haven't drank anything yet.</Text>
)} */}
)}

<FinishModal
open={finishModalOpen}
Expand Down
5 changes: 5 additions & 0 deletions drink-tracker-expo/screens/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
import { ListItem, Text, View, Button, Assets } from 'react-native-ui-lib';
import { FlatList } from 'react-native-gesture-handler';
import { BackButton } from '../components/BackButton';
import { StatusBar } from 'react-native';

const Settings = (props: NavigationProps) => {
const redirect = (page: string) => {
Expand Down Expand Up @@ -36,6 +37,10 @@ const Settings = (props: NavigationProps) => {

return (
<StyledLayout>
<StatusBar
animated={true}
backgroundColor="#61dafb"
/>
<Row>
<BackButton onPress={() => props.navigation.goBack()} />
</Row>
Expand Down
5 changes: 5 additions & 0 deletions drink-tracker-expo/screens/Summary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { BackButton } from '../components/BackButton';
import { FlatList } from 'react-native-gesture-handler';
import { getSession } from '../api';
import { deleteDrink } from '../api/guestAccountAPI';
import { StatusBar } from 'react-native';

type SummaryProps = {
route: {
Expand Down Expand Up @@ -96,6 +97,10 @@ const Summary = (props: SummaryProps) => {

return (
<StyledLayout>
<StatusBar
animated={true}
backgroundColor="#61dafb"
/>
<Row>
<BackButton onPress={onPressBack} />
</Row>
Expand Down
2 changes: 1 addition & 1 deletion drink-tracker-expo/styling/commonStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const InnerLayout = styled(View)`
export const Row = styled.View`
display: flex;
flex-direction: row;
flex-wrap: none;
flex-wrap: nowrap;
justify-content: space-between;
width: 100%;
`;
Expand Down

0 comments on commit 2565f4f

Please sign in to comment.