Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2c05ffd
feat: initial Config
eutelmo Mar 28, 2025
4ff1bcb
feat: Summary Component and Recent Trasaction Component
eutelmo Mar 28, 2025
7e3b235
feat: Image Caroussel Comp
eutelmo Mar 28, 2025
3021f8b
Merge pull request #1 from eutelmo/develop
eutelmo Mar 28, 2025
f278f38
feat: products Context, Get Products from Api
eutelmo Mar 28, 2025
caa43b9
Merge pull request #2 from eutelmo/develop
eutelmo Mar 28, 2025
5df30f1
feat: get Balnce from API
eutelmo Mar 29, 2025
d2d78bc
feat: Get Transactions from API
eutelmo Mar 29, 2025
69c9d33
Merge pull request #3 from eutelmo/develop
eutelmo Mar 29, 2025
9952869
quickFix: Transactions List limit on dashboard
eutelmo Mar 29, 2025
e56d6ea
feat: pull to refresh
eutelmo Mar 29, 2025
412aae9
Merge pull request #4 from eutelmo/develop
eutelmo Mar 29, 2025
b770edd
quickfix: coment logs
eutelmo Mar 29, 2025
b64320a
feat: Create a Transacions Item component, Modal to show Transaction …
eutelmo Mar 29, 2025
f2d61c2
Merge pull request #5 from eutelmo/develop
eutelmo Mar 29, 2025
889cf2a
quickFix: Safe hook for modal
eutelmo Mar 29, 2025
3f46af2
feat: snackBar and catch Products and transction fetch with error con…
eutelmo Mar 29, 2025
4fc8ec1
Merge pull request #6 from eutelmo/develop
eutelmo Mar 29, 2025
2aea8c6
feat: check offline and use LocalStorage to show some data
eutelmo Mar 29, 2025
9348c36
Merge pull request #7 from eutelmo/develop
eutelmo Mar 29, 2025
e0def92
quickFix: solving UI/UX issues
eutelmo Mar 29, 2025
a1e8105
Merge pull request #8 from eutelmo/develop
eutelmo Mar 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions react-native/codeChallenge/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files

# dependencies
node_modules/

# Expo
.expo/
dist/
web-build/
expo-env.d.ts

# Native
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision

# Metro
.metro-health-check*

# debug
npm-debug.*
yarn-debug.*
yarn-error.*

# macOS
.DS_Store
*.pem

# local env files
.env*.local

# typescript
*.tsbuildinfo

app-example
50 changes: 50 additions & 0 deletions react-native/codeChallenge/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Welcome to your Expo app 👋

This is an [Expo](https://expo.dev) project created with [`create-expo-app`](https://www.npmjs.com/package/create-expo-app).

## Get started

1. Install dependencies

```bash
npm install
```

2. Start the app

```bash
npx expo start
```

In the output, you'll find options to open the app in a

- [development build](https://docs.expo.dev/develop/development-builds/introduction/)
- [Android emulator](https://docs.expo.dev/workflow/android-studio-emulator/)
- [iOS simulator](https://docs.expo.dev/workflow/ios-simulator/)
- [Expo Go](https://expo.dev/go), a limited sandbox for trying out app development with Expo

You can start developing by editing the files inside the **app** directory. This project uses [file-based routing](https://docs.expo.dev/router/introduction).

## Get a fresh project

When you're ready, run:

```bash
npm run reset-project
```

This command will move the starter code to the **app-example** directory and create a blank **app** directory where you can start developing.

## Learn more

To learn more about developing your project with Expo, look at the following resources:

- [Expo documentation](https://docs.expo.dev/): Learn fundamentals, or go into advanced topics with our [guides](https://docs.expo.dev/guides).
- [Learn Expo tutorial](https://docs.expo.dev/tutorial/introduction/): Follow a step-by-step tutorial where you'll create a project that runs on Android, iOS, and the web.

## Join the community

Join our community of developers creating universal apps.

- [Expo on GitHub](https://github.com/expo/expo): View our open source platform and contribute.
- [Discord community](https://chat.expo.dev): Chat with Expo users and ask questions.
35 changes: 35 additions & 0 deletions react-native/codeChallenge/Styles/global.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { StyleSheet } from "react-native";

export const COLORS = {
black: "#000000",
white: "#ffffff",
link: "#364fc7",
green: "#5c940d",
orange: "#e47404",
red: "#FF0000",
gradientGreyDark: "#e0e0e0",
gradientGreyLight: "#f0f0f0",

error: "#FAA19B",
warning: "#E07F20",

backgroundLight: "#ffffff",
//backgroundDark: "#0F182D", //FOR LATER
}

export const globalStyles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: COLORS.backgroundLight,
},
TextRegular: {
fontFamily: "RegularFont",
},
TextSemiBold: {
fontFamily: "SemiBoldFont",
},
TextBold: {
fontFamily: "BoldFont",
},
});

41 changes: 41 additions & 0 deletions react-native/codeChallenge/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"expo": {
"name": "codeChallenge",
"slug": "codeChallenge",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"scheme": "myapp",
"userInterfaceStyle": "automatic",
"newArchEnabled": true,
"ios": {
"supportsTablet": true
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/images/adaptive-icon.png",
"backgroundColor": "#ffffff"
}
},
"web": {
"bundler": "metro",
"output": "static",
"favicon": "./assets/images/favicon.png"
},
"plugins": [
"expo-router",
[
"expo-splash-screen",
{
"image": "./assets/images/splash-icon.png",
"imageWidth": 200,
"resizeMode": "contain",
"backgroundColor": "#ffffff"
}
]
],
"experiments": {
"typedRoutes": true
}
}
}
24 changes: 24 additions & 0 deletions react-native/codeChallenge/app/+not-found.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Link, Stack } from 'expo-router';
import { StyleSheet } from 'react-native';


export default function NotFoundScreen() {
return (
<>

</>
);
}

const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
padding: 20,
},
link: {
marginTop: 15,
paddingVertical: 15,
},
});
26 changes: 26 additions & 0 deletions react-native/codeChallenge/app/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from 'react'
import { View } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';

//Utils
import { createStackNavigator } from '@react-navigation/stack';
import { globalStyles } from '@/Styles/global';

//Screens
import DashboardScreen from '@/screens/dashboardScreen/dashboardScreen';
import TransactionScreen from '@/screens/transactionScreen/transactionsScreen';

const Stack = createStackNavigator();

export default function RootApp() {
return (
<View style={globalStyles.container}>
<Stack.Navigator
initialRouteName="DashboardScreen"
>
<Stack.Screen name="DashboardScreen" component={DashboardScreen} options={{ headerShown: false }} />
<Stack.Screen name="TransactionScreen" component={TransactionScreen} options={{ title: 'Transactions' }} />
</Stack.Navigator>
</View>
)
}
48 changes: 48 additions & 0 deletions react-native/codeChallenge/app/_layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { useFonts } from 'expo-font';
import * as SplashScreen from 'expo-splash-screen';
import { useEffect } from 'react';
import 'react-native-reanimated';

import RootApp from './App';

//Provider
import { ProductsProvider } from '@/context/productsDataContext';
import { TransactionProvider } from '@/context/transactionsDataContext';
import { ModalProvider } from '@/context/modalContext';

//Compoents
import SnackBarProvider from '@/context/snackBarContext';


// Prevent the splash screen from auto-hiding before asset loading is complete.
SplashScreen.preventAutoHideAsync();

export default function RootLayout() {
const [loaded] = useFonts({
SpaceMono: require('../assets/fonts/SpaceMono-Regular.ttf'),
});

useEffect(() => {
if (loaded) {
SplashScreen.hideAsync();
}
}, [loaded]);

if (!loaded) {
return null;
}



return (
<SnackBarProvider>
<ModalProvider>
<ProductsProvider>
<TransactionProvider>
<RootApp />
</TransactionProvider>
</ProductsProvider>
</ModalProvider>
</SnackBarProvider>
);
}
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added react-native/codeChallenge/assets/images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React, { useEffect, useState } from 'react'
import { useProducts } from '@/utils/hooks/useProducts';
import { FlatList, View, Image, Text } from 'react-native';

//Types
import { ProductImage } from '@/utils/types/ProductImageProps';

//Styles
import { styles } from './style';
import sizes from '@/utils/sizes';


export default function CarousselComp() {
const { productsData, isLoading, refetch } = useProducts();

const [offset, setOffset] = useState(0);

useEffect(() => {
refetch();
}, [refetch]);

const onScroll = (event: any) => {
const contentOffsetX = event.nativeEvent.contentOffset.x;
setOffset(contentOffsetX);
};

if (isLoading) return <Text> Loading... </Text>
return (
<View style={styles.container}>
<FlatList
data={productsData}
horizontal
keyExtractor={(item, index) => `${item.id}+${index}`}
renderItem={({ item, index }) => (
<View style={{ marginLeft: index === 0 && offset === 0 ? sizes.scaleWidthSize(20) : 0 }}>
<Image source={{ uri: item.image }} style={styles.image} />
</View>
)}
showsHorizontalScrollIndicator={false}
/>
</View>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { COLORS } from "@/Styles/global";
import sizes from "@/utils/sizes";
import { StyleSheet } from "react-native";

export const styles = StyleSheet.create({
container: {
marginVertical: 10,
},
image: {
width: 300,
height: 200,
marginRight: sizes.scaleWidthSize(10),
borderRadius: sizes.scaleWidthSize(10),
},
});
Loading