Skip to content

Commit

Permalink
[navigation] revamp bottom tab bar and header (#81)
Browse files Browse the repository at this point in the history
* what

* bruh

* [wip], did styling for bottom tab nav, working on headers

* did some work, really weird bug?

* some fixes

* weird fix, dont like it

* simplified bottomTabNav hiding

* pr reviewed

* [axe] remove the disappearing bottom tab bar functionality.

* [feat] create separate file for back button components.

* [refactor] move tab bar item to separate component file.

* [feat] create empty header placeholder; fix existing header options.

* [feat] apply headers to all screens in the Cases flow.

* [fix] fix header style to apply it to the profile screens.

* [fix] minor nits.

* [feat] apply headers to all profile tabs.

* [feat] apply headers to every screen in the auth flow.

* [fix] remove redundant back buttons from profile screens.

* [fix] bring deep link handler back.

---------

Co-authored-by: Ronnie Beggs <[email protected]>
  • Loading branch information
philipye314 and ronniebeggs authored Apr 24, 2024
1 parent 7b7cd5f commit cd67ba8
Show file tree
Hide file tree
Showing 36 changed files with 392 additions and 159 deletions.
3 changes: 3 additions & 0 deletions assets/bottom-tab-home-inactive.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions assets/bottom-tab-home.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/bottom-tab-settings-gear-inactive.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions assets/bottom-tab-settings-gear.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/bottom-tab-updates-bell-inactive.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions assets/bottom-tab-updates-bell.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/grey-circle-back-arrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/red-left-caret.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/red-share-button.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions src/Components/BackButtons/BackButtons.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { router } from 'expo-router';
import { Text, TouchableOpacity } from 'react-native';

import styles from './styles';
import CircleBackButton from '../../../assets/grey-circle-back-arrow.svg';
import BackArrow from '../../../assets/red-left-caret.svg';

interface backButtonProps {
backText: string;
}

export function BackButtonText({ backText }: backButtonProps) {
return (
<TouchableOpacity
onPress={() => router.back()}
style={styles.backButtonContainer}
>
<BackArrow />
<Text style={styles.headerText}>{backText}</Text>
</TouchableOpacity>
);
}

export function BackButtonNoText() {
return (
<TouchableOpacity onPress={() => router.back()}>
<CircleBackButton />
</TouchableOpacity>
);
}
22 changes: 22 additions & 0 deletions src/Components/BackButtons/styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { StyleSheet } from 'react-native';

import { colors } from '../../styles/colors';

export default StyleSheet.create({
backButtonContainer: {
display: 'flex',
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'center',
columnGap: 10,
},
headerText: {
color: colors.midRed,
textAlign: 'center',
fontSize: 12,
fontStyle: 'normal',
fontWeight: '400',
lineHeight: 24,
letterSpacing: -0.264,
},
});
11 changes: 0 additions & 11 deletions src/Components/CasesHeader/CasesHeader.tsx

This file was deleted.

32 changes: 32 additions & 0 deletions src/Components/HeaderComponents/HeaderComponents.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { View, Image } from 'react-native';

import styles from './styles';

export function HeaderImage() {
return (
<Image
source={require('../../../assets/inline-logo.jpeg')}
style={{ width: 120, height: 15 }}
/>
);
}

export function LeftAlignedHeader() {
return (
<View style={styles.fullHeaderContainer}>
<HeaderImage />
</View>
);
}

export function LeftAlignedHeaderLine() {
return (
<View style={[styles.fullHeaderContainer, styles.bottomLine]}>
<HeaderImage />
</View>
);
}

export function EmptyHeader() {
return <View />;
}
34 changes: 34 additions & 0 deletions src/Components/HeaderComponents/styles.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { StyleSheet } from 'react-native';

import { colors } from '../../styles/colors';

export default StyleSheet.create({
fullHeaderContainer: {
width: '92%',
display: 'flex',
flexDirection: 'row',
justifyContent: 'flex-start',
paddingTop: 14,
paddingBottom: 14,
},
bottomLine: {
borderBottomWidth: 1,
borderBottomColor: colors.midGrey,
},
headerText: {
color: colors.midRed,
textAlign: 'center',
fontSize: 12,
fontStyle: 'normal',
fontWeight: '400',
lineHeight: 24,
letterSpacing: -0.264,
},
backButtonContainer: {
display: 'flex',
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'center',
columnGap: 10,
},
});
46 changes: 46 additions & 0 deletions src/Components/TabBarItem/TabBarItem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { View, Text } from 'react-native';

import { colors } from '../../styles/colors';

interface TabBarItemProps {
icon: React.ReactNode;
label: string;
focused: boolean;
}

//Inline styling required --> can't make a styles.ts in this directory otherwise it'll make a new bottom tab idk why
export default function TabBarItem({ icon, label, focused }: TabBarItemProps) {
return (
<View
style={{
backgroundColor: focused ? colors.lightRed : 'transparent',
borderRadius: 10,
height: 55,
width: 66,
marginTop: 10,
}}
>
<View
style={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
marginTop: 8,
}}
>
{icon}
<Text
style={{
fontSize: 9,
fontStyle: 'normal',
fontWeight: '600',
lineHeight: 21,
color: focused ? colors.midRed : colors.midGrey,
}}
>
{label}
</Text>
</View>
</View>
);
}
3 changes: 0 additions & 3 deletions src/app/(Authentication)/Login/Email/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ export default function LoginScreen() {

return (
<View style={styles.container}>
<TouchableOpacity style={styles.backButton} onPress={() => router.back()}>
<Text style={styles.backText}>Back</Text>
</TouchableOpacity>
<Text style={styles.instructionText}>
Please enter your email address.
</Text>
Expand Down
3 changes: 0 additions & 3 deletions src/app/(Authentication)/Login/Password/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ export default function LoginScreen() {

return (
<View style={styles.container}>
<TouchableOpacity style={styles.backButton} onPress={() => router.back()}>
<Text style={styles.backText}>Back</Text>
</TouchableOpacity>
<Text style={styles.instructionText}>Please enter your password.</Text>

<View style={styles.inputBox}>
Expand Down
6 changes: 0 additions & 6 deletions src/app/(Authentication)/OTPFlow/OTPEmailInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ export default function OTPEmailInput() {
return (
<View style={styles.container}>
<View style={styles.innerContainer}>
<TouchableOpacity
style={styles.backButton}
onPress={() => router.back()}
>
<Text style={styles.backText}>Back</Text>
</TouchableOpacity>
<View>
<Text style={styles.instructionText}>
Please enter the email you used to create your account.
Expand Down
8 changes: 0 additions & 8 deletions src/app/(Authentication)/OTPFlow/OTPNewPassword/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,6 @@ export default function SignUpScreen() {

return (
<View style={styles.container}>
<View style={styles.header}>
<TouchableOpacity
style={styles.backButton}
onPress={() => router.back()}
>
<Text style={styles.backText}>Back</Text>
</TouchableOpacity>
</View>
<Text style={styles.instructionText}>Create a new password.</Text>

<View style={styles.inputBox}>
Expand Down
5 changes: 0 additions & 5 deletions src/app/(Authentication)/OTPFlow/OTPVerify/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ export default function OTPFlow() {

return (
<View style={styles.container}>
<View style={styles.header}>
<TouchableOpacity onPress={() => router.back()}>
<Text style={styles.backText}>Back</Text>
</TouchableOpacity>
</View>
<View style={styles.contentContainer}>
<View style={styles.instructionContainer}>
<Text style={styles.headerText}>Enter verification code.</Text>
Expand Down
1 change: 0 additions & 1 deletion src/app/(Authentication)/SignUp/Address/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export default function SignUpScreen() {

return (
<View style={styles.container}>
<View style={styles.header} />
<Text style={styles.instructionText}>Last, enter your address.</Text>

<View style={styles.inputBox}>
Expand Down
8 changes: 0 additions & 8 deletions src/app/(Authentication)/SignUp/Email/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,6 @@ export default function SignUpScreen() {

return (
<View style={styles.container}>
<View style={styles.header}>
<TouchableOpacity
style={styles.backButton}
onPress={() => router.back()}
>
<Text style={styles.backText}>Back</Text>
</TouchableOpacity>
</View>
<Text style={styles.instructionText}>Create your account.</Text>
<View style={styles.inputBox}>
<AuthInput
Expand Down
8 changes: 0 additions & 8 deletions src/app/(Authentication)/SignUp/Password/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,6 @@ export default function SignUpScreen() {

return (
<View style={styles.container}>
<View style={styles.header}>
<TouchableOpacity
style={styles.backButton}
onPress={() => router.back()}
>
<Text style={styles.backText}>Back</Text>
</TouchableOpacity>
</View>
<Text style={styles.instructionText}>Next, make a password.</Text>

<View style={styles.inputBox}>
Expand Down
5 changes: 0 additions & 5 deletions src/app/(Authentication)/Welcome/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ function WelcomeScreen() {
return (
<View style={styles.container}>
<View style={styles.contentContainer}>
<Image
style={styles.image}
source={require('../../../../assets/inline-logo.jpeg')}
/>

<View style={styles.textContainer}>
<Text style={styles.welcomeText}>Welcome to the Impact Fund!</Text>
</View>
Expand Down
Loading

0 comments on commit cd67ba8

Please sign in to comment.