Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
DiogoSoaress committed Aug 29, 2024
1 parent 8c9b91f commit a9eea1d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions src/components/Wallet/VerticalSlide/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { useEffect, useState } from 'react'
import { ButtonBase, Container, Grid, Typography } from '@mui/material'
import RichText from '@/components/common/RichText'
import { isAsset, isEntryTypeBaseBlock } from '@/lib/typeGuards'
import { isEntryTypeBaseBlock } from '@/lib/typeGuards'
import type { BaseBlockEntry } from '@/config/types'
import layoutCss from '@/components/common/styles.module.css'
import css from './styles.module.css'
import { extractContentfulImageProps } from '@/lib/contentful/extractContentfulImageProps'

const VerticalSlide = (props: BaseBlockEntry) => {
const [selectedIndex, setSelectedIndex] = useState(0)
Expand All @@ -27,6 +28,8 @@ const VerticalSlide = (props: BaseBlockEntry) => {
return () => clearInterval(interval) // Cleanup interval on component unmount
}, [itemsList.length])

const imageProps = extractContentfulImageProps(itemsImages[selectedIndex])

return (
<Container className={layoutCss.containerShort}>
<div className={css.title}>
Expand All @@ -36,12 +39,7 @@ const VerticalSlide = (props: BaseBlockEntry) => {
<Grid container spacing="40px" justifyContent="flex-end">
<Grid item md={7} className={css.imageItem}>
<div className={css.imageWrapper}>
{isAsset(itemsImages[selectedIndex]) && itemsImages[selectedIndex].fields.file?.url ? (
<img
src={itemsImages[selectedIndex].fields.file.url}
alt={itemsImages[selectedIndex].fields.title ?? ''}
/>
) : null}
{imageProps ? <img src={imageProps.src} alt={imageProps.alt} /> : null}
</div>
</Grid>

Expand Down
2 changes: 1 addition & 1 deletion src/components/common/LinkCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const LinkCard = ({ caption, title, image, link, icon, highlight }: CardProps) =
<div className={`${css.card} ${highlight ? css.highlight : css.outline}`}>
<div className={css.cardHeader}>
{caption ? <Typography variant="caption">{caption}</Typography> : undefined}
{image ? <img src={image.src || ''} alt={image.alt || 'card icon'} /> : icon ?? undefined}
{image ? <img src={image.src} alt={image.alt || 'card icon'} /> : icon ?? undefined}
</div>

<div className={css.cardBody}>
Expand Down

0 comments on commit a9eea1d

Please sign in to comment.