Skip to content

Commit

Permalink
chore: fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
khanti42 committed Jan 27, 2025
1 parent aaf950e commit e83661a
Show file tree
Hide file tree
Showing 22 changed files with 820 additions and 905 deletions.
32 changes: 15 additions & 17 deletions packages/wallet-ui/src/components/pages/Home/Home.view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,20 @@ export const HomeView = ({ address }: Props) => {
const { translate } = useMultiLanguage();

return (
translate && (
<Wrapper>
<SideBar address={address} />
<RightPart>
{!upgradeModalVisible &&
Object.keys(erc20TokenBalanceSelected).length > 0 && (
<Header address={address} />
)}
{!upgradeModalVisible && <TransactionsList transactions={[]} />}
{!upgradeModalVisible &&
Object.keys(transactions).length === 0 &&
!loader.isLoading && (
<NoTransactions>{translate('noTransactions')}</NoTransactions>
)}
</RightPart>
</Wrapper>
)
<Wrapper>
<SideBar address={address} />
<RightPart>
{!upgradeModalVisible &&
Object.keys(erc20TokenBalanceSelected).length > 0 && (
<Header address={address} />
)}
{!upgradeModalVisible && <TransactionsList transactions={[]} />}
{!upgradeModalVisible &&
Object.keys(transactions).length === 0 &&
!loader.isLoading && (
<NoTransactions>{translate('noTransactions')}</NoTransactions>
)}
</RightPart>
</Wrapper>
);
};
28 changes: 13 additions & 15 deletions packages/wallet-ui/src/components/ui/Framework/Framework.view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,18 @@ export const FrameworkView = ({ connected, children }: Props) => {
const { translate } = useMultiLanguage();

return (
translate && (
<Wrapper>
<ColMiddle>
<MenuStyled connected={connected} />
<Content>{children}</Content>
<Footer />
</ColMiddle>
{bannerOpen && (
<Banner>
{translate('openBetaVersion')}{' '}
<CloseIcon icon={'close'} onClick={() => setBannerOpen(false)} />
</Banner>
)}
</Wrapper>
)
<Wrapper>
<ColMiddle>
<MenuStyled connected={connected} />
<Content>{children}</Content>
<Footer />
</ColMiddle>
{bannerOpen && (
<Banner>
{translate('openBetaVersion')}{' '}
<CloseIcon icon={'close'} onClick={() => setBannerOpen(false)} />
</Banner>
)}
</Wrapper>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ export const LoadingSmallView = ({ ...otherProps }: Props) => {
const { translate } = useMultiLanguage();

return (
translate && (
<Wrapper {...otherProps}>
<LoadingSpinner icon="spinner" pulse />
<LoadingText>{translate('loading')}</LoadingText>
</Wrapper>
)
<Wrapper {...otherProps}>
<LoadingSpinner icon="spinner" pulse />
<LoadingText>{translate('loading')}</LoadingText>
</Wrapper>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,30 @@ export const AccountAddressView = ({
const { translate } = useMultiLanguage();

return (
translate && (
<>
<>
<PopperTooltip
content={translate('copied')}
closeTrigger="click"
placement={placement}
>
<PopperTooltip
content={translate('copied')}
closeTrigger="click"
content={translate('copyToClipboard')}
closeTrigger="hover"
placement={placement}
>
<PopperTooltip
content={translate('copyToClipboard')}
closeTrigger="hover"
placement={placement}
<Wrapper
iconRight="clone"
onClick={handleAddressClick}
backgroundTransparent
>
<Wrapper
iconRight="clone"
onClick={handleAddressClick}
backgroundTransparent
>
{full
? starkName ?? address
: starkName
? shortenDomain(starkName)
: shortenAddress(address)}
</Wrapper>
</PopperTooltip>
{full
? starkName ?? address
: starkName
? shortenDomain(starkName)
: shortenAddress(address)}
</Wrapper>
</PopperTooltip>
</>
)
</PopperTooltip>
</>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,18 @@ export const DropDownView = ({
const { translate } = useMultiLanguage();

return (
translate && (
<Wrapper>
<Label error={error}>{label}</Label>
<DropdownStyled
error={error}
disabled={disabled}
options={options}
value={value}
placeholder={translate('selectAnOption')}
{...otherProps}
/>
<Wrapper>
<Label error={error}>{label}</Label>
<DropdownStyled
error={error}
disabled={disabled}
options={options}
value={value}
placeholder={translate('selectAnOption')}
{...otherProps}
/>

{helperText && <HelperText>{helperText}</HelperText>}
</Wrapper>
)
{helperText && <HelperText>{helperText}</HelperText>}
</Wrapper>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -79,39 +79,37 @@ export const TransactionListItemView = ({ transaction }: Props) => {
const txnToFromLabel = '';
const txnFailureReason = getTxnFailureReason(transaction);
return (
translate && (
<Wrapper
onClick={() =>
openExplorerTab(transaction.txnHash, 'tx', transaction.chainId)
}
>
<Left>
<LeftIcon>
<IconStyled transactionname={txnName} icon={getIcon(txnName)} />
</LeftIcon>
<Column>
<Label>{translate(toCamelCase(txnName))}</Label>
<Description>
{txnDate}
<br />
<Status status={transaction.executionStatus}>
{txnStatus}
{txnFailureReason}
</Status>
</Description>
</Column>
</Left>
<Middle>{txnToFromLabel} </Middle>
<Right>
{txnName === 'Send' && (
<AssetQuantity
currency={currencySymbol}
currencyValue={txnValue}
USDValue={txnUsdValue}
/>
)}
</Right>
</Wrapper>
)
<Wrapper
onClick={() =>
openExplorerTab(transaction.txnHash, 'tx', transaction.chainId)
}
>
<Left>
<LeftIcon>
<IconStyled transactionname={txnName} icon={getIcon(txnName)} />
</LeftIcon>
<Column>
<Label>{translate(toCamelCase(txnName))}</Label>
<Description>
{txnDate}
<br />
<Status status={transaction.executionStatus}>
{txnStatus}
{txnFailureReason}
</Status>
</Description>
</Column>
</Left>
<Middle>{txnToFromLabel} </Middle>
<Right>
{txnName === 'Send' && (
<AssetQuantity
currency={currencySymbol}
currencyValue={txnValue}
USDValue={txnUsdValue}
/>
)}
</Right>
</Wrapper>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,34 @@ export const AccountDetailsModalView = ({ address }: Props) => {

const chainId = networks?.items[networks.activeNetwork]?.chainId;
return (
translate && (
<div>
<AccountImageDiv>
<AccountImageStyled size={64} address={address} />
</AccountImageDiv>
<Wrapper>
<TitleDiv>
<Title>{translate('myAccount')}</Title>
{/* <ModifyIcon /> */}
</TitleDiv>
<AddressQrCode value={address} />
<AddressCopy address={address} />
</Wrapper>
<ButtonDiv>
<ButtonStyled
backgroundTransparent
borderVisible
onClick={() => openExplorerTab(address, 'contract', chainId)}
>
{translate('viewOnExplorer').toUpperCase()}
</ButtonStyled>
<ButtonStyled
backgroundTransparent
borderVisible
onClick={() => getPrivateKeyFromAddress(address, chainId)}
>
{translate('exportPrivateKey')}
</ButtonStyled>
</ButtonDiv>
</div>
)
<div>
<AccountImageDiv>
<AccountImageStyled size={64} address={address} />
</AccountImageDiv>
<Wrapper>
<TitleDiv>
<Title>{translate('myAccount')}</Title>
{/* <ModifyIcon /> */}
</TitleDiv>
<AddressQrCode value={address} />
<AddressCopy address={address} />
</Wrapper>
<ButtonDiv>
<ButtonStyled
backgroundTransparent
borderVisible
onClick={() => openExplorerTab(address, 'contract', chainId)}
>
{translate('viewOnExplorer').toUpperCase()}
</ButtonStyled>
<ButtonStyled
backgroundTransparent
borderVisible
onClick={() => getPrivateKeyFromAddress(address, chainId)}
>
{translate('exportPrivateKey')}
</ButtonStyled>
</ButtonDiv>
</div>
);
};
Loading

0 comments on commit e83661a

Please sign in to comment.