Skip to content

Commit

Permalink
Minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Saperstein committed Dec 5, 2024
1 parent 6ab1297 commit 1225b27
Show file tree
Hide file tree
Showing 9 changed files with 10,010 additions and 250 deletions.
4 changes: 2 additions & 2 deletions frontend/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useFonts } from 'expo-font';
import * as SplashScreen from 'expo-splash-screen';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { AuthProvider, useAuth } from './src/context/AuthContext';
import RootNavigator from './src/navigation/RootNavigator';
import RootNavigator from './src/navigation/RootNavigator';

SplashScreen.preventAutoHideAsync();

Expand Down Expand Up @@ -39,7 +39,7 @@ export default function App() {
<AuthProvider>
<QueryClientProvider client={queryClient}>
<NavigationContainer>
<RootNavigator />
<RootNavigator />
</NavigationContainer>
</QueryClientProvider>
</AuthProvider>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Divider.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { View, Image, ImageSourcePropType } from 'react-native';
import { styled } from 'nativewind';
import { CaptionText } from './Typography';
import { CaptionText } from './typography';

const StyledView = styled(View);
const StyledImage = styled(Image);
Expand Down
18 changes: 9 additions & 9 deletions frontend/src/navigation/RootNavigator.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React from 'react';
import { useAuth } from "../context/AuthContext";
import TabNavigator from "./BottomTabs";
import LoginNavigator from "./LoginNavigator";
import { useAuth } from '../context/AuthContext';
import TabNavigator from './BottomTabs';
import LoginNavigator from './LoginNavigator';

// Navigates user to the log in screen if seesion is not found (i.e. user not logged in)
export default function RootNavigator() {
const { session, isLoading } = useAuth();
const { session, isLoading } = useAuth();

if (isLoading) {
return null; // or some loading screen (maybe we make in future?)
}
if (isLoading) {
return null; // or some loading screen (maybe we make in future?)
}

return session ? <TabNavigator /> : <LoginNavigator />;
}
return session ? <TabNavigator /> : <LoginNavigator />;
}
199 changes: 119 additions & 80 deletions frontend/src/screens/login/signup_flow/ConnectAccountsScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
import React, { useEffect, useState } from 'react';
import { View, Text, KeyboardAvoidingView, Platform, ScrollView, TouchableOpacity, Image } from 'react-native';
import {
View,
Text,
KeyboardAvoidingView,
Platform,
ScrollView,
TouchableOpacity,
Image,
} from 'react-native';
import { styled } from 'nativewind';
import ProgressBar from '../../../components/ProgressBar';;
import ProgressBar from '../../../components/ProgressBar';
import PlaidLink from '../../../expo-plaid-link/Index';
import { useLink } from '../../../services/plaid';
import TextField from '../../../components/TextField';
import TextInputComponent from '../components/TextInputComponent';
import { BodyBoldText, BodyText, CaptionText } from '../../../components/Typography';
import { BodyBoldText, BodyText, CaptionText } from '../../../components/typography';
import Button from '../../../components/Button';
import NavProgressBar from '../components/NavProgressBar';
import OnboardingScreenWrapper from '../components/OnboardingScreenWrapper';
Expand All @@ -19,111 +27,142 @@ const StyledTouchableOpacity = styled(TouchableOpacity);
const StyledImage = styled(Image);

export default function ConnectAccountsScreen({ navigation }) {
const [search, setSearch] = useState("");
const [search, setSearch] = useState('');

const banks = [
{
name: "Chase",
url: "www.chase.com",
image: "https://pbs.twimg.com/profile_images/748885874516094980/ywt_aKRx_400x400.jpg"
name: 'Chase',
url: 'www.chase.com',
image: 'https://pbs.twimg.com/profile_images/748885874516094980/ywt_aKRx_400x400.jpg',
},
{
name: "Bank of America",
url: "www.bankofamerica.com",
image: "https://i.pinimg.com/736x/2f/9b/19/2f9b195ba9069a509b41552b763f8c8c.jpg"
name: 'Bank of America',
url: 'www.bankofamerica.com',
image: 'https://i.pinimg.com/736x/2f/9b/19/2f9b195ba9069a509b41552b763f8c8c.jpg',
},
{
name: "Wells Fargo",
url: "www.wellsfargo.com",
image: "https://upload.wikimedia.org/wikipedia/commons/thumb/b/b3/Wells_Fargo_Bank.svg/480px-Wells_Fargo_Bank.svg.png"
name: 'Wells Fargo',
url: 'www.wellsfargo.com',
image:
'https://upload.wikimedia.org/wikipedia/commons/thumb/b/b3/Wells_Fargo_Bank.svg/480px-Wells_Fargo_Bank.svg.png',
},
{
name: "Citibank",
url: "www.citi.com",
image: "https://cdn-icons-png.flaticon.com/512/217/217437.png"
name: 'Citibank',
url: 'www.citi.com',
image: 'https://cdn-icons-png.flaticon.com/512/217/217437.png',
},
{
name: "Capital One",
url: "www.capitalone.com",
image: "https://www.miamiherald.com/banks/wp-content/uploads/2024/01/Capital-One-Logo-256X256.png"
name: 'Capital One',
url: 'www.capitalone.com',
image:
'https://www.miamiherald.com/banks/wp-content/uploads/2024/01/Capital-One-Logo-256X256.png',
},
{
name: "US Bank",
url: "www.usbank.com",
image: "https://play-lh.googleusercontent.com/R0odPLUnFbG0n0MLUTrE_Xbn8b-O7D40RtFG5KlTta4ARrhAtvBgHpblHNGXS8tfhtH5"
name: 'US Bank',
url: 'www.usbank.com',
image:
'https://play-lh.googleusercontent.com/R0odPLUnFbG0n0MLUTrE_Xbn8b-O7D40RtFG5KlTta4ARrhAtvBgHpblHNGXS8tfhtH5',
},
{
name: "PNC Bank",
url: "www.pnc.com",
image: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTTmbI9-Wufh2BjIblPRLGyqMgu8i5JFp_gmQ&s"
name: 'PNC Bank',
url: 'www.pnc.com',
image:
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTTmbI9-Wufh2BjIblPRLGyqMgu8i5JFp_gmQ&s',
},
{
name: "TD Bank",
url: "www.td.com",
image: "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Toronto-Dominion_Bank_logo.svg/536px-Toronto-Dominion_Bank_logo.svg.png"
name: 'TD Bank',
url: 'www.td.com',
image:
'https://upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Toronto-Dominion_Bank_logo.svg/536px-Toronto-Dominion_Bank_logo.svg.png',
},
{
name: "Truist Bank",
url: "www.truist.com",
image: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTeGhMKO8KWYic9nU8eiN1qGCZDUaWzL8oCbw&s"
name: 'Truist Bank',
url: 'www.truist.com',
image:
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTeGhMKO8KWYic9nU8eiN1qGCZDUaWzL8oCbw&s',
},
{
name: "Ally Bank",
url: "www.ally.com",
image: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR8djhJrBss78LRfjf58vjmVojjwF_VKc141g&s"
}
]
name: 'Ally Bank',
url: 'www.ally.com',
image:
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR8djhJrBss78LRfjf58vjmVojjwF_VKc141g&s',
},
];

return (
<OnboardingScreenWrapper>
<NavProgressBar currentStep={4} totalSteps={6} buttonType={'back'} onPress={() => navigation.goBack()} />
<NavProgressBar
currentStep={4}
totalSteps={6}
buttonType={'back'}
onPress={() => navigation.goBack()}
/>

{/* Connect Accounts Section */}
<StyledView className='w-full flex flex-col items-center mt-12'>
<StyledText className='text-2xl font-bold font-title text-defaultText mb-4'>
Connect your accounts
</StyledText>
<TextInputComponent
placeholder='Search Institutions'
value={search}
onChangeText={(text) => {
setSearch(text);
}}
/>
</StyledView>

{/* Connect Accounts Section */}
<StyledView className="w-full flex flex-col items-center mt-12">
<StyledText className="text-2xl font-bold font-title text-defaultText mb-4">Connect your accounts</StyledText>
<TextInputComponent placeholder="Search Institutions" value={search} onChangeText={(text) => { setSearch(text)}} />
</StyledView>
<StyledView className='w-full flex flex-row items-start'>
<BodyBoldText className='mt-8'>Most popular accounts</BodyBoldText>
</StyledView>

<StyledView className="w-full flex flex-row items-start">
<BodyBoldText className='mt-8'>Most popular accounts</BodyBoldText>
</StyledView>

<StyledScrollView
className="w-full mt-2"
showsVerticalScrollIndicator={false}
contentContainerStyle={{

}}
>
{banks.filter((val, ind, arr) => {
if (search.length <= 2) {
return true;
} else {
return val.name.toUpperCase().includes(search.toUpperCase()) || val.url.toUpperCase().includes(search.toUpperCase())
}
}).map((bank, index) => (
<StyledTouchableOpacity
key={index}
className="flex-row items-center py-4"
onPress={() => {
navigation.navigate("LegalInformationScreen")
}}
>
<StyledImage
source={{ uri: bank.image }}
className='w-12 h-12 rounded-full'
/>
<StyledView className="ml-4 flex flex-col">
<BodyBoldText>{bank.name}</BodyBoldText>
<BodyText>{bank.url}</BodyText>
</StyledView>
<StyledImage source={require('../../../../assets/images/chevron-right.png')} className="w-6 h-6 ml-auto" style={{ tintColor: "#2b2b2b"}} />
</StyledTouchableOpacity>
))}
</StyledScrollView>
<StyledScrollView
className='w-full mt-2'
showsVerticalScrollIndicator={false}
contentContainerStyle={{}}
>
{banks
.filter((val, ind, arr) => {
if (search.length <= 2) {
return true;
} else {
return (
val.name.toUpperCase().includes(search.toUpperCase()) ||
val.url.toUpperCase().includes(search.toUpperCase())
);
}
})
.map((bank, index) => (
<StyledTouchableOpacity
key={index}
className='flex-row items-center py-4'
onPress={() => {
navigation.navigate('LegalInformationScreen');
}}
>
<StyledImage source={{ uri: bank.image }} className='w-12 h-12 rounded-full' />
<StyledView className='ml-4 flex flex-col'>
<BodyBoldText>{bank.name}</BodyBoldText>
<BodyText>{bank.url}</BodyText>
</StyledView>
<StyledImage
source={require('../../../../assets/images/chevron-right.png')}
className='w-6 h-6 ml-auto'
style={{ tintColor: '#2b2b2b' }}
/>
</StyledTouchableOpacity>
))}
</StyledScrollView>

<Button type="secondary" className="w-full" onPress={() => { navigation.navigate("LegalInformationScreen") }}>Save for later</Button>
<Button
type='secondary'
className='w-full'
onPress={() => {
navigation.navigate('LegalInformationScreen');
}}
>
Save for later
</Button>
</OnboardingScreenWrapper>
);
}
Loading

0 comments on commit 1225b27

Please sign in to comment.