From 46e5da4042cf0337111d4a5fef47f90427c141b4 Mon Sep 17 00:00:00 2001 From: ansivgit Date: Thu, 13 Jun 2024 17:02:38 +0300 Subject: [PATCH 1/2] fix: 263 - remove buttons block --- src/features/home/hero/hero.scss | 33 ---------------------------- src/features/home/hero/hero.test.tsx | 17 -------------- src/features/home/hero/hero.tsx | 24 -------------------- 3 files changed, 74 deletions(-) diff --git a/src/features/home/hero/hero.scss b/src/features/home/hero/hero.scss index adf4035fa..1127f033b 100644 --- a/src/features/home/hero/hero.scss +++ b/src/features/home/hero/hero.scss @@ -99,39 +99,6 @@ padding: 0 0 0 24px; } } - - & > .tags-container { - @include media-tablet { - flex-direction: column; - align-items: flex-start; - padding: 0; - } - - @include media-mobile { - padding: 0; - } - - display: flex; - flex-direction: row; - align-items: center; - justify-content: space-between; - - width: max-content; - padding: 0 0 0 24px; - - & .tag-container { - @include media-tablet { - margin-top: 16px; - } - - display: flex; - align-items: center; - } - } - - & .tag-divider { - margin: 0 8px; - } } .description-title { diff --git a/src/features/home/hero/hero.test.tsx b/src/features/home/hero/hero.test.tsx index e18c6e7c7..318568789 100644 --- a/src/features/home/hero/hero.test.tsx +++ b/src/features/home/hero/hero.test.tsx @@ -21,21 +21,4 @@ describe('Hero', () => { const descTitle = screen.getByText('Connecting people, growing together, having fun'); expect(descTitle).toBeVisible(); }); - - it('renders three tags', () => { - renderWithRouter(); - const tags = screen.getAllByRole('link'); - expect(tags.length).toBe(3); - }); - - it('renders the correct tag labels', () => { - renderWithRouter(); - const tag1 = screen.getByRole('link', { name: /education/i }); - const tag2 = screen.getByRole('link', { name: /events & meetups/i }); - const tag3 = screen.getByRole('link', { name: /community building/i }); - - expect(tag1).toBeInTheDocument(); - expect(tag2).toBeInTheDocument(); - expect(tag3).toBeInTheDocument(); - }); }); diff --git a/src/features/home/hero/hero.tsx b/src/features/home/hero/hero.tsx index d092957f8..417a3aa24 100644 --- a/src/features/home/hero/hero.tsx +++ b/src/features/home/hero/hero.tsx @@ -1,19 +1,5 @@ -import { TagDivider } from './tag-divider'; -import { LinkCustom } from '@/app/components'; - import './hero.scss'; -interface TagProps { - id: string; - label: string; -} - -const tags: TagProps[] = [ - { id: 'school', label: 'education' }, - { id: 'events', label: 'events & meetups' }, - { id: 'community', label: 'community building' }, -]; - export const Hero = () => { return (
@@ -27,16 +13,6 @@ export const Hero = () => {

Connecting people, growing together, having fun

-
- {tags.map(({ id, label }, index) => ( -
- - {label} - - {index !== tags?.length - 1 && } -
- ))} -
); From e88d2a1bd347a7f5e2d4503d6c7baf3cb7adc33e Mon Sep 17 00:00:00 2001 From: ansivgit Date: Fri, 14 Jun 2024 18:35:28 +0300 Subject: [PATCH 2/2] fix: 263 - remove unused code --- src/features/home/hero/tag-divider/index.ts | 1 - .../home/hero/tag-divider/tag-divider.scss | 31 ------------------- .../hero/tag-divider/tag-divider.test.tsx | 17 ---------- .../home/hero/tag-divider/tag-divider.tsx | 7 ----- 4 files changed, 56 deletions(-) delete mode 100644 src/features/home/hero/tag-divider/index.ts delete mode 100644 src/features/home/hero/tag-divider/tag-divider.scss delete mode 100644 src/features/home/hero/tag-divider/tag-divider.test.tsx delete mode 100644 src/features/home/hero/tag-divider/tag-divider.tsx diff --git a/src/features/home/hero/tag-divider/index.ts b/src/features/home/hero/tag-divider/index.ts deleted file mode 100644 index 1b35a7bf3..000000000 --- a/src/features/home/hero/tag-divider/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { TagDivider } from './tag-divider'; diff --git a/src/features/home/hero/tag-divider/tag-divider.scss b/src/features/home/hero/tag-divider/tag-divider.scss deleted file mode 100644 index 3b0c2affc..000000000 --- a/src/features/home/hero/tag-divider/tag-divider.scss +++ /dev/null @@ -1,31 +0,0 @@ -.tag-divider { - @include media-tablet { - display: none; - } - - position: relative; - - overflow: visible; - display: flex; - align-items: center; - justify-content: center; - - width: 24px; - height: 24px; - - vertical-align: middle; - - border-radius: 0; - - & .label { - position: absolute; - top: 5px; - - font-size: 24px; - font-weight: 500; - font-style: normal; - line-height: 24px; - color: $color-red; - letter-spacing: 0; - } -} diff --git a/src/features/home/hero/tag-divider/tag-divider.test.tsx b/src/features/home/hero/tag-divider/tag-divider.test.tsx deleted file mode 100644 index 9d53a10ed..000000000 --- a/src/features/home/hero/tag-divider/tag-divider.test.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import { describe, expect, it } from 'vitest'; -import { TagDivider } from './tag-divider'; - -describe('TagDivider', () => { - it('renders correctly', () => { - render(); - const dividerElement = screen.getByText('*'); - expect(dividerElement).toBeInTheDocument(); - }); - - it('has the correct class name', () => { - render(); - const dividerElement = screen.getByText('*'); - expect(dividerElement.parentElement).toHaveClass('tag-divider'); - }); -}); diff --git a/src/features/home/hero/tag-divider/tag-divider.tsx b/src/features/home/hero/tag-divider/tag-divider.tsx deleted file mode 100644 index 34dd8b8e1..000000000 --- a/src/features/home/hero/tag-divider/tag-divider.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import './tag-divider.scss'; - -export const TagDivider = () => ( -
- * -
-);