Skip to content

Commit

Permalink
fix: extract expression to a variable
Browse files Browse the repository at this point in the history
  • Loading branch information
DiogoSoaress committed Oct 30, 2024
1 parent d708139 commit 11c563c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/Wallet/VerticalSlide/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ import BracketRight from '@/public/images/Wallet/VerticalSlide/bracket-right.svg
import layoutCss from '@/components/common/styles.module.css'
import css from './styles.module.css'

const icons = [<RecoveryIcon key="recovery" />, <ScanIcon key="scan" />, <MultipleKeysIcon key="multiple-keys" />]

const VerticalSlide = ({ title, items = [] }: BaseBlock) => {
const [selectedIndex, setSelectedIndex] = useState(0)

const itemsImages = items.map((item) => item.image)
const icons = [<RecoveryIcon key="recovery" />, <ScanIcon key="scan" />, <MultipleKeysIcon key="multiple-keys" />]
const selectedImage = itemsImages[selectedIndex]

const handleCardClick = (index: number) => {
setSelectedIndex(index)
Expand Down Expand Up @@ -46,9 +48,7 @@ const VerticalSlide = ({ title, items = [] }: BaseBlock) => {
<BracketRight />
</div>

{itemsImages[selectedIndex] ? (
<img src={itemsImages[selectedIndex].src} alt={itemsImages[selectedIndex].alt} className={css.image} />
) : null}
{selectedImage ? <img src={selectedImage.src} alt={selectedImage.alt} className={css.image} /> : null}
</Grid>

<Grid item xs={12} md={5}>
Expand Down

0 comments on commit 11c563c

Please sign in to comment.