diff --git a/frontend/src/components/host/SectionDetailModal/styles.ts b/frontend/src/components/host/SectionDetailModal/styles.ts index e25b1dd7..28cb97c1 100644 --- a/frontend/src/components/host/SectionDetailModal/styles.ts +++ b/frontend/src/components/host/SectionDetailModal/styles.ts @@ -38,6 +38,9 @@ const image = css` margin-top: 8px; cursor: pointer; border-radius: 8px; + height: 240px; + max-height: 240px; + object-fit: cover; `; const description = css` diff --git a/frontend/src/components/user/DetailInfoModal/index.tsx b/frontend/src/components/user/DetailInfoModal/index.tsx index 884c4766..49577dfc 100644 --- a/frontend/src/components/user/DetailInfoModal/index.tsx +++ b/frontend/src/components/user/DetailInfoModal/index.tsx @@ -12,19 +12,13 @@ export interface DetailInfoModalProps { description: string; } -const getImageUrl = (url: string): string => { - return url === '' ? homeCover_fallback : url; -}; - const DetailInfoModal: React.FC = ({ name, imageUrl, description }) => { return (

{name}

-
- -
+
{imageUrl !== '' && }
{description}
diff --git a/frontend/src/components/user/DetailInfoModal/styles.ts b/frontend/src/components/user/DetailInfoModal/styles.ts index 18e44a5b..e0269ef8 100644 --- a/frontend/src/components/user/DetailInfoModal/styles.ts +++ b/frontend/src/components/user/DetailInfoModal/styles.ts @@ -5,6 +5,7 @@ import theme from '@/styles/theme'; const container = css` max-width: 400px; min-width: 320px; + max-height: 400px; width: 80%; background-color: ${theme.colors.white}; display: flex; @@ -29,7 +30,8 @@ const imageWrapper = css` const image = css` width: 100%; - height: 100%; + height: 240px; + max-height: 240px; object-fit: cover; `; diff --git a/frontend/src/components/user/SectionCard/SectionInfoPreview/index.tsx b/frontend/src/components/user/SectionCard/SectionInfoPreview/index.tsx index f349c605..01c9e509 100644 --- a/frontend/src/components/user/SectionCard/SectionInfoPreview/index.tsx +++ b/frontend/src/components/user/SectionCard/SectionInfoPreview/index.tsx @@ -10,11 +10,11 @@ interface SectionInfoPreviewProps { } const SectionInfoPreview: React.FC = ({ imageUrl, onClick }) => { + const isImage = imageUrl !== ''; + return (
-
- -
+
{isImage && }
); diff --git a/frontend/src/components/user/SectionCard/SectionInfoPreview/styles.ts b/frontend/src/components/user/SectionCard/SectionInfoPreview/styles.ts index 1c614d8a..b18d5212 100644 --- a/frontend/src/components/user/SectionCard/SectionInfoPreview/styles.ts +++ b/frontend/src/components/user/SectionCard/SectionInfoPreview/styles.ts @@ -7,12 +7,13 @@ const wrapper = css` cursor: pointer; `; -const imageWrapper = css` +const imageWrapper = (isImage: boolean) => css` width: 56px; height: 40px; overflow: hidden; border-radius: 8px; box-shadow: 2px 2px 4px 0px ${theme.colors.gray500}; + background-color: ${!isImage && theme.colors.skyblue200}; `; const image = css` diff --git a/frontend/src/components/user/SectionCard/index.tsx b/frontend/src/components/user/SectionCard/index.tsx index d6f10377..86d16159 100644 --- a/frontend/src/components/user/SectionCard/index.tsx +++ b/frontend/src/components/user/SectionCard/index.tsx @@ -9,8 +9,6 @@ import useModal from '@/hooks/useModal'; import { ID, SectionType, TaskType } from '@/types'; -import homeCover_fallback from '@/assets/homeCover-fallback.png'; - import styles from './styles'; type SectionCardProps = { @@ -21,10 +19,6 @@ type SectionCardProps = { flipTaskCheck: any; }; -const getImageUrl = (url: string): string => { - return url === '' ? homeCover_fallback : url; -}; - const SectionCard: React.FC = ({ section, sectionsAllCheckMap, @@ -58,10 +52,7 @@ const SectionCard: React.FC = ({ )} {(section.imageUrl || section.description) && ( - onClickSectionDetail(section)} - /> + onClickSectionDetail(section)} /> )}