Skip to content

Commit

Permalink
Merge pull request #6 from cyberkaidev/feature/new-layout-2.0.0
Browse files Browse the repository at this point in the history
New layout 2.0.0
  • Loading branch information
cyberkaidev authored Jun 17, 2024
2 parents 1244119 + 2914376 commit b6f23f4
Show file tree
Hide file tree
Showing 167 changed files with 5,858 additions and 5,560 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
"no-multi-spaces": "error",
"no-inner-declarations": "off",
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error"
"simple-import-sort/exports": "error",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-namespace": "off"
},
"settings": {
"react": {
Expand Down
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

./node_modules/.bin/commitlint --edit "$1"
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
32 changes: 13 additions & 19 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,33 @@ import 'react-native-reanimated';
import 'react-native-gesture-handler';

import { DarkTheme, NavigationContainer } from '@react-navigation/native';
import * as Device from 'expo-device';
import { useFonts } from 'expo-font';
import * as ScreenOrientation from 'expo-screen-orientation';
import * as SplashScreen from 'expo-splash-screen';
import { StatusBar } from 'expo-status-bar';
import * as React from 'react';
import { View } from 'react-native';
import { GestureHandlerRootView } from 'react-native-gesture-handler';

import { AlertModal } from '@/components/AlertModal';
import { initializeAppSettings } from '@/functions/initializeAppSettings';
import { colors } from '@/helpers/themes';
import { RootStack } from '@/routes/RootStack';

export default function App() {
const [fontsLoaded] = useFonts({
'Inter-Regular': require('./assets/fonts/Inter-Regular.otf'),
'Inter-Medium': require('./assets/fonts/Inter-Medium.otf'),
'Inter-Bold': require('./assets/fonts/Inter-Bold.otf'),
'Figtree-Regular': require('./assets/fonts/Figtree-Regular.ttf'),
'Figtree-Medium': require('./assets/fonts/Figtree-Medium.ttf'),
'Figtree-Bold': require('./assets/fonts/Figtree-Bold.ttf'),
});

React.useEffect(() => {
initializeAppSettings();
changeScreenOrientation();
}, []);

async function changeScreenOrientation() {
const deviceType = await Device.getDeviceTypeAsync();
const isTablet = Device.DeviceType[deviceType] == 'TABLET';
if (isTablet) {
await ScreenOrientation.lockAsync(ScreenOrientation.OrientationLock.LANDSCAPE);
} else {
await ScreenOrientation.lockAsync(ScreenOrientation.OrientationLock.PORTRAIT);
}
}

const onLayoutRootView = React.useCallback(async () => {
if (fontsLoaded) {
await ScreenOrientation.lockAsync(ScreenOrientation.OrientationLock.PORTRAIT);
await SplashScreen.hideAsync();
}
}, [fontsLoaded]);
Expand All @@ -49,10 +40,13 @@ export default function App() {

return (
<View style={{ flex: 1, backgroundColor: colors.black_100 }} onLayout={onLayoutRootView}>
<NavigationContainer theme={DarkTheme}>
<StatusBar backgroundColor={colors.black_100} style="light" translucent={false} />
<RootStack />
</NavigationContainer>
<GestureHandlerRootView style={{ flex: 1 }}>
<NavigationContainer theme={DarkTheme}>
<StatusBar backgroundColor={colors.transparent} style="light" translucent />
<RootStack />
<AlertModal />
</NavigationContainer>
</GestureHandlerRootView>
</View>
);
}
28 changes: 3 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Wallet you

![](https://i.imgur.com/gB3pq95.jpg)
![](https://i.imgur.com/1GOvuAe.jpeg)

### Features

Expand All @@ -13,33 +13,11 @@

- :robot: [Available on the Play Store](https://play.google.com/store/apps/details?id=com.cyberkaidev.walletyou)
- :art: [Figma](https://www.figma.com/file/blAHuULYf6EKSGSCJSn4VC/Wallet-you?type=design&t=JjtfPpvcyhgvYuu8-1)
- :rocket: [API](https://github.com/cyberkaidev/wallet-you-api)
- :bird: [Follow us on Twitter](https://twitter.com/cyberkaidev)

### Requirements

- [Node.js >= 18.0.0](https://nodejs.org/en)
- [Expo installed](https://docs.expo.dev/)
- [Tatum environment variable](https://docs.tatum.com/)

## Setup

Create an .env file with the properties:
[Create an account to have your key](https://docs.tatum.com/)

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

1. Install dependencies
```shell
yarn install
```

2. Run app
```shell
yarn android
```

:apple: **_It is currently available for Android, later it will be available for IOS_**

:moneybag: Support us: bc1qrrs0xfdd75fve2etu3936lnzjvwf8dm0w7vmwf
_It is currently available for Android_
27 changes: 23 additions & 4 deletions __test__/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,34 @@ jest.mock('@/stores/useBitcoinDataPrices', () => {
};
});

jest.mock('@react-navigation/native', () => {
export const mockedAlertModalActions = {
onCancel: jest.fn(),
onConfirm: jest.fn(),
showAlert: jest.fn(),
hideAlert: jest.fn(),
};

jest.mock('@/stores/useAlertModal', () => {
return {
useNavigation: () => ({
navigate: jest.fn(),
goBack: jest.fn(),
useAlertModal: () => ({
visible: true,
title: 'Hello World',
...mockedAlertModalActions,
}),
};
});

export const mockedNavigation = {
navigate: jest.fn(),
goBack: jest.fn(),
};

jest.mock('@react-navigation/native', () => {
return {
useNavigation: () => ({ ...mockedNavigation }),
};
});

jest.mock('@react-native-async-storage/async-storage', () =>
require('@react-native-async-storage/async-storage/jest/async-storage-mock'),
);
Expand Down
13 changes: 7 additions & 6 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.4.3",
"version": "2.0.0",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"userInterfaceStyle": "dark",
Expand All @@ -16,8 +16,7 @@
"assetBundlePatterns": ["**/*"],
"androidStatusBar": {
"barStyle": "light-content",
"backgroundColor": "#191B1F",
"translucent": false
"translucent": true
},
"ios": {
"supportsTablet": true,
Expand All @@ -35,7 +34,7 @@
},
"permissions": ["android.permission.USE_BIOMETRIC", "android.permission.USE_FINGERPRINT"],
"package": "com.cyberkaidev.walletyou",
"versionCode": "8"
"versionCode": 9
},
"web": {
"favicon": "./assets/images/favicon.ico"
Expand All @@ -51,9 +50,11 @@
[
"expo-screen-orientation",
{
"initialOrientation": "DEFAULT"
"initialOrientation": "PORTRAIT"
}
]
],
"expo-font",
"expo-secure-store"
]
}
}
Binary file added assets/fonts/Figtree-Bold.ttf
Binary file not shown.
Binary file added assets/fonts/Figtree-Medium.ttf
Binary file not shown.
Binary file added assets/fonts/Figtree-Regular.ttf
Binary file not shown.
Binary file removed assets/fonts/Inter-Bold.otf
Binary file not shown.
Binary file removed assets/fonts/Inter-Medium.otf
Binary file not shown.
Binary file removed assets/fonts/Inter-Regular.otf
Binary file not shown.
Binary file modified assets/images/adaptive-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/images/favicon.ico
Binary file not shown.
Binary file added assets/images/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 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.
Binary file modified assets/images/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 2 additions & 18 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,7 @@
module.exports = function (api) {
api.cache(true);
return {
presets: [
'module:metro-react-native-babel-preset',
'babel-preset-expo',
['@babel/preset-env', { targets: { node: 'current' } }],
'@babel/preset-typescript',
],
plugins: [
'react-native-reanimated/plugin',
[
'module-resolver',
{
root: ['.'],
alias: {
'@': './src',
},
},
],
],
presets: ['babel-preset-expo'],
plugins: ['react-native-reanimated/plugin'],
};
};
56 changes: 56 additions & 0 deletions commitlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { RuleConfigCondition, RuleConfigSeverity } from '@commitlint/types';

export default {
parserPreset: 'conventional-changelog-conventionalcommits',
rules: {
'type-enum': [
RuleConfigSeverity.Error,
'always',
[
':tada:', // Initial commit
':bookmark:', // Version tag
':sparkles:', // New feature
':bug:', // Bugfix
':card_index:', // Metadata
':books:', // Documentation
':bulb:', // Documenting source code
':racehorse:', // Performance
':lipstick:', // Cosmetic
':rotating_light:', // Tests
':white_check_mark:', // Adding a test
':heavy_check_mark:', // Make a test pass
':zap:', // General update
':art:', // Improve format/structure
':hammer:', // Refactor code
':fire:', // Removing code/files
':green_heart:', // Continuous Integration
':lock:', // Security
':arrow_up:', // Upgrading dependencies
':arrow_down:', // Downgrading dependencies
':shirt:', // Lint
':alien:', // Translation
':pencil:', // Text
':ambulance:', // Critical hotfix
':rocket:', // Deploying stuff
':apple:', // Fixing on MacOS
':penguin:', // Fixing on Linux
':checkered_flag:', // Fixing on Windows
':construction:', // Work in progress
':construction_worker:', // Adding CI build system
':chart_with_upwards_trend:', // Analytics or tracking code
':heavy_minus_sign:', // Removing a dependency
':heavy_plus_sign:', // Adding a dependency
':whale:', // Docker
':wrench:', // Configuration files
':package:', // Package.json in JS
':twisted_rightwards_arrows:', // Merging branches
':hankey:', // Bad code / need improv.
':rewind:', // Reverting changes
':boom:', // Breaking changes
':ok_hand:', // Code review changes
':wheelchair:', // Accessibility
':truck:', // Move/rename repository
],
] as [RuleConfigSeverity, RuleConfigCondition, string[]],
},
};
Loading

0 comments on commit b6f23f4

Please sign in to comment.