Skip to content

Commit

Permalink
[DDW-809] Code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcin Mazurek committed Aug 10, 2022
1 parent b62b9de commit bca0dab
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions source/renderer/app/components/wallet/WalletSendForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import type { ReactIntlMessage } from '../../types/i18nTypes';
import { DiscreetWalletAmount } from '../../features/discreet-mode';
import WalletTokenPicker from './tokens/wallet-token-picker/WalletTokenPicker';
import { ClearButton } from './widgets/ClearButton';
import { Divider } from './widgets/Divider';
import { VerticalSeparator } from './widgets/VerticalSeparator';
import { AnalyticsTracker, EventCategories } from '../../analytics';
import { CoinSelectionsResponse } from '../../api/transactions/types';

Expand Down Expand Up @@ -1147,7 +1147,7 @@ class WalletSendForm extends Component<Props, State> {
onClick={this.clearAdaAmountFieldValue}
/>
<div className={styles.dividerContainer}>
<Divider />
<VerticalSeparator />
</div>
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import removeIcon from '../../../assets/images/remove.inline.svg';
import type { NumberFormat } from '../../../../../common/types/number.types';
import { DiscreetTokenWalletAmount } from '../../../features/discreet-mode';
import Asset from '../../assets/Asset';
import { Divider } from '../widgets/Divider';
import { VerticalSeparator } from '../widgets/VerticalSeparator';
import { ClearButton } from '../widgets/ClearButton';
import styles from './AssetInput.scss';
import messages from './messages';
Expand Down Expand Up @@ -152,7 +152,7 @@ class AssetInput extends Component<Props> {
)}
{ticker ? (
<>
<Divider />
<VerticalSeparator />
<span className={styles.ticker}>{ticker}</span>
</>
) : null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import React from 'react';

import styles from './Divider.scss';

export function Divider() {
export function VerticalSeparator() {
return <span className={styles.component} />;
}
8 changes: 2 additions & 6 deletions source/renderer/app/features/discreet-mode/feature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ export class DiscreetMode extends Feature {
this.isDiscreetMode = !this.isDiscreetMode;
this.analyticsTracker.sendEvent(
EventCategories.SETTINGS,
this.isDiscreetMode
? 'Turned on discreet mode'
: 'Turned off discreet mode'
`Turned ${this.isDiscreetMode ? 'on' : 'off'} discreet mode`
);
};
@action
Expand All @@ -68,9 +66,7 @@ export class DiscreetMode extends Feature {
});
this.analyticsTracker.sendEvent(
EventCategories.SETTINGS,
nextSetting
? 'Turned on discreet mode by default'
: 'Turned off discreet mode by default'
`Turned ${nextSetting ? 'on' : 'off'} discreet mode by default`
);
};

Expand Down
4 changes: 1 addition & 3 deletions source/renderer/app/stores/AssetsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,7 @@ export default class AssetsStore extends Store {

this.analytics.sendEvent(
EventCategories.WALLETS,
!isFavorite
? 'Added token from favorites'
: 'Removed token from favorites'
`${!isFavorite ? 'Added' : 'Removed'} token from favorites`
);
};
_retrieveAssetsRequest = (walletId: string): Request<GetAssetsResponse> =>
Expand Down
6 changes: 6 additions & 0 deletions storybook/stories/common/Widgets.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import ButtonLink from '../../../source/renderer/app/components/widgets/ButtonLi
import NormalSwitch from '../../../source/renderer/app/components/widgets/forms/NormalSwitch';
import { Separator } from '../../../source/renderer/app/components/widgets/separator/Separator';
import { CollapsibleSection } from '../../../source/renderer/app/components/widgets/collapsible-section/CollapsibleSection';
import { VerticalSeparator } from '../../../source/renderer/app/components/wallet/widgets/VerticalSeparator';

const { intl: enIntl } = new IntlProvider({
locale: 'en-US',
Expand Down Expand Up @@ -266,4 +267,9 @@ storiesOf('Common / Widgets', module)
<WidgetPresentationBox>
<Separator />
</WidgetPresentationBox>
))
.add('VerticalSeparator', () => (
<WidgetPresentationBox>
<VerticalSeparator />
</WidgetPresentationBox>
));

0 comments on commit bca0dab

Please sign in to comment.