Skip to content

Commit

Permalink
chore(suite): fix unnecessary brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-sanderson committed Apr 30, 2024
1 parent 710a542 commit 0a04077
Show file tree
Hide file tree
Showing 16 changed files with 28 additions and 33 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ module.exports = {
// It's fine.
'react/no-multi-comp': 'off',
'react/no-unescaped-entities': 'off',
'react/jsx-curly-brace-presence': ['warn', { props: 'never', children: 'never' }],
// This is fine.
'class-methods-use-this': 'off',
'lines-between-class-members': 'off',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,26 @@ export const Text: StoryObj = {
<TextComponent>This is just a plain text</TextComponent>
</Block>
<Block>
<TextComponent variant={'primary'}>
<TextComponent variant="primary">
This is <strong>primary</strong> text
</TextComponent>
<TextComponent variant={'info'}>
<TextComponent variant="info">
This is <strong>info</strong> text
</TextComponent>
<TextComponent variant={'warning'}>
<TextComponent variant="warning">
This is <strong>warning</strong> text
</TextComponent>
<TextComponent variant={'destructive'}>
<TextComponent variant="destructive">
This is <strong>destructive</strong> text
</TextComponent>
</Block>
<Block>
<TextComponent color={'#9be887'}>
<TextComponent color="#9be887">
This is <strong>custom</strong> color text
</TextComponent>
</Block>
<Block>
<TextComponent variant={'info'} typographyStyle="titleMedium">
<TextComponent variant="info" typographyStyle="titleMedium">
This is just a plain Medium Title
</TextComponent>
</Block>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const ReplaceTxButton = () => {
isDisabled={isDisabled || isLoading}
onClick={signTransaction}
>
<Translation id={'TR_REPLACE_TX'} />
<Translation id="TR_REPLACE_TX" />
</StyledButton>
</Wrapper>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export const TxDetailModal = ({ tx, rbfForm, onCancel }: TxDetailModalProps) =>

<Middle>
<SectionTitle>
<Translation id={'TR_REPLACE_TX'} />
<Translation id="TR_REPLACE_TX" />
</SectionTitle>
</Middle>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const ViewOnlySettings = () => {
return (
<>
<SectionItem>
<TextColumn title={`Enable redesigned view-only`} />
<TextColumn title="Enable redesigned view-only" />
<ActionColumn>
<Checkbox
isChecked={isViewOnlyModeVisible}
Expand All @@ -29,7 +29,7 @@ export const ViewOnlySettings = () => {
</SectionItem>

<SectionItem>
<TextColumn title={`Set viewOnlyPromoClosed`} />
<TextColumn title="Set viewOnlyPromoClosed" />
<ActionColumn>
<Checkbox
isChecked={viewOnlyPromoClosed}
Expand All @@ -41,7 +41,7 @@ export const ViewOnlySettings = () => {
</SectionItem>

<SectionItem>
<TextColumn title={`Set viewOnlyTooltipClosed`} />
<TextColumn title="Set viewOnlyTooltipClosed" />
<ActionColumn>
<Checkbox
isChecked={viewOnlyTooltipClosed}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const DeviceStatusText = ({
return (
<DeviceConnectionText
variant="warning"
icon={'REFRESH'}
icon="REFRESH"
data-test={connected ? '@deviceStatus-connected' : '@deviceStatus-disconnected'}
isAction
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const DeviceStatusText = ({
return (
<DeviceConnectionText
variant="warning"
icon={'REFRESH'}
icon="REFRESH"
data-test={connected ? '@deviceStatus-connected' : '@deviceStatus-disconnected'}
isAction
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ const Top = () => {
<Text variant="primary" typographyStyle="label">
<Translation id="TR_BALANCE" />
</Text>
<FormattedCryptoAmount value={'0.04223123'} symbol={'BTC'} />
<FormattedCryptoAmount value="0.04223123" symbol="BTC" />
</ChartText>
<PriceChartLine />
<IllustrativeExamplePositioning>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export const UsedAddresses = ({
icon="ARROW_DOWN"
iconAlignment="right"
onClick={() => setLimit(limit + 20)}
data-test={`@wallet/receive/used-address/show-more`}
data-test="@wallet/receive/used-address/show-more"
>
<Translation id="TR_SHOW_MORE" />
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import { FormattedMessage } from 'react-intl';
import type { Messages } from '../translations/default';

export const Translation = ({ id, values }: { id: keyof Messages; values?: any }) => {
return <FormattedMessage id={id} tagName={'span'} values={values} />;
return <FormattedMessage id={id} tagName="span" values={values} />;
};
4 changes: 3 additions & 1 deletion suite-native/biometrics/src/components/BiometricOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ export const BiometricOverlay = ({
style={applyStyle(bottomWrapperStyle)}
>
<BiometricsIcon iconSize={iconSizes.extraLarge} showShadow />
<Text color="textPrimaryDefault">{<Translation id="biometricsButton" />}</Text>
<Text color="textPrimaryDefault">
<Translation id="biometricsButton" />
</Text>
</TouchableOpacity>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const EmptyConnectedDeviceState = () => {

return (
<Card style={applyStyle(cardStyle)}>
<VStack spacing={'large'} style={applyStyle(contentStyle)}>
<VStack spacing="large" style={applyStyle(contentStyle)}>
<PictogramTitleHeader
variant="green"
size="large"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const EnableViewOnlyBottomSheet = () => {
if (device) {
showToast({
variant: 'default',
message: <Translation id={'moduleSettings.viewOnly.toast.enabled'} />,
message: <Translation id="moduleSettings.viewOnly.toast.enabled" />,
icon: 'check',
});
dispatch(toggleRememberDevice({ device }));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const SendAccountsScreen = ({
return (
<Screen
screenHeader={<DeviceManagerScreenHeader />}
subheader={<ScreenSubHeader content={'Send from'} leftIcon={<GoBackIcon />} />}
subheader={<ScreenSubHeader content="Send from" leftIcon={<GoBackIcon />} />}
>
{/* TODO: Enable filtering same as receive screen has. */}
<AccountsList onSelectAccount={navigateToSendFormScreen} filterValue={TESTNET_FILTER} />
Expand Down
2 changes: 1 addition & 1 deletion suite-native/module-send/src/screens/SendFormScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const SendFormScreen = ({
// TODO: move text content to @suite-native/intl package when is copy ready
return (
<Screen
subheader={<ScreenSubHeader content={'Send form screen'} leftIcon={<GoBackIcon />} />}
subheader={<ScreenSubHeader content="Send form screen" leftIcon={<GoBackIcon />} />}
>
<VStack>
<VStack justifyContent="center" alignItems="center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,18 @@ export const ShowAddressViewOnlyBottomSheet = ({
<VStack spacing="large">
<VStack alignItems="center">
<Text variant="titleSmall">
<Translation
id={'moduleReceive.receiveAddressCard.viewOnlyWarning.title'}
/>
<Translation id="moduleReceive.receiveAddressCard.viewOnlyWarning.title" />
</Text>
<Text color="textSubdued">
<Translation
id={'moduleReceive.receiveAddressCard.viewOnlyWarning.description'}
/>
<Translation id="moduleReceive.receiveAddressCard.viewOnlyWarning.description" />
</Text>
</VStack>
<VStack spacing="medium" style={applyStyle(buttonWrapperStyle)}>
<Button colorScheme="yellowBold" onPress={onShowAddress}>
<Translation
id={'moduleReceive.receiveAddressCard.viewOnlyWarning.primaryButton'}
/>
<Translation id="moduleReceive.receiveAddressCard.viewOnlyWarning.primaryButton" />
</Button>
<Button colorScheme="yellowElevation1" onPress={handleCloseViewOnlyBottomSheet}>
<Translation
id={'moduleReceive.receiveAddressCard.viewOnlyWarning.secondaryButton'}
/>
<Translation id="moduleReceive.receiveAddressCard.viewOnlyWarning.secondaryButton" />
</Button>
</VStack>
</VStack>
Expand Down

0 comments on commit 0a04077

Please sign in to comment.