Skip to content

Commit

Permalink
[DDW-596] Continue develop merge
Browse files Browse the repository at this point in the history
  • Loading branch information
mchappell committed Jan 15, 2022
1 parent de37361 commit 3cad476
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/chromatic.yml
Expand Up @@ -8,7 +8,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "14"
node-version: "16"
- name: Install dependencies
run: yarn
- name: Publish to Chromatic
Expand Down
8 changes: 5 additions & 3 deletions source/main/index.ts
Expand Up @@ -173,8 +173,9 @@ const onAppReady = async () => {
enableApplicationMenuNavigationChannel.onReceive(
() =>
new Promise((resolve) => {
const locale = getLocale(network);
// @ts-ignore ts-migrate(2345) FIXME: Argument of type 'unknown' is not assignable to pa... Remove this comment to see the full error message
buildAppMenus(mainWindow, cardanoNode, userLocale, {
buildAppMenus(mainWindow, cardanoNode, locale, {
isNavigationEnabled: true,
});
resolve();
Expand All @@ -183,12 +184,13 @@ const onAppReady = async () => {
rebuildApplicationMenu.onReceive(
(data) =>
new Promise((resolve) => {
const locale = getLocale(network);
// @ts-ignore ts-migrate(2345) FIXME: Argument of type 'unknown' is not assignable to pa... Remove this comment to see the full error message
buildAppMenus(mainWindow, cardanoNode, userLocale, {
buildAppMenus(mainWindow, cardanoNode, locale, {
isNavigationEnabled: data.isNavigationEnabled,
});
// @ts-ignore ts-migrate(2339) FIXME: Property 'updateTitle' does not exist on type 'Bro... Remove this comment to see the full error message
mainWindow.updateTitle(userLocale);
mainWindow.updateTitle(locale);
resolve();
})
);
Expand Down
Expand Up @@ -47,7 +47,7 @@ export default class LogosDisplay extends Component<Props> {
return (
<div className={styles.component}>
<SVGInline svg={adaLogo} className={currencyLogoStyles} />
<div className={daedalusLogoStyles}>
<div className={daedalusLogoStyles} data-chromatic="ignore">
<Lottie options={logoAnimationOptionsLottie} />
</div>
<SVGInline svg={cardanoLogo} className={apiLogoStyles} />
Expand Down
@@ -1,9 +1,8 @@
// @flow
import { defineMessages } from 'react-intl';
import type { ReactIntlMessage } from '../../../types/i18nTypes';
import { ReactIntlMessage } from '../../../types/i18nTypes';

export const messages: {
[string]: ReactIntlMessage,
[key: string]: ReactIntlMessage;
} = defineMessages({
dialogTitle: {
id: 'wallet.settings.icoPublicKey',
Expand Down
Expand Up @@ -12,14 +12,13 @@ import iconCopy from '../../../assets/images/clipboard-ic.inline.svg';
// @ts-ignore ts-migrate(2307) FIXME: Cannot find module './PublicKeyQRCodeDialog.scss' ... Remove this comment to see the full error message
import styles from './PublicKeyQRCodeDialog.scss';
import globalMessages from '../../../i18n/global-messages';
import type { ReactIntlMessage } from '../../../types/i18nTypes';
import { messages } from './ICOPublicKeyQRCodeDialog.messages';

type Props = {
walletName: string;
walletPublicKey: string;
onCopyWalletPublicKey: (...args: Array<any>) => any;
onClose: (...args: Array<any>) => any;
messages: Record<string, ReactIntlMessage>;
derivationPath: string;
intl: intlShape.isRequired;
};
Expand All @@ -29,7 +28,6 @@ const ICOPublicKeyQRCodeDialog = observer((props: Props) => {
walletPublicKey,
onCopyWalletPublicKey,
onClose,
messages,
derivationPath,
intl,
} = props;
Expand Down
Expand Up @@ -29,23 +29,6 @@ const walletMessages: Record<string, ReactIntlMessage> = defineMessages({
description: 'Tooltip for the derivation path',
},
});
const icoMessages: Record<string, ReactIntlMessage> = defineMessages({
dialogTitle: {
id: 'wallet.settings.icoPublicKey',
defaultMessage: '!!!ICO Public Key',
description: 'Title for the "ICO Public Key QR Code" dialog.',
},
copyPublicKeyLabel: {
id: 'wallet.settings.copyICOPublicKey',
defaultMessage: '!!!Copy ICO public key',
description: 'Copy ICO public key label.',
},
derivationPathTooltip: {
id: 'wallet.settings.dialog.derivationPathTooltip',
defaultMessage: '!!!Derivation path',
description: 'Tooltip for the derivation path',
},
});
type Props = InjectedProps;

@inject('actions', 'stores')
Expand Down Expand Up @@ -104,7 +87,6 @@ class PublicKeyQRCodeDialogContainer extends Component<Props> {
onClose={() => {
actions.dialogs.closeActiveDialog.trigger();
}}
messages={icoMessages}
derivationPath={ICO_PUBLIC_KEY_DERIVATION_PATH}
/>
);
Expand Down
4 changes: 4 additions & 0 deletions storybook/preview.tsx
@@ -1,7 +1,11 @@
import React from 'react';
import timemachine from 'timemachine';
import StoryWrapper from './stories/_support/StoryWrapper';
import '!style-loader!css-loader!sass-loader!../source/renderer/app/themes/index.global.scss'; // eslint-disable-line

import './stories/_support/environment';

export const decorators = [(story) => <StoryWrapper>{story}</StoryWrapper>];
timemachine.config({
dateString: 'Sat, 01 Jan 2022 10:00:00 GMT',
});
24 changes: 9 additions & 15 deletions storybook/stories/_support/utils.ts
Expand Up @@ -2,8 +2,10 @@ import hash from 'hash.js';
import faker from 'faker';
import JSONBigInt from 'json-bigint';
import moment from 'moment';
import { random, get } from 'lodash';
import { get } from 'lodash';
import BigNumber from 'bignumber.js';
import seedrandom from 'seedrandom';

import Wallet, {
WalletSyncStateStatuses,
} from '../../../source/renderer/app/domains/Wallet';
Expand Down Expand Up @@ -33,6 +35,8 @@ import type {
import type { SyncStateStatus } from '../../../source/renderer/app/api/wallets/types';
import type { TransactionMetadata } from '../../../source/renderer/app/types/TransactionMetadata';

const random = seedrandom('daedalus', { global: false });

export const EXAMPLE_METADATA = JSONBigInt.parse(`{
"0": {
"string": "some string"
Expand Down Expand Up @@ -78,20 +82,10 @@ export const EXAMPLE_METADATA = JSONBigInt.parse(`{
]
}
}`);
export const generateHash = () => {
const now = new Date().valueOf().toString();
return hash
.sha512()
.update(now + random(0.1, 0.9))
.digest('hex');
};
export const generatePolicyIdHash = () => {
const now = new Date().valueOf().toString();
return hash
.sha224()
.update(now + random(0.1, 0.9))
.digest('hex');
};
export const generateHash = () =>
hash.sha512().update(random().toString()).digest('hex');
export const generatePolicyIdHash = () =>
hash.sha224().update(random().toString()).digest('hex');

const statusProgress = (status) =>
status === WalletSyncStateStatuses.RESTORING
Expand Down

0 comments on commit 3cad476

Please sign in to comment.