This commit is contained in:
amirhouieh 2023-05-14 11:57:00 +02:00 committed by Jinho Jang
parent 68891f0135
commit 53d6422006
3 changed files with 16 additions and 3 deletions

View File

@ -31,7 +31,6 @@ const ArticleFooter = ({ data }: { data: ArticlePostData }) => {
const ArticleFooterContainer = styled.div` const ArticleFooterContainer = styled.div`
margin-top: 16px; margin-top: 16px;
& > div:not(:first-child) > div > button { & > div:not(:first-child) > div > button {
border-top: none; border-top: none;
} }

View File

@ -1,3 +1,4 @@
import React from 'react'
import { Typography } from '@acid-info/lsd-react' import { Typography } from '@acid-info/lsd-react'
import { CommonProps } from '@acid-info/lsd-react/dist/utils/useCommonProps' import { CommonProps } from '@acid-info/lsd-react/dist/utils/useCommonProps'
import styled from '@emotion/styled' import styled from '@emotion/styled'
@ -124,7 +125,7 @@ export default function Post({
const _thumbnail = useMemo(() => { const _thumbnail = useMemo(() => {
if (!showImage || !coverImage) return null if (!showImage || !coverImage) return null
if (postType === 'body') { if (postType === PostType.BODY) {
return <ResponsiveImage {...imageProps} data={coverImage} /> return <ResponsiveImage {...imageProps} data={coverImage} />
} else { } else {
// TBD // TBD

View File

@ -5,9 +5,15 @@ import styled from '@emotion/styled'
import Post, { PostDataProps } from '../Post/Post' import Post, { PostDataProps } from '../Post/Post'
import { Button, Typography } from '@acid-info/lsd-react' import { Button, Typography } from '@acid-info/lsd-react'
enum Layout {
XXXX = 'xxxx',
XXXX_XX = 'xxxx_xx',
}
type Props = { type Props = {
posts: PostDataProps[] posts: PostDataProps[]
pageSize?: number pageSize?: number
layout?: Layout
} }
const getGridItemWidth = (index: number) => { const getGridItemWidth = (index: number) => {
@ -45,7 +51,14 @@ export const PostsList = (props: Props) => {
<Grid style={{ minHeight: '500px' }}> <Grid style={{ minHeight: '500px' }}>
{postsToShow.length > 0 ? ( {postsToShow.length > 0 ? (
postsToShow.map((post, index) => ( postsToShow.map((post, index) => (
<GridItem className="w-4" key={index}> <GridItem
className={
props.layout === Layout.XXXX_XX
? getGridItemWidth(index)
: 'w-4'
}
key={index}
>
<PostLink href={`/article/${post.slug}`}> <PostLink href={`/article/${post.slug}`}>
<PostWrapper> <PostWrapper>
<Post data={post} /> <Post data={post} />