Skip to content

Commit

Permalink
Fix eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mike10ca committed Nov 13, 2023
1 parent 14efbc9 commit 470d4cd
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 9 deletions.
6 changes: 4 additions & 2 deletions src/components/common/ModalDialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export const ModalDialogTitle = ({ children, onClose, hideChainIndicator = false
<span style={{ flex: 1 }} />
{!hideChainIndicator && <ChainIndicator inline />}
{onClose ? (
<IconButton data-testid="modal-dialog-close-btn"
<IconButton
data-testid="modal-dialog-close-btn"
aria-label="close"
onClick={(e) => {
onClose(e, 'backdropClick')
Expand Down Expand Up @@ -55,7 +56,8 @@ const ModalDialog = ({
const isFullScreen = fullScreen || isSmallScreen

return (
<Dialog data-testid="modal-view"
<Dialog
data-testid="modal-view"
{...restProps}
fullScreen={isFullScreen}
scroll={fullScreen ? 'paper' : 'body'}
Expand Down
16 changes: 14 additions & 2 deletions src/components/nfts/NftGrid/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,15 @@ const headCells = [
const stopPropagation = (e: SyntheticEvent) => e.stopPropagation()

const NftIndicator = ({ color }: { color: SvgIconProps['color'] }) => (
<SvgIcon data-testid={`nft-icon-${color}`} component={NftIcon} inheritViewBox width={20} height={20} color={color} sx={{ ml: 0.25 }} />
<SvgIcon
data-testid={`nft-icon-${color}`}
component={NftIcon}
inheritViewBox
width={20}
height={20}
color={color}
sx={{ ml: 0.25 }}
/>
)

const activeNftIcon = <NftIndicator color="primary" />
Expand Down Expand Up @@ -233,7 +241,11 @@ const NftGrid = ({

{/* Checkbox */}
<TableCell align="right">
<Checkbox data-testid={`nft-checkbox-${index + 1}`} checked={selectedNfts.includes(item)} onChange={(e) => onCheckboxClick(e, item)} />
<Checkbox
data-testid={`nft-checkbox-${index + 1}`}
checked={selectedNfts.includes(item)}
onChange={(e) => onCheckboxClick(e, item)}
/>

{/* Insert the children at the end of the table */}
{index === filteredNfts.length - 1 && children}
Expand Down
3 changes: 2 additions & 1 deletion src/components/nfts/NftSendForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ const NftSendForm = ({ selectedNfts }: NftSendFormProps): ReactElement => {
<Grid item>
<CheckWallet>
{(isOk) => (
<Button data-testid={`nft-send-btn-${!isOk || noSelected}`}
<Button
data-testid={`nft-send-btn-${!isOk || noSelected}`}
type="submit"
variant="contained"
size="small"
Expand Down
15 changes: 13 additions & 2 deletions src/components/tx-flow/common/TxLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,13 @@ const TxLayout = ({
{/* Main content */}
<Grid item xs={12} md={7}>
<div className={css.titleWrapper}>
<Typography data-testid="modal-title" variant="h3" component="div" fontWeight="700" className={css.title}>
<Typography
data-testid="modal-title"
variant="h3"
component="div"
fontWeight="700"
className={css.title}
>
{title}
</Typography>

Expand All @@ -128,7 +134,12 @@ const TxLayout = ({
{steps[step]}

{onBack && step > 0 && (
<Button data-testid="modal-back-btn" variant="contained" onClick={onBack} className={css.backButton}>
<Button
data-testid="modal-back-btn"
variant="contained"
onClick={onBack}
className={css.backButton}
>
Back
</Button>
)}
Expand Down
19 changes: 17 additions & 2 deletions src/components/tx-flow/flows/NftTransfer/SendNftBatch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@ const NftItem = ({ image, name, description }: { image: string; name: string; de
</Grid>

<Grid item overflow="hidden">
<Typography data-testid="nft-item-name" variant="body2" fontWeight={700} whiteSpace="nowrap" overflow="hidden" textOverflow="ellipsis">
<Typography
data-testid="nft-item-name"
variant="body2"
fontWeight={700}
whiteSpace="nowrap"
overflow="hidden"
textOverflow="ellipsis"
>
{name}
</Typography>

Expand All @@ -59,7 +66,15 @@ const NftItem = ({ image, name, description }: { image: string; name: string; de

export const NftItems = ({ tokens }: { tokens: SafeCollectibleResponse[] }) => {
return (
<Box data-testid="nft-item-list" display="flex" flexDirection="column" gap={2} overflow="auto" maxHeight="20vh" minHeight="40px">
<Box
data-testid="nft-item-list"
display="flex"
flexDirection="column"
gap={2}
overflow="auto"
maxHeight="20vh"
minHeight="40px"
>
{tokens.map((token) => (
<NftItem
key={`${token.address}-${token.id}`}
Expand Down

0 comments on commit 470d4cd

Please sign in to comment.