Skip to content

Commit

Permalink
Merge pull request #5 from cyberkaidev/refactor/structure-application
Browse files Browse the repository at this point in the history
New structure application
  • Loading branch information
cyberkaidev authored Jan 15, 2024
2 parents d6739d2 + 96b0d36 commit 1244119
Show file tree
Hide file tree
Showing 192 changed files with 1,975 additions and 2,521 deletions.
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.fixAll.eslint": true
"source.fixAll": "explicit",
"source.fixAll.eslint": "explicit"
},
"files.eol": "\n",
"editor.defaultFormatter": "esbenp.prettier-vscode",
Expand Down
16 changes: 6 additions & 10 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ import * as SplashScreen from 'expo-splash-screen';
import { StatusBar } from 'expo-status-bar';
import * as React from 'react';
import { View } from 'react-native';
import { ThemeProvider } from 'styled-components';

import { initializeAppSettings } from '@/functions';

import { Routes } from './src/routes';
import { themes } from './src/themes';
import { initializeAppSettings } from '@/functions/initializeAppSettings';
import { colors } from '@/helpers/themes';
import { RootStack } from '@/routes/RootStack';

export default function App() {
const [fontsLoaded] = useFonts({
Expand Down Expand Up @@ -50,12 +48,10 @@ export default function App() {
}

return (
<View style={{ flex: 1, backgroundColor: themes.colors.black_100 }} onLayout={onLayoutRootView}>
<View style={{ flex: 1, backgroundColor: colors.black_100 }} onLayout={onLayoutRootView}>
<NavigationContainer theme={DarkTheme}>
<StatusBar backgroundColor={themes.colors.black_100} style="light" translucent={false} />
<ThemeProvider theme={themes}>
<Routes />
</ThemeProvider>
<StatusBar backgroundColor={colors.black_100} style="light" translucent={false} />
<RootStack />
</NavigationContainer>
</View>
);
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Create an .env file with the properties:
[Create an account to have your key](https://docs.tatum.com/)

```
EXPO_PUBLIC_TATUM_SDK_V1=YOUR-API-KEY
EXPO_PUBLIC_TATUM_SDK_V4=YOUR-API-KEY
```

1. Install dependencies
Expand Down
31 changes: 24 additions & 7 deletions __test__/setup.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import mockSafeAreaContext from 'react-native-safe-area-context/jest/mock';

import DE_CH from '../src/translate/locales/de-ch.json';
import EN_US from '../src/translate/locales/en-us.json';
import ES_AR from '../src/translate/locales/es-ar.json';
import PT_BR from '../src/translate/locales/pt-br.json';

jest.mock('react-native-safe-area-context', () => {
return {
useSafeAreaInsets: () => ({ bottom: 0 }),
};
});
jest.mock('react-native-safe-area-context', () => mockSafeAreaContext);

jest.mock('react-native-reanimated', () => require('react-native-reanimated/mock'));

jest.mock('@/hooks', () => {
jest.mock('@/hooks/useFormatCurrency', () => {
return {
useFormatCurrency: () => '$100.00',
};
});

jest.mock('@/hooks/useFormatDate', () => {
return {
useFormatDate: () => ({
date: '12/12/2023',
time: '12:00 PM',
Expand All @@ -25,7 +27,7 @@ jest.mock('@/hooks', () => {
};
});

jest.mock('@/stores', () => {
jest.mock('@/stores/useBitcoinHistoricalPrice', () => {
return {
useBitcoinHistoricalPrice: () => ({
fetchBitcoinHistoricalPrice: jest.fn(),
Expand All @@ -45,6 +47,11 @@ jest.mock('@/stores', () => {
},
],
}),
};
});

jest.mock('@/stores/useUserData', () => {
return {
useUserData: () => ({
cleanUserData: jest.fn(),
data: [
Expand All @@ -63,6 +70,11 @@ jest.mock('@/stores', () => {
],
status: 'success',
}),
};
});

jest.mock('@/stores/useAppSettings', () => {
return {
useAppSettings: Object.assign(
() => {
return { currency: 'usd' };
Expand All @@ -73,6 +85,11 @@ jest.mock('@/stores', () => {
},
},
),
};
});

jest.mock('@/stores/useBitcoinDataPrices', () => {
return {
useBitcoinDataPrices: () => ({
data: {
current_price: {
Expand Down
4 changes: 2 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Wallet you",
"slug": "wallet-you",
"owner": "cyberkaidev",
"version": "1.3.3",
"version": "1.4.3",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"userInterfaceStyle": "dark",
Expand Down Expand Up @@ -35,7 +35,7 @@
},
"permissions": ["android.permission.USE_BIOMETRIC", "android.permission.USE_FINGERPRINT"],
"package": "com.cyberkaidev.walletyou",
"versionCode": "7"
"versionCode": "8"
},
"web": {
"favicon": "./assets/images/favicon.ico"
Expand Down
32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wallet-you",
"version": "1.3.3",
"version": "1.4.3",
"main": "node_modules/expo/AppEntry.js",
"author": "cyberkaidev",
"license": "MIT",
Expand All @@ -24,12 +24,12 @@
},
"dependencies": {
"@react-native-async-storage/async-storage": "1.18.2",
"@react-navigation/bottom-tabs": "^6.5.7",
"@react-navigation/native": "^6.1.6",
"@react-navigation/native-stack": "^6.9.12",
"@react-navigation/stack": "^6.3.16",
"@tatumio/tatum": "^3.0.14",
"axios": "^1.4.0",
"@react-navigation/bottom-tabs": "^6.5.11",
"@react-navigation/native": "^6.1.9",
"@react-navigation/native-stack": "^6.9.17",
"@react-navigation/stack": "^6.3.20",
"@tatumio/tatum": "^4.2.2",
"axios": "^1.6.5",
"currency.js": "^2.0.4",
"expo": "^49.0.0",
"expo-checkbox": "~2.4.0",
Expand All @@ -42,27 +42,26 @@
"expo-local-authentication": "~13.4.1",
"expo-localization": "~14.3.0",
"expo-network": "~5.4.0",
"expo-screen-orientation": "~6.0.5",
"expo-screen-orientation": "~6.0.6",
"expo-secure-store": "~12.3.1",
"expo-splash-screen": "~0.20.5",
"expo-status-bar": "~1.6.0",
"i18next": "^22.5.0",
"i18next": "^23.7.16",
"jest-expo": "^49.0.0",
"moment": "^2.29.4",
"moti": "^0.25.3",
"moment": "^2.30.1",
"moti": "^0.27.2",
"react": "18.2.0",
"react-i18next": "^12.3.1",
"react-native": "0.72.4",
"react-i18next": "^14.0.0",
"react-native": "0.72.6",
"react-native-gesture-handler": "~2.12.0",
"react-native-localize": "^3.0.0",
"react-native-localize": "^3.0.5",
"react-native-reanimated": "~3.3.0",
"react-native-responsive-screen": "^1.4.2",
"react-native-safe-area-context": "4.6.3",
"react-native-screens": "~3.22.0",
"react-native-svg": "13.9.0",
"react-native-svg-charts": "^5.4.0",
"styled-components": "^6.0.2",
"zustand": "^4.4.1"
"zustand": "^4.4.7"
},
"devDependencies": {
"@babel/core": "^7.20.0",
Expand All @@ -82,6 +81,7 @@
"eslint-plugin-simple-import-sort": "^10.0.0",
"jest": "^29.2.1",
"metro-react-native-babel-preset": "^0.76.4",
"prettier": "3.2.2",
"react-test-renderer": "^18.2.0",
"typescript": "^5.1.3"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React from 'react';
import Svg, { Path } from 'react-native-svg';

import { themes } from '@/themes';
import { colors } from '@/helpers/themes';
import { IconProps } from '@/types/IconType';

import { IconProps } from './types';

export function IconArrowDown({ color = themes.colors.white, size = 25 }: IconProps) {
export function IconArrowDown({ color = colors.white, size = 25 }: IconProps) {
return (
<Svg width={size} height={size} viewBox="0 0 25 25" fill="none">
<Path
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React from 'react';
import Svg, { Path } from 'react-native-svg';

import { themes } from '@/themes';
import { colors } from '@/helpers/themes';
import { IconProps } from '@/types/IconType';

import { IconProps } from './types';

export function IconArrowRight({ color = themes.colors.white, size = 25 }: IconProps) {
export function IconArrowRight({ color = colors.white, size = 25 }: IconProps) {
return (
<Svg width={size} height={size} viewBox="0 0 25 25" fill="none">
<Path
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React from 'react';
import Svg, { Path } from 'react-native-svg';

import { themes } from '@/themes';
import { colors } from '@/helpers/themes';
import { IconProps } from '@/types/IconType';

import { IconProps } from './types';

export function IconArrowUp({ color = themes.colors.white, size = 25 }: IconProps) {
export function IconArrowUp({ color = colors.white, size = 25 }: IconProps) {
return (
<Svg width={size} height={size} viewBox="0 0 25 25" fill="none">
<Path
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import React from 'react';
import Svg, { Path } from 'react-native-svg';

import { themes } from '@/themes';

import { IconProps } from './types';
import { colors } from '@/helpers/themes';
import { IconProps } from '@/types/IconType';

export function IconBitcoin({ size = 25 }: Omit<IconProps, 'color'>) {
return (
<Svg width={size} height={size} viewBox="0 0 72 72" fill="none">
<Path
d="M70.9229 44.7086C66.1143 63.9945 46.5786 75.7315 27.2882 70.9222C8.0059 66.1142 -3.73245 46.5794 1.07827 27.2951C5.88476 8.00709 25.4205 -3.73082 44.7049 1.07724C63.9938 5.8853 75.7315 25.4221 70.9223 44.7089L70.9227 44.7086H70.9229Z"
fill={themes.colors.dark_grey}
fill={colors.dark_grey}
/>
<Path
d="M51.876 30.8712C52.5926 26.0804 48.9448 23.5051 43.9567 21.7872L45.5749 15.2976L41.624 14.3133L40.0488 20.632C39.0101 20.373 37.9435 20.1289 36.8834 19.887L38.47 13.5265L34.5217 12.5422L32.9026 19.0297C32.0431 18.834 31.1989 18.6406 30.3799 18.4368L30.3844 18.4164L24.9361 17.056L23.8851 21.2753C23.8851 21.2753 26.8163 21.9471 26.7546 21.9885C28.3545 22.3878 28.6438 23.4467 28.5957 24.2861L26.7525 31.6792C26.8626 31.7072 27.0055 31.7477 27.1632 31.811C27.0314 31.7783 26.8911 31.7426 26.7456 31.7077L24.162 42.0645C23.9665 42.5505 23.4702 43.2799 22.3516 43.0029C22.3912 43.0603 19.4801 42.2864 19.4801 42.2864L17.5186 46.8083L22.6599 48.0899C23.6164 48.3297 24.5537 48.5806 25.4768 48.8166L23.8419 55.3806L27.7881 56.365L29.4072 49.8706C30.4853 50.1633 31.5315 50.4332 32.5557 50.6876L30.9421 57.1514L34.8932 58.1357L36.5279 51.584C43.2649 52.8589 48.3306 52.3449 50.4629 46.2519C52.181 41.3464 50.3773 38.5169 46.833 36.6717C49.4145 36.0764 51.359 34.3787 51.8774 30.8717L51.8762 30.8708L51.876 30.8712ZM42.8492 43.5276C41.6283 48.4332 33.3679 45.7814 30.6898 45.1164L32.8593 36.4202C35.5373 37.0887 44.1253 38.4116 42.8494 43.5276H42.8492ZM44.0711 30.8001C42.9573 35.2622 36.0821 32.9953 33.8519 32.4394L35.8188 24.5525C38.0491 25.1084 45.2314 26.1458 44.0715 30.8001H44.0711Z"
fill={themes.colors.white}
fill={colors.white}
/>
</Svg>
);
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React from 'react';
import Svg, { Path } from 'react-native-svg';

import { themes } from '@/themes';
import { colors } from '@/helpers/themes';
import { IconProps } from '@/types/IconType';

import { IconProps } from './types';

export function IconChart({ color = themes.colors.white, size = 25 }: IconProps) {
export function IconChart({ color = colors.white, size = 25 }: IconProps) {
return (
<Svg width={size} height={size} viewBox="0 0 25 25" fill="none">
<Path
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React from 'react';
import Svg, { ClipPath, Defs, G, Path, Rect } from 'react-native-svg';

import { themes } from '@/themes';
import { colors } from '@/helpers/themes';
import { IconProps } from '@/types/IconType';

import { IconProps } from './types';

export function IconGithub({ color = themes.colors.white, size = 25 }: IconProps) {
export function IconGithub({ color = colors.white, size = 25 }: IconProps) {
return (
<Svg width={size} height={size} viewBox="0 0 20 20" fill="none">
<G clip-path="url(#clip0_638_696)">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React from 'react';
import Svg, { Path } from 'react-native-svg';

import { themes } from '@/themes';
import { colors } from '@/helpers/themes';
import { IconProps } from '@/types/IconType';

import { IconProps } from './types';

export function IconHome({ color = themes.colors.white, size = 25 }: IconProps) {
export function IconHome({ color = colors.white, size = 25 }: IconProps) {
return (
<Svg width={size} height={size} viewBox="0 0 25 25" fill="none">
<Path
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React from 'react';
import Svg, { Path } from 'react-native-svg';

import { themes } from '@/themes';
import { colors } from '@/helpers/themes';
import { IconProps } from '@/types/IconType';

import { IconProps } from './types';

export function IconNoInternet({ color = themes.colors.white, size = 25 }: IconProps) {
export function IconNoInternet({ color = colors.white, size = 25 }: IconProps) {
return (
<Svg width={size} height={size} viewBox="0 0 25 25" fill="none">
<Path
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React from 'react';
import Svg, { Path } from 'react-native-svg';

import { themes } from '@/themes';
import { colors } from '@/helpers/themes';
import { IconProps } from '@/types/IconType';

import { IconProps } from './types';

export function IconSettings({ color = themes.colors.white, size = 25 }: IconProps) {
export function IconSettings({ color = colors.white, size = 25 }: IconProps) {
return (
<Svg width={size} height={size} viewBox="0 0 25 25" fill="none">
<Path
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React from 'react';
import Svg, { Path } from 'react-native-svg';

import { themes } from '@/themes';
import { colors } from '@/helpers/themes';
import { IconProps } from '@/types/IconType';

import { IconProps } from './types';

export function IconSuccess({ color = themes.colors.white, size = 25 }: IconProps) {
export function IconSuccess({ color = colors.white, size = 25 }: IconProps) {
return (
<Svg width={size} height={size} viewBox="0 0 25 25" fill="none">
<Path
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React from 'react';
import Svg, { ClipPath, Defs, G, Path, Rect } from 'react-native-svg';

import { themes } from '@/themes';
import { colors } from '@/helpers/themes';
import { IconProps } from '@/types/IconType';

import { IconProps } from './types';

export function IconTwitter({ color = themes.colors.white, size = 25 }: IconProps) {
export function IconTwitter({ color = colors.white, size = 25 }: IconProps) {
return (
<Svg width={size} height={size} viewBox="0 0 20 20" fill="none">
<G clip-path="url(#clip0_638_694)">
Expand Down
Loading

0 comments on commit 1244119

Please sign in to comment.