Skip to content

Commit

Permalink
refactor: delete unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
jsapro committed Dec 24, 2023
1 parent 57919ef commit 99cf8d1
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 117 deletions.
53 changes: 0 additions & 53 deletions src/components/card-block-link/card-block-link.module.scss

This file was deleted.

25 changes: 0 additions & 25 deletions src/components/card-block-link/index.tsx

This file was deleted.

24 changes: 0 additions & 24 deletions src/components/card-catalog-link/card-catalog-link.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,30 +76,6 @@
}
}

.card-catalog-link__list-bento {
margin: 0;
padding: 0;
list-style: none;
gap: 20px;
display: grid;
grid-template-areas:
'a a b b c c'
'd d d e e e';
margin-bottom: 13px;

@media screen and (width <= 768px) {
grid-template-areas:
'a b'
'c d'
'e .';
gap: 4px;
}

&:last-of-type {
margin-bottom: 0;
}
}

.card-catalog-link__list-item {
margin: 0;
padding: 0;
Expand Down
18 changes: 3 additions & 15 deletions src/components/card-catalog-link/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable */
import CardBlockLink from '../card-block-link';
import clsx from 'clsx';
import ProductCard from '../product-card';
import styles from './card-catalog-link.module.scss';
Expand All @@ -10,7 +9,7 @@ type CardCatalogLinkProps = {
title: string;
category?: string;
array: Product[] | { title: string; link: string; backgroundImage: string }[];
type: 'bento-grid' | 'single-row';
type: 'single-row';
};

function CardCatalogLink({ title, array, type, category }: CardCatalogLinkProps) {
Expand All @@ -21,18 +20,14 @@ function CardCatalogLink({ title, array, type, category }: CardCatalogLinkProps)
styles[`card-catalog-link__title-container_type_${type}`]
}`}
>
<Link
to={`${type === 'bento-grid' ? '/catalog' : `/catalog/${category}`}`}
className={styles.link}
>
<Link to={`/catalog/${category}`} className={styles.link}>
<h2 className={styles['card-catalog-link__title']}>{title}</h2>
</Link>
<span className={styles['card-catalog-link__arrow']} />
</div>
<ul
className={clsx(
type === 'single-row' && styles['card-catalog-link__list-single'],
type === 'bento-grid' && styles['card-catalog-link__list-bento']
type === 'single-row' && styles['card-catalog-link__list-single']
)}
>
{array.map((item: Record<string, any>, index: number) => (
Expand All @@ -41,13 +36,6 @@ function CardCatalogLink({ title, array, type, category }: CardCatalogLinkProps)
key={index}
style={{ gridArea: item.gridArea }}
>
{type === 'bento-grid' && (
<CardBlockLink
title={item.title}
link={item.link}
backgroundImage={item.backgroundImage}
/>
)}
{type === 'single-row' && (
<ProductCard
cardName={item.name}
Expand Down

0 comments on commit 99cf8d1

Please sign in to comment.