Skip to content

Commit d4baa19

Browse files
committed
feat: Adjust feed item styles.
1 parent 0fd4bbc commit d4baa19

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/fluffy-balloons-chew.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"xlog": patch
3+
---
4+
5+
Adjust feed item styles.

src/components/FeedList/FeedListItem/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export interface Props {
2828
}
2929

3030
const minHeight = 150;
31+
const maxHeight = 250;
3132
const defaultCoverImageHeight = minHeight;
3233

3334
export const FeedListItem: FC<Props> = (props) => {
@@ -48,7 +49,7 @@ export const FeedListItem: FC<Props> = (props) => {
4849

4950
const relativeHeight = useMemo(() => {
5051
const ratio = coverImageSize.width / coverImageSize.height;
51-
const _height = Math.max(width / ratio, minHeight);
52+
const _height = Math.min(Math.max(width / ratio, minHeight), maxHeight);
5253
return isNaN(_height) ? defaultCoverImageHeight : _height;
5354
}, [coverImageSize.height]);
5455

0 commit comments

Comments
 (0)