Skip to content

Commit

Permalink
Merge pull request #204 from themoment-team/feature/postContentImage
Browse files Browse the repository at this point in the history
[Client] Update postDetail image size
  • Loading branch information
frorong committed Aug 20, 2023
2 parents fd8d232 + db25830 commit d08c238
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const AssembledPost: React.FC<AssembledPostProps> = ({ postSeq, post }) => {
}
>
<PostDetailHead postSeq={postSeq} />
{data.postContent && (
{(data.postContent || data.fileInfo.length > 0) && (
<S.ContentWrapper>
<PostContent postSeq={postSeq} />
{data.fileInfo.length > 0 && (
Expand Down
4 changes: 1 addition & 3 deletions apps/client/src/components/PostPage/PostContent/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
'use client';

import Image from 'next/image';

import { useGetPostDetail } from 'api/client';

import { filterImages } from 'common';
Expand All @@ -23,7 +21,7 @@ const PostContent: React.FC<PostContentProps> = ({ postSeq }) => {
<S.ContentWrapper>
{imageFiles.map((file, index) => (
<S.ImageWrapper key={index}>
<Image src={file.fileUrl} alt={file.fileName} fill />
<S.ContentImage src={file.fileUrl} alt={file.fileName} fill />
</S.ImageWrapper>
))}
<S.ContentText>{data?.postContent}</S.ContentText>
Expand Down
7 changes: 6 additions & 1 deletion apps/client/src/components/PostPage/PostContent/style.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Image from 'next/image';

import styled from '@emotion/styled';

export const ContentWrapper = styled.div`
Expand All @@ -11,9 +13,12 @@ export const ContentWrapper = styled.div`
}
`;

export const ContentImage = styled(Image)`
position: relative !important;
`;

export const ImageWrapper = styled.div`
width: 50rem;
height: 30.375rem;
overflow: hidden;
position: relative;
img {
Expand Down

3 comments on commit d08c238

@vercel
Copy link

@vercel vercel bot commented on d08c238 Aug 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on d08c238 Aug 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on d08c238 Aug 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.