design: Change post layout and style

This commit is contained in:
jhynsoo 2023-10-17 00:15:34 +09:00
parent 566d8be8d9
commit fd1fcba2a0
4 changed files with 27 additions and 30 deletions

View File

@ -16,25 +16,21 @@ const PostDetail = () => {
return ( return (
<S.PostDetail> <S.PostDetail>
<PanelLayout>
<LeftPanel>
<Link <Link
className="product" className="product"
to={`${URL.product}/${data.product.id}`} to={`${URL.product}/${data.product.id}`}
> >
{data.product.name} {data.product.name}
</Link> </Link>
<time>{data.written_at}</time> <S.WrittenTime>{data.written_at}</S.WrittenTime>
<div className="storage">{data.storage}</div> <PanelLayout>
<div className="price">가격 {data.price.toLocaleString()}</div> <LeftPanel>
<p>{data.text}</p> <S.Text>{data.text}</S.Text>
<S.Price>가격 {data.price.toLocaleString()}</S.Price>
</LeftPanel> </LeftPanel>
<RightPanel> <RightPanel>
<SubTitle>제품 사진</SubTitle> <SubTitle>제품 사진</SubTitle>
<ImageViewer <ImageViewer images={data?.images?.map((image) => image.image)} />
images={data?.images?.map((image) => image.image)}
// title=" "
/>
<SubTitle>최근 거래 가격</SubTitle> <SubTitle>최근 거래 가격</SubTitle>
<ProductPriceGraph id={data.product.id} /> <ProductPriceGraph id={data.product.id} />
</RightPanel> </RightPanel>

View File

@ -11,22 +11,6 @@ export const PostDetail = styled.div`
font-weight: 600; font-weight: 600;
} }
time {
display: block;
margin-top: 4px;
font-size: 14px;
line-height: 1.5;
letter-spacing: 0;
color: ${({ theme }) => theme.colors.gray500};
}
.price {
margin-top: 8px;
font-size: 18px;
line-height: 1.7;
font-weight: bold;
}
p { p {
font-size: 16px; font-size: 16px;
} }
@ -40,3 +24,16 @@ export const WrittenTime = styled.time`
letter-spacing: 0; letter-spacing: 0;
color: ${({ theme }) => theme.colors.gray500}; color: ${({ theme }) => theme.colors.gray500};
`; `;
export const Text = styled.p`
font-size: 16px;
line-height: 1.7;
color: ${({ theme }) => theme.colors.gray900};
`;
export const Price = styled.div`
margin-top: 8px;
font-size: 18px;
line-height: 1.7;
font-weight: bold;
`;

View File

@ -3,6 +3,8 @@ import { styled } from 'styled-components';
export const PostItem = styled(Link)` export const PostItem = styled(Link)`
${({ theme }) => theme.boxShadow}; ${({ theme }) => theme.boxShadow};
${({ theme }) => theme.hoverBorder};
${({ theme }) => theme.activeTransform};
display: flex; display: flex;
align-items: center; align-items: center;
gap: 20px; gap: 20px;

View File

@ -3,6 +3,8 @@ import { styled } from 'styled-components';
export const ProductItem = styled(Link)` export const ProductItem = styled(Link)`
${({ theme }) => theme.boxShadow}; ${({ theme }) => theme.boxShadow};
${({ theme }) => theme.hoverBorder};
${({ theme }) => theme.activeTransform};
display: block; display: block;
padding: 16px; padding: 16px;
margin-bottom: 16px; margin-bottom: 16px;