-
-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(suite-native): Introduce module-trading
- Loading branch information
Showing
11 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"name": "@suite-native/module-trading", | ||
"version": "1.0.0", | ||
"private": true, | ||
"license": "See LICENSE.md in repo root", | ||
"sideEffects": false, | ||
"main": "src/index", | ||
"scripts": { | ||
"depcheck": "yarn g:depcheck", | ||
"type-check": "yarn g:tsc --build", | ||
"test:unit": "yarn g:jest -c ../../jest.config.native.js" | ||
}, | ||
"dependencies": { | ||
"@react-navigation/native-stack": "6.11.0", | ||
"@reduxjs/toolkit": "1.9.5", | ||
"@suite-native/navigation": "workspace:*", | ||
"@suite-native/test-utils": "workspace:*", | ||
"@trezor/styles": "workspace:*", | ||
"react": "18.2.0", | ||
"react-native": "0.76.1", | ||
"react-native-reanimated": "^3.16.7" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { AsyncThunkAction } from '@reduxjs/toolkit'; | ||
|
||
declare module 'redux' { | ||
export interface Dispatch { | ||
<TThunk extends AsyncThunkAction<any, any, any>>(thunk: TThunk): ReturnType<TThunk>; | ||
} | ||
} |
Empty file.
24 changes: 24 additions & 0 deletions
24
suite-native/module-trading/src/navigation/TradingStackNavigator.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { createNativeStackNavigator } from '@react-navigation/native-stack'; | ||
|
||
import { | ||
stackNavigationOptionsConfig, | ||
TradingStackParamList, | ||
TradingStackRoutes, | ||
} from '@suite-native/navigation'; | ||
|
||
import { TradingScreen } from '../screens/TradingScreen'; | ||
|
||
const TradingStack = createNativeStackNavigator<TradingStackParamList>(); | ||
|
||
export const TradingStackNavigator = () => ( | ||
<TradingStack.Navigator | ||
initialRouteName={TradingStackRoutes.Trading} | ||
screenOptions={stackNavigationOptionsConfig} | ||
> | ||
<TradingStack.Screen | ||
options={{ title: TradingStackRoutes.Trading }} | ||
name={TradingStackRoutes.Trading} | ||
component={TradingScreen} | ||
/> | ||
</TradingStack.Navigator> | ||
); |
10 changes: 10 additions & 0 deletions
10
suite-native/module-trading/src/navigation/__tests__/TradingStackNavigator.comp.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { renderWithStore, waitFor } from '@suite-native/test-utils'; | ||
|
||
import { TradingStackNavigator } from '../TradingStackNavigator'; | ||
|
||
describe('TradingStackNavigator', () => { | ||
it('should render', async () => { | ||
const { getByText } = renderWithStore(<TradingStackNavigator />); | ||
await waitFor(() => expect(getByText('Trading placeholder')).toBeDefined()); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Screen } from '@suite-native/navigation'; | ||
import { Card, Text } from '@suite-native/atoms'; | ||
|
||
export const TradingScreen = () => ( | ||
<Screen> | ||
<Card> | ||
<Text>Trading placeholder</Text> | ||
</Card> | ||
</Screen> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"compilerOptions": { "outDir": "libDev" }, | ||
"references": [ | ||
{ "path": "../navigation" }, | ||
{ "path": "../test-utils" }, | ||
{ "path": "../../packages/styles" } | ||
], | ||
"include": [".", "**/*.json"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './StoreProvider'; | ||
export * from './appSlice'; | ||
export * from './store'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters