Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.6.0 #89

Merged
merged 280 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
280 commits
Select commit Hold shift + click to select a range
7f2cde2
chore: refactor
N3TC4T Jul 17, 2023
0e89adc
chore: use new ripple-binary-codec package
N3TC4T Jul 17, 2023
4e77dbe
fix: wrong icon coins name
N3TC4T Jul 19, 2023
4da8bee
feat: include extra header for xApp
N3TC4T Jul 24, 2023
2bddd87
feat: add xAppInfo screen
N3TC4T Jul 28, 2023
3d6dca2
feat: use CTID for explorer
N3TC4T Aug 3, 2023
8fdd51a
chore: upgrade RN
N3TC4T Aug 3, 2023
51bbbab
chore: upgrade deps
N3TC4T Aug 4, 2023
b6b7376
chore: upgrade dev deps
N3TC4T Aug 4, 2023
dc4429b
feat: store active network amendments
N3TC4T Aug 4, 2023
0bcf2aa
chore: fix unit test
N3TC4T Aug 4, 2023
bfa435f
chore: fix icon file name
N3TC4T Aug 14, 2023
080a5ad
fix: xapp header styling
N3TC4T Aug 14, 2023
ebbb39f
chore: some UI improvements
N3TC4T Aug 14, 2023
9808e58
chore: change proxy explorer link
N3TC4T Aug 15, 2023
775ceee
chore: upgrade deps
N3TC4T Aug 15, 2023
e1fb400
chore: include translations in the source
N3TC4T Aug 18, 2023
dfb78cf
chore: add sync-locales.js command
N3TC4T Aug 18, 2023
c6491dc
fix: ja,nl,sv translations
N3TC4T Aug 18, 2023
6f4014f
fix: rename network key to nodekey when sending to the backend
N3TC4T Aug 23, 2023
9ae60b2
feat: include connected network key to all requests under X-XummNet key
N3TC4T Aug 23, 2023
0d377ce
fix: a bug causing not all args applies to the URL
N3TC4T Aug 23, 2023
52ab471
fix: unable to sign tx when there is no definition for the network
N3TC4T Aug 23, 2023
a809c63
fix: ApiService unit test
N3TC4T Aug 23, 2023
ca14e44
chore: move nodeKey value to nodeType
N3TC4T Aug 23, 2023
9a6c1af
feat: add HookParameters to the base transaction fields
N3TC4T Aug 23, 2023
e4880bb
feat: update translations
N3TC4T Aug 23, 2023
c1afbf1
chore: refactor
N3TC4T Aug 23, 2023
df5216e
fix: payload getForcedNetwork
N3TC4T Aug 23, 2023
fa94512
chore: include list of know network amendments
N3TC4T Aug 23, 2023
66e8eec
fix: update account status when updating the network
N3TC4T Aug 24, 2023
03702f4
feat: use dynamic native asset icon and avatar
N3TC4T Aug 25, 2023
773afa7
feat: missing commit
N3TC4T Aug 25, 2023
17366a1
fix: de translation
N3TC4T Aug 28, 2023
98cad71
fix: missing key in translations
N3TC4T Aug 28, 2023
8088e62
fix: nl translation
N3TC4T Aug 28, 2023
1472fe3
feat: include master key status if account is not signable
N3TC4T Aug 28, 2023
46e0393
fix: WebView loading and fade style
N3TC4T Aug 28, 2023
93be002
chore: show account details in better way in session logs
N3TC4T Aug 28, 2023
380ec8f
fix: xapp browser crash when no account is configured
N3TC4T Aug 28, 2023
3d47ed1
fix: webview background color
N3TC4T Aug 28, 2023
81d3b2d
feat: calculate fee on hooks network + new fee picker component
N3TC4T Aug 29, 2023
0f9492d
feat: network rails sync placeholder
N3TC4T Aug 29, 2023
93a0d98
fix: unit test
N3TC4T Aug 29, 2023
0274485
fix: add missing translation
N3TC4T Aug 30, 2023
e166f70
fix: ja translations
tequdev Aug 30, 2023
a6a0c74
fix: transaction with fixed fee
N3TC4T Aug 30, 2023
f10e8dc
chore: add keys for SetHook tx template
N3TC4T Aug 30, 2023
7a77990
fix: update events list when network changed
N3TC4T Aug 30, 2023
ade35b0
fix: sync translations base on EN version
N3TC4T Aug 30, 2023
05211ea
chore: add new transactions labels to events list
N3TC4T Aug 30, 2023
d3efefb
fix(android): badge count
N3TC4T Aug 31, 2023
507ea16
feat: networking connecting animation
N3TC4T Aug 31, 2023
54e48a7
Merge commit '05211eaf8069609d3fc18ff467535a5b880343f9' into ja-1
tequdev Sep 1, 2023
a899fac
fix: SecretPinInput is triggering two time when entering code
N3TC4T Sep 4, 2023
5732c68
fix: store migration orphan trustLines
N3TC4T Sep 4, 2023
3d5b8f2
fix: populate the NetworkID only if supported by network
N3TC4T Sep 4, 2023
a808a76
chore: add network id check for socket response
N3TC4T Sep 5, 2023
d172195
feat: show network color in xApp header
N3TC4T Sep 5, 2023
e44ead7
fix: remove developer from xApp info
N3TC4T Sep 5, 2023
ae9e7ee
fix: only update events list when network switch when screen is visible
N3TC4T Sep 5, 2023
0532010
fix: unit tests
N3TC4T Sep 5, 2023
0bf0ebc
chore: update snapshots
N3TC4T Sep 5, 2023
b149bc2
fix: send amount issue
N3TC4T Sep 5, 2023
f30aaf7
chore: bump build number
N3TC4T Sep 5, 2023
3371414
fix: crash when account is not activated and set as regular key
N3TC4T Sep 11, 2023
68f76e9
fix: account details creates stale records when updating
N3TC4T Sep 11, 2023
8a407df
chore: update deps
N3TC4T Sep 13, 2023
97499f8
fix
tequdev Sep 13, 2023
81ee8de
feat: new fee calculation pow
N3TC4T Sep 14, 2023
50cde96
fix: cleanup AccountDetails stale records
N3TC4T Sep 14, 2023
7d1b67e
fix(translation): update da.json
N3TC4T Sep 14, 2023
c3031bd
chore: bump build version
N3TC4T Sep 14, 2023
a350916
fix: unit tests
N3TC4T Sep 14, 2023
9124c9c
fix: small UI
N3TC4T Sep 14, 2023
2b75dec
Merge pull request #91 from develoQ/ja-1
N3TC4T Sep 19, 2023
d01717c
Merge remote-tracking branch 'origin/develop' into develop
N3TC4T Sep 25, 2023
9c49428
chore: rebranding
N3TC4T Sep 25, 2023
770365f
chore: upgrade deps
N3TC4T Sep 25, 2023
6b775f5
chore: refactor
N3TC4T Sep 25, 2023
538ad30
fix: use json object serialized digest for payload hash calc
N3TC4T Sep 26, 2023
db703fa
chore: rebranding
N3TC4T Sep 26, 2023
39078c3
fix: small ui adjustments
N3TC4T Sep 26, 2023
751c742
fix: allow zero as destination tag
N3TC4T Sep 26, 2023
5ce173e
chore: unit tests
N3TC4T Sep 26, 2023
fc0b1e6
chore: more unit tests
N3TC4T Sep 27, 2023
a923cda
fix: LocalNotificationModule improvements
N3TC4T Sep 27, 2023
115c7a5
chore: improve NativeModules typing
N3TC4T Sep 27, 2023
000fe8e
fix: update locals
N3TC4T Sep 27, 2023
3168961
fix: jest warning
N3TC4T Sep 27, 2023
4b24097
chore: rebranding
N3TC4T Sep 27, 2023
56f01fd
chore: cleanup
N3TC4T Sep 27, 2023
05b4f6f
feat: replace storybook with cosmos
N3TC4T Sep 27, 2023
96703f2
fix: small bug
N3TC4T Sep 27, 2023
05644c0
fix: unit tests
N3TC4T Sep 27, 2023
c5e07d8
chore: update yarn.lock
N3TC4T Sep 28, 2023
620632a
fix: remove storybook
N3TC4T Sep 28, 2023
949cc6b
chore: add cosmos XAppShortList
N3TC4T Sep 28, 2023
52e4766
chore: replace ripple-binary-codec with AccountLib.binary
N3TC4T Sep 28, 2023
cd47713
[JA] fix
tequdev Sep 28, 2023
2899ee2
chore: upgrade Realm + more unit tests
N3TC4T Oct 3, 2023
b20a4f2
chore: cleanup
N3TC4T Oct 4, 2023
d73e90e
fix: pathfinding is not resolving
N3TC4T Oct 4, 2023
106043e
fix: NFTokenOfferTemplate is not rendrered correctly
N3TC4T Oct 4, 2023
29ca655
feat: include network label to SendView and ReviewStep
N3TC4T Oct 4, 2023
3ef59b4
chore: bump build number
N3TC4T Oct 5, 2023
551578f
feat: redesign xapp header
N3TC4T Oct 5, 2023
d2ce56f
Update nl.json
KevinKoobs Oct 6, 2023
bff4f42
fix myBalanceAndReserve
tequdev Oct 9, 2023
3c4ed7a
Added translation Spanish and fixes
Ekiserrepe Oct 10, 2023
7573edf
chore: add users selected currency in the session logs
N3TC4T Oct 12, 2023
811b1d8
[JA] add
tequdev Oct 13, 2023
93f481d
Merge commit '7573edfa93c9708607f74d48b6a15ea3ec55a63e' into ja-fix
tequdev Oct 13, 2023
3e71b6f
[JA] add
tequdev Oct 13, 2023
a22ae92
fix: add OperationLimit field to common fields
N3TC4T Oct 13, 2023
fa417a6
chore: bump build number
N3TC4T Oct 16, 2023
f5f2794
fix: xahau testnet network id & update network colors
N3TC4T Oct 16, 2023
9acd979
chore: add api response types
N3TC4T Oct 16, 2023
9126925
Merge pull request #95 from Ekiserrepe/develop
N3TC4T Oct 16, 2023
2df194a
Merge pull request #94 from KevinKoobs/patch-1
N3TC4T Oct 16, 2023
2543cd7
Merge pull request #93 from develoQ/ja-fix
N3TC4T Oct 16, 2023
d6ffb9f
Merge remote-tracking branch 'origin/develop' into develop
N3TC4T Oct 16, 2023
d8d87e1
fix: translations new line issue
N3TC4T Oct 16, 2023
3fc929b
fix: events list is not reloading on account change
N3TC4T Oct 17, 2023
886b31a
feat: revert developerMode mode settings and network to default value…
N3TC4T Oct 17, 2023
74526e9
feat: require authentication for enabling developer mode
N3TC4T Oct 17, 2023
d78d517
chore: refactor
N3TC4T Oct 17, 2023
5677b74
feat(android): disable flagSecure if developer mode is on
N3TC4T Oct 17, 2023
7d02643
fix(ios): SharedPreferencesModule get return null if not found
N3TC4T Oct 18, 2023
3144fd4
fix: optimize curated list syncing
N3TC4T Oct 18, 2023
b5449d8
fix: fee calculation returns infinity in case of big base fee
N3TC4T Oct 24, 2023
56b1265
feat: network rails sync
N3TC4T Oct 24, 2023
5cdea8a
chore: typing improvement
N3TC4T Oct 24, 2023
367becd
chore: refactor
N3TC4T Oct 24, 2023
d2f95c9
fix: crash when account details is empty
N3TC4T Oct 24, 2023
1106a5c
fix: show placeholder if xapp item in shortlist is empty
N3TC4T Oct 25, 2023
bdd371a
fix: NetworkRailsSyncModal interface improvement
N3TC4T Oct 25, 2023
f9a5b74
fix: add hitSlop to Header buttons for better experience
N3TC4T Oct 25, 2023
0d703df
fix: switch network button padding in home screen
N3TC4T Oct 26, 2023
c1f9d89
feat: check if network is supporting transaction before signing
N3TC4T Oct 27, 2023
e94770d
chore: refactor
N3TC4T Oct 27, 2023
81e3a3b
feat: add ReviewTransaction preflight & required actions
N3TC4T Oct 27, 2023
18e0d2b
chore: refactor
N3TC4T Oct 27, 2023
a905dad
fix: allow Import transaction to be signed even if account is not act…
N3TC4T Oct 27, 2023
da5d219
fix: Tangem signing with custom definitions
N3TC4T Oct 27, 2023
5c02f82
chore: bump build number
N3TC4T Oct 30, 2023
52293e6
fix: NetworkID should not be populated for legacy networks
N3TC4T Oct 30, 2023
3b98a59
fix: add GenesisMin transaction type
N3TC4T Oct 30, 2023
d24a780
chore: bump build
N3TC4T Oct 30, 2023
010b5e5
fix: switching network update the cached owner & base reserve
N3TC4T Oct 31, 2023
275416d
chore: change Xahau network and asset icon
N3TC4T Oct 31, 2023
d9d194a
feat: TextPlaceholder add fadeIn animation when visible
N3TC4T Nov 2, 2023
3020dd1
fix: move SegmentButtons in EventsView to the left
N3TC4T Nov 2, 2023
65a0526
feat: add fadeIn animation to Avatar component
N3TC4T Nov 2, 2023
5cf56f1
Fix NL trl
WietseWind Nov 2, 2023
88d1c48
chore: refactor transactions info & validations
N3TC4T Nov 2, 2023
f9b853a
fix: remove duplicated network when syncing rails
N3TC4T Nov 3, 2023
c81a42b
fix: xapp store set placeholders if list is empty
N3TC4T Nov 3, 2023
e7277c8
chore: refactor
N3TC4T Nov 3, 2023
f677bab
feat: improve network rails sync design
N3TC4T Nov 5, 2023
8a9565b
chore: refactor
N3TC4T Nov 5, 2023
fbbf1d5
chore: upgrade ripple-binary-codec & xrpl-accountlib
N3TC4T Nov 5, 2023
df6d754
fix: calculate NFTokenID base on fixNFTokenRemint amendment
N3TC4T Nov 5, 2023
ed6e543
chore: bump build number
N3TC4T Nov 5, 2023
114361c
Merge remote-tracking branch 'origin/develop' into develop
N3TC4T Nov 5, 2023
c8cd734
fix: sortable list changes are not persisted
N3TC4T Nov 10, 2023
6fb2454
chore: bump build number
N3TC4T Nov 23, 2023
24dc238
fix: change hard coded xahau testnet endpoint
N3TC4T Nov 23, 2023
86b7a03
fix(ios): better handling forced ws endpoints
N3TC4T Nov 23, 2023
5c878d3
fix: SwipeButton change label color base on background color
N3TC4T Nov 23, 2023
ae1c4ce
fix(translations): rebranding
N3TC4T Nov 23, 2023
f0e5003
fix(translations): multi native asset support
N3TC4T Nov 23, 2023
575e66f
chore: upgrade deps
N3TC4T Nov 24, 2023
f52741f
fix: calculate fiat rate for base on connected network native assets
N3TC4T Nov 24, 2023
102f049
fix: hooks fee for transaction showing wrong amount
N3TC4T Nov 24, 2023
f6ab880
fix: events list EscrowFinish transaction causing crash
N3TC4T Nov 24, 2023
de9256f
fix: SwipeButton only use network color when developer mode on
N3TC4T Nov 24, 2023
7169f0c
feat: show error message when user is connected to the network which …
N3TC4T Nov 24, 2023
eb3e5bb
fix: remove testing
N3TC4T Nov 24, 2023
916aedb
feat: include original ott when reloading xApp
N3TC4T Nov 24, 2023
b8eeb32
feat: better xApp switch network error design
N3TC4T Nov 24, 2023
80bd43d
feat: loading list of vetted tokens only when adding new token
N3TC4T Nov 25, 2023
aba76b2
fix: add missing translation
N3TC4T Nov 27, 2023
5f22ab4
fix: account label limit
N3TC4T Nov 27, 2023
ee4abc4
chore: refactor
N3TC4T Nov 27, 2023
4f145fb
chore: remove fee calculation from transaction base class
N3TC4T Nov 27, 2023
cf0b2da
chore: remove payload Payment currency conversion
N3TC4T Nov 27, 2023
fafe8db
chore: transactions unit tests
N3TC4T Nov 28, 2023
f2da9cb
fix: calculate NFTokenID
N3TC4T Nov 30, 2023
668f42b
fix: handle loading transaction details for other network when opened…
N3TC4T Nov 30, 2023
5b88be4
chore: refactor RecipientElement and loading recipient details
N3TC4T Nov 30, 2023
93b5fd7
chore: refactor
N3TC4T Nov 30, 2023
7b1d618
fix: fee calculation when the fee_hooks_feeunits is undefined
N3TC4T Nov 30, 2023
a74592a
fix: transaction validation
N3TC4T Dec 4, 2023
7d603bb
fix: AnimatedDialog without fixed height
N3TC4T Dec 4, 2023
29f09ad
feat: enable signing with both Master key and Regular key if both hav…
N3TC4T Dec 4, 2023
45f10da
chore: refactor
N3TC4T Dec 4, 2023
bde9342
fix: when signing with tangem card canceling dialog show error
N3TC4T Dec 4, 2023
fe5c78a
chore: refactor
N3TC4T Dec 4, 2023
35cc081
chore: refactor
N3TC4T Dec 4, 2023
cd892cf
chore: bump build number
N3TC4T Dec 5, 2023
00904fe
feat: include Account details when signing on behalf of another account
N3TC4T Dec 5, 2023
c809479
chore: refactor
N3TC4T Dec 5, 2023
f1d5055
chore: refactor
N3TC4T Dec 6, 2023
fa88634
feat: new tx type EnableAmendment & genesisMint
N3TC4T Dec 6, 2023
cccd909
fix: missing translation key
N3TC4T Dec 6, 2023
9c88144
chore: clean up
N3TC4T Dec 6, 2023
5d5e927
feat: add hook explainer to Review and Details screen
N3TC4T Dec 6, 2023
ed977f3
fix: unit test timezone
N3TC4T Dec 7, 2023
0668536
chore: refactor
N3TC4T Dec 7, 2023
749b305
fix: use http POST when loading hooks explainer
N3TC4T Dec 7, 2023
c79cebe
fix: better error message for HooksExplainer component
N3TC4T Dec 7, 2023
8aeef73
fix: add load more to Blob field, Import transaction review
N3TC4T Dec 7, 2023
adc21b1
fix: currency rate wrong cache key when switching network
N3TC4T Dec 7, 2023
a727858
chore: refactor
N3TC4T Dec 7, 2023
78bcbff
feat: change to the desire account when loading the transaction from …
N3TC4T Dec 7, 2023
caf6bc6
feat: add description info for new transaction types
N3TC4T Dec 7, 2023
2971382
fix: Background image is not show correctly
N3TC4T Dec 7, 2023
e5667be
fix: new tx types unit tests
N3TC4T Dec 8, 2023
d7920a2
fix: Update claim reward parsing
N3TC4T Dec 8, 2023
9961ce8
fix: base repository tests
N3TC4T Dec 8, 2023
53c25b6
fix: vault set signers regular key account error
N3TC4T Dec 8, 2023
ddfd47f
fix: update `onNetworkChange` method in XAppBrowserModal to handle ne…
N3TC4T Dec 8, 2023
f3799fd
fix: fetch xapp donation amounts from backend
N3TC4T Dec 8, 2023
8490d00
fix: event list is not auto refresh when there is no balance changes …
N3TC4T Dec 8, 2023
9ee397a
core: bump build number
N3TC4T Dec 8, 2023
10bdadb
fix: switch button onNetworkChange event fired multiple times
N3TC4T Dec 11, 2023
2cd7684
chore: change network names
N3TC4T Dec 11, 2023
2d7e25b
chore: fix e2e tests
N3TC4T Dec 11, 2023
e4ce7a0
fix: singing transaction as multi sign returns STArray error
N3TC4T Dec 11, 2023
ab969e4
chore: upgrade deps
N3TC4T Dec 11, 2023
6ed57cb
chore: bump build number
N3TC4T Dec 11, 2023
7baef57
fix(translation): hr.json
N3TC4T Dec 11, 2023
9b5566c
fix: add new transaction flags
N3TC4T Dec 11, 2023
86de1b2
fix: add OptOut to the claim reward descriptions
N3TC4T Dec 11, 2023
496fdc5
fix: transaction amount details visual bugs
N3TC4T Dec 11, 2023
ae68076
feat: add style param to HookExplainer when loading
N3TC4T Dec 11, 2023
481a7b8
chore: bump build number
N3TC4T Dec 11, 2023
bba314c
Fix: change network id field from int to objectId in NetworkModel
N3TC4T Dec 12, 2023
35df3c7
chore: e2e tests
N3TC4T Dec 12, 2023
7e875a3
fix: HooksExplainer http headers
N3TC4T Dec 12, 2023
d10be8a
fix: do not render amount for SetHook transaction in details screen
N3TC4T Dec 12, 2023
488ab12
fix: translations
N3TC4T Dec 12, 2023
feffb9b
feat: add OfferID and EscrowID field
N3TC4T Dec 12, 2023
a749b65
fix: populate storage
N3TC4T Dec 12, 2023
3aabf15
chore: update network colors from rails
N3TC4T Dec 13, 2023
8091536
chore: add unit test case to the NetworkRepository
N3TC4T Dec 13, 2023
6ed6ae7
feat: better ui for payload forced network switch
N3TC4T Dec 13, 2023
ef109f1
fix: NetworkSwitchButton returns old value on callback
N3TC4T Dec 13, 2023
d01d023
fix: some UI improvements for XAppBrowserModal switch network
N3TC4T Dec 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
51 changes: 51 additions & 0 deletions .cosmos/cosmos.app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import React, { Component } from 'react';
import { View } from 'react-native';
import { Navigation } from 'react-native-navigation';
import { NativeFixtureLoader } from 'react-cosmos-native';
import { rendererConfig, moduleWrappers } from './cosmos.imports';

class CosmosApp extends Component {
render() {
return (
<View
style={{
flex: 1,
justifyContent: 'center',
alignItems: 'center',
paddingHorizontal: 10,
paddingVertical: 10,
}}
>
{NativeFixtureLoader({
rendererConfig,
moduleWrappers,
})}
</View>
);
}
}

Navigation.registerComponent('Cosmos.UI', () => CosmosApp);

Navigation.events().registerAppLaunchedListener(async () => {
Navigation.setRoot({
root: {
stack: {
children: [
{
component: {
name: 'Cosmos.UI',
options: {
topBar: {
visible: false,
},
},
},
},
],
},
},
});
});

export default CosmosApp;
4 changes: 4 additions & 0 deletions .cosmos/cosmos.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"fixturesDir": "fixtures",
"globalImports": ["./prepare.ts"]
}
37 changes: 37 additions & 0 deletions .cosmos/cosmos.imports.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// This file is automatically generated by Cosmos. Add it to .gitignore and
// only edit if you know what you're doing.

import { RendererConfig, UserModuleWrappers } from 'react-cosmos-core';

import './prepare';

import * as fixture0 from './fixtures/XAppShortList.fixture';
import * as fixture1 from './fixtures/SegmentButton.fixture';
import * as fixture2 from './fixtures/AccountElement.fixture';
import * as fixture3 from './fixtures/InfoMessage.fixture';
import * as fixture4 from './fixtures/Badge.fixture';
import * as fixture5 from './fixtures/Avatar.fixture';
import * as fixture6 from './fixtures/AmountText.fixture';

export const rendererConfig: RendererConfig = {
playgroundUrl: 'http://localhost:5001',
rendererUrl: null,
};

const fixtures = {
'fixtures/XAppShortList.fixture.tsx': { module: fixture0 },
'fixtures/SegmentButton.fixture.tsx': { module: fixture1 },
'fixtures/AccountElement.fixture.tsx': { module: fixture2 },
'fixtures/InfoMessage.fixture.tsx': { module: fixture3 },
'fixtures/Badge.fixture.tsx': { module: fixture4 },
'fixtures/Avatar.fixture.tsx': { module: fixture5 },
'fixtures/AmountText.fixture.tsx': { module: fixture6 },
};

const decorators = {};

export const moduleWrappers: UserModuleWrappers = {
lazy: false,
fixtures,
decorators,
};
25 changes: 25 additions & 0 deletions .cosmos/fixtures/AccountElement.fixture.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react';

import { AccountElement } from '@components/Modules/AccountElement';

const RECIPIENT_DATA = {
id: 'id',
address: 'rwiETSee2wMz3SBnAG8hkMsCgvGy9LWbZ1',
name: 'Wietse',
source: 'contacts',
};

const onPressMock = () => {
console.log('RecipientElement onPress');
};

export default {
Original: <AccountElement address={RECIPIENT_DATA.address} info={RECIPIENT_DATA} onPress={onPressMock} />,
WithSource: (
<AccountElement
address={RECIPIENT_DATA.address}
info={{ ...RECIPIENT_DATA, source: 'internal:bithomp.com' }}
onPress={onPressMock}
/>
),
};
23 changes: 23 additions & 0 deletions .cosmos/fixtures/AmountText.fixture.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from 'react';
import { AmountText } from '@components/General/AmountText';

import withPropsCombinations from '../matrix';

const VALUES = ['0.00000000000001', '2.2222', '99999.123456'];

export default {
original: withPropsCombinations(AmountText, {
value: VALUES,
}),
withPrefix: withPropsCombinations(AmountText, {
value: VALUES,
prefix: ['-'],
}),

withCurrency: withPropsCombinations(AmountText, {
value: VALUES,
currency: ['USD'],
}),

discreet: <AmountText currency="USD" value="123" discreet />,
};
12 changes: 12 additions & 0 deletions .cosmos/fixtures/Avatar.fixture.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';
import { Avatar } from '@components/General/Avatar';

const URI = { uri: 'https://xumm.app/_nuxt/team-peter.de2cdd6b.png' };

export default {
Original: <Avatar source={URI} />,
'With Border': <Avatar source={URI} border />,
Big: <Avatar source={URI} size={100} />,
'With Badge': <Avatar source={URI} size={100} badge="IconCheckXaman" />,
'With Badge Color': <Avatar source={URI} size={100} badge="IconAlertTriangle" badgeColor="red" />,
};
33 changes: 33 additions & 0 deletions .cosmos/fixtures/Badge.fixture.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from 'react';

import { Badge } from '@components/General/Badge';
import withPropsCombinations from '../matrix';

const SIZES = ['small', 'medium', 'large'];

export default {
Bithomp: withPropsCombinations(Badge, {
size: SIZES,
type: ['bithomp'],
}),

XRPScan: withPropsCombinations(Badge, {
size: SIZES,
type: ['xrpscan'],
}),

XRPLNS: withPropsCombinations(Badge, {
size: SIZES,
type: ['xrplns'],
}),

PayId: withPropsCombinations(Badge, {
size: SIZES,
type: ['payid'],
}),

Success: withPropsCombinations(Badge, {
size: SIZES,
type: ['success'],
}),
};
29 changes: 29 additions & 0 deletions .cosmos/fixtures/InfoMessage.fixture.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from 'react';

import { InfoMessage } from '@components/General/InfoMessage';
import withPropsCombinations from '../matrix';

const TYPES = ['info', 'warning', 'error', 'success', 'neutral'];
const label = 'Lorem Ipsum is simply dummy text of the printing and typesetting industry';

export default {
All: withPropsCombinations(InfoMessage, {
type: TYPES,
label: [label],
icon: ['IconInfo'],
}),

Flat: withPropsCombinations(InfoMessage, {
type: TYPES,
label: [label],
icon: ['IconInfo'],
flat: [true],
}),

'With More info': withPropsCombinations(InfoMessage, {
type: TYPES,
label: [label],
icon: ['IconInfo'],
onMoreButtonPress: [() => {}],
}),
};
14 changes: 14 additions & 0 deletions .cosmos/fixtures/SegmentButton.fixture.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';

import { SegmentButton } from '@components/General/SegmentButton';

const BUTTONS = ['All', 'Planned', 'Requests'];

export default (
<SegmentButton
buttons={BUTTONS}
onPress={() => {
console.log('Pressed');
}}
/>
);
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
/* eslint-disable spellcheck/spell-checker */
import React from 'react';
import { storiesOf } from '@storybook/react-native';

import { withContainer } from '../../../../storybook/decoration';

import { XAppShortList } from '../XAppShortList';
import { XAppShortList } from '@components/Modules/XAppShortList';

const apps = [
{
Expand Down Expand Up @@ -33,6 +29,4 @@ const apps = [
},
];

storiesOf('XAppList', module)
.addDecorator(withContainer)
.add('default', () => <XAppShortList apps={apps} />);
export default <XAppShortList apps={apps} />;
65 changes: 65 additions & 0 deletions .cosmos/matrix/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import React, { ReactNode } from 'react';
import { View } from 'react-native';

type VariationsByField = {
[key: string]: any[];
};

type CreatedElementProps = {
[key: string]: any;
};

const flatMap = (arr: any[], fn: (item: any) => any[]): any[] => arr.map(fn).reduce((a, b) => a.concat(b), []);

const combinations = (variationsByField: VariationsByField): CreatedElementProps[] => {
const fieldNames = Object.keys(variationsByField);

if (!fieldNames.length) return [{}];

const _combinations = (fieldNamesList: string[], acc: CreatedElementProps): CreatedElementProps[] => {
const fieldName = fieldNamesList[0];
const restFieldNames = fieldNamesList.slice(1);

const variationsForField = variationsByField[fieldName];

if (!Array.isArray(variationsForField) || !variationsForField.length) {
throw new Error(`Please provide a non-empty array of possible values for prop ${fieldName}`);
}

const vs = variationsForField.map((fieldValue) => ({ ...acc, [fieldName]: fieldValue }));

if (!restFieldNames.length) {
return vs;
}
return flatMap(vs, (newAcc) => _combinations(restFieldNames, newAcc));
};

return _combinations(fieldNames, {});
};

const createElement = (Component: any, props: CreatedElementProps): ReactNode => {
return (
<View style={{ marginTop: 10, alignSelf: 'stretch' }} key={Math.random().toString()}>
{React.createElement(Component, props)}
</View>
);
};

const withPropsCombinations = (component: any, possibleValuesByPropName: VariationsByField) => {
const propsCombinations = combinations(possibleValuesByPropName);

return (
<View
style={{
flex: 1,
justifyContent: 'center',
alignItems: 'center',
alignSelf: 'stretch',
}}
>
{propsCombinations.map((props, i) => createElement(component, { ...props, key: i }))}
</View>
);
};

export default withPropsCombinations;
41 changes: 41 additions & 0 deletions .cosmos/prepare.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import Locale from '../src/locale';

import NetworkService from '../src/services/NetworkService';
import { Amendments } from '../src/common/constants';

// set local
Locale.setLocale('EN');

// set connected network
// @ts-ignore
NetworkService.network = {
baseReserve: 10,
ownerReserve: 2,
isFeatureEnabled(amendment: keyof typeof Amendments): boolean {
return true;
},
definitions: {},
nativeAsset: {
asset: 'XRP',
icon: '',
iconSquare: '',
set: function (element: { [key: string]: unknown }): Realm.DictionaryBase<unknown> {
throw new Error('Function not implemented.');
},
remove: function (key: string | string[]): Realm.DictionaryBase<unknown> {
throw new Error('Function not implemented.');
},
addListener: function (callback: Realm.DictionaryChangeCallback): void {
throw new Error('Function not implemented.');
},
removeListener: function (callback: Realm.DictionaryChangeCallback): void {
throw new Error('Function not implemented.');
},
removeAllListeners: function (): void {
throw new Error('Function not implemented.');
},
toJSON: function (): Record<string, unknown> {
throw new Error('Function not implemented.');
},
},
};
Loading
Loading