From d5eeac50a6628b1be754909aa17bee07543df29d Mon Sep 17 00:00:00 2001 From: Yossi Saadi Date: Tue, 8 Oct 2024 18:21:14 +0300 Subject: [PATCH] feat(ModalMediaLayout): change component name --- .../ModalMediaLayout.module.scss} | 8 ++++---- .../ModalMediaLayout.tsx} | 12 ++++++------ .../ModalMediaLayout.types.ts} | 2 +- packages/core/src/tests/constants.ts | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) rename packages/core/src/components/ModalNew/layouts/{ModalHeroLayout/ModalHeroLayout.module.scss => ModalMediaLayout/ModalMediaLayout.module.scss} (72%) rename packages/core/src/components/ModalNew/layouts/{ModalHeroLayout/ModalHeroLayout.tsx => ModalMediaLayout/ModalMediaLayout.tsx} (78%) rename packages/core/src/components/ModalNew/layouts/{ModalHeroLayout/ModalHeroLayout.types.ts => ModalMediaLayout/ModalMediaLayout.types.ts} (62%) diff --git a/packages/core/src/components/ModalNew/layouts/ModalHeroLayout/ModalHeroLayout.module.scss b/packages/core/src/components/ModalNew/layouts/ModalMediaLayout/ModalMediaLayout.module.scss similarity index 72% rename from packages/core/src/components/ModalNew/layouts/ModalHeroLayout/ModalHeroLayout.module.scss rename to packages/core/src/components/ModalNew/layouts/ModalMediaLayout/ModalMediaLayout.module.scss index 450d119f81..7c3115cdac 100644 --- a/packages/core/src/components/ModalNew/layouts/ModalHeroLayout/ModalHeroLayout.module.scss +++ b/packages/core/src/components/ModalNew/layouts/ModalMediaLayout/ModalMediaLayout.module.scss @@ -5,19 +5,19 @@ .media { width: 100%; - height: var(--modal-hero-height, 240px); + height: var(--modal-top-media-height, 240px); flex-shrink: 0; @media (min-width: 1280px) { - --modal-hero-height: 260px; + --modal-top-media-height: 260px; } @media (min-width: 1440px) { - --modal-hero-height: 260px; + --modal-top-media-height: 260px; } @media (min-width: 1720px) { - --modal-hero-height: 320px; + --modal-top-media-height: 320px; } } diff --git a/packages/core/src/components/ModalNew/layouts/ModalHeroLayout/ModalHeroLayout.tsx b/packages/core/src/components/ModalNew/layouts/ModalMediaLayout/ModalMediaLayout.tsx similarity index 78% rename from packages/core/src/components/ModalNew/layouts/ModalHeroLayout/ModalHeroLayout.tsx rename to packages/core/src/components/ModalNew/layouts/ModalMediaLayout/ModalMediaLayout.tsx index 06c0e58ee7..e11a792264 100644 --- a/packages/core/src/components/ModalNew/layouts/ModalHeroLayout/ModalHeroLayout.tsx +++ b/packages/core/src/components/ModalNew/layouts/ModalMediaLayout/ModalMediaLayout.tsx @@ -2,13 +2,13 @@ import React, { forwardRef } from "react"; import cx from "classnames"; import { getTestId } from "../../../../tests/test-ids-utils"; import { ComponentDefaultTestId } from "../../../../tests/constants"; -import styles from "./ModalHeroLayout.module.scss"; -import { ModalHeroLayoutProps } from "./ModalHeroLayout.types"; +import styles from "./ModalMediaLayout.module.scss"; +import { ModalMediaLayoutProps } from "./ModalMediaLayout.types"; import Flex from "../../../Flex/Flex"; -const ModalHeroLayout = forwardRef( +const ModalMediaLayout = forwardRef( ( - { children, className, id, "data-testid": dataTestId }: ModalHeroLayoutProps, + { children, className, id, "data-testid": dataTestId }: ModalMediaLayoutProps, ref: React.ForwardedRef ) => { const [media, header, content] = React.Children.toArray(children); @@ -20,7 +20,7 @@ const ModalHeroLayout = forwardRef( align={Flex.align.START} className={cx(styles.layout, className)} id={id} - data-testid={dataTestId || getTestId(ComponentDefaultTestId.MODAL_NEXT_HERO_LAYOUT, id)} + data-testid={dataTestId || getTestId(ComponentDefaultTestId.MODAL_NEXT_MEDIA_LAYOUT, id)} >
{media}
{header}
@@ -30,4 +30,4 @@ const ModalHeroLayout = forwardRef( } ); -export default ModalHeroLayout; +export default ModalMediaLayout; diff --git a/packages/core/src/components/ModalNew/layouts/ModalHeroLayout/ModalHeroLayout.types.ts b/packages/core/src/components/ModalNew/layouts/ModalMediaLayout/ModalMediaLayout.types.ts similarity index 62% rename from packages/core/src/components/ModalNew/layouts/ModalHeroLayout/ModalHeroLayout.types.ts rename to packages/core/src/components/ModalNew/layouts/ModalMediaLayout/ModalMediaLayout.types.ts index 262147c224..3d9481f36f 100644 --- a/packages/core/src/components/ModalNew/layouts/ModalHeroLayout/ModalHeroLayout.types.ts +++ b/packages/core/src/components/ModalNew/layouts/ModalMediaLayout/ModalMediaLayout.types.ts @@ -1,6 +1,6 @@ import React from "react"; import { VibeComponentProps } from "../../../../types"; -export interface ModalHeroLayoutProps extends VibeComponentProps { +export interface ModalMediaLayoutProps extends VibeComponentProps { children: React.ReactNode; } diff --git a/packages/core/src/tests/constants.ts b/packages/core/src/tests/constants.ts index 8b38083b4c..742e3d1d17 100644 --- a/packages/core/src/tests/constants.ts +++ b/packages/core/src/tests/constants.ts @@ -110,7 +110,7 @@ export enum ComponentDefaultTestId { MODAL_NEXT_MEDIA = "modal-media", MODAL_NEXT_BASIC_LAYOUT = "modal-basic-layout", MODAL_NEXT_SIDE_BY_SIDE_LAYOUT = "modal-side_by_side-layout", - MODAL_NEXT_HERO_LAYOUT = "modal-hero-layout", + MODAL_NEXT_MEDIA_LAYOUT = "modal-media-layout", FORMATTED_NUMBER = "formatted-number", HIDDEN_TEXT = "hidden-text", DIALOG_CONTENT_CONTAINER = "dialog-content-container",