-
Notifications
You must be signed in to change notification settings - Fork 264
feat: card ui revamp #4630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: card ui revamp #4630
Changes from 54 commits
3850872
9eb8004
e76dd16
c0cb4e4
245dbd8
265295c
6ae5830
52a0026
7de087b
5e317cc
1009246
4cc9533
a4c5fdf
b2973a2
82ebb5b
dc647e5
396a613
027be4b
27c4373
0f03059
fc08427
2d481b0
656cce9
1a4cfea
2bff747
3f2fb01
eccf531
69f204e
685237b
776bb18
ce0e928
c92ca0e
5f5ffd5
1668770
587042e
d80d26e
9dce573
1e456bb
9906886
e46f8b1
92d74fe
8ba812a
a4cef7f
0a422df
6ff889a
07fde4d
2f6ac75
40ed0f3
c987690
49492bc
7981c96
1be3ad8
3398e01
9eef02b
6038392
54e5fb9
efe8404
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,8 @@ import { useSmartTitle } from '../../../hooks/post/useSmartTitle'; | |
import useInteractiveFeed from '../../../hooks/feed/useInteractiveFeed'; | ||
import RelevancyTag from '../../tags/RelevancyTag'; | ||
import InteractiveFeedTagOverlay from '../../post/tags/InteractiveFeedTagOverlay'; | ||
import { useFeature } from '../../GrowthBookProvider'; | ||
import { featurePostUiImprovements } from '../../../lib/featureManagement'; | ||
|
||
export const ArticleGrid = forwardRef(function ArticleGrid( | ||
{ | ||
|
@@ -48,6 +50,7 @@ export const ArticleGrid = forwardRef(function ArticleGrid( | |
}: PostCardProps, | ||
ref: Ref<HTMLElement>, | ||
): ReactElement { | ||
const postUiExp = useFeature(featurePostUiImprovements); | ||
const { className, style } = domProps; | ||
const { data } = useBlockPostPanel(post); | ||
const onPostCardClick = () => onPostClick(post); | ||
|
@@ -95,7 +98,7 @@ export const ArticleGrid = forwardRef(function ArticleGrid( | |
post, | ||
classNames( | ||
className, | ||
showFeedback && '!p-0', | ||
(showFeedback || postUiExp) && '!p-0', | ||
postRelevant && | ||
'!border-status-success !bg-action-upvote-float text-action-upvote-default', | ||
postIrrelevant && | ||
|
@@ -135,7 +138,7 @@ export const ArticleGrid = forwardRef(function ArticleGrid( | |
showFeedback && styles.read, | ||
)} | ||
> | ||
<CardTextContainer> | ||
<CardTextContainer className={classNames(postUiExp && 'mx-4')}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sshanzel I think its a bit misleading because if you click in a level or two to see the actual text distance, its 16 Screen.Recording.2025-07-10.at.15.34.47.movThere was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the outer container does not havew the right padding, then yeah, mx-4 should be good. |
||
<PostCardHeader | ||
post={post} | ||
className={showFeedback ? '!hidden' : 'flex'} | ||
|
@@ -155,7 +158,12 @@ export const ArticleGrid = forwardRef(function ArticleGrid( | |
{!showFeedback && ( | ||
<Container> | ||
<CardSpace /> | ||
<div className="mx-2 flex items-center"> | ||
<div | ||
className={classNames( | ||
'flex items-center', | ||
postUiExp ? 'mx-4 ' : 'mx-2', | ||
)} | ||
> | ||
{post.clickbaitTitleDetected && <ClickbaitShield post={post} />} | ||
<PostTags post={post} /> | ||
</div> | ||
|
@@ -177,6 +185,7 @@ export const ArticleGrid = forwardRef(function ArticleGrid( | |
isHoveringCard={isHovering} | ||
className={{ | ||
image: classNames( | ||
postUiExp && 'px-1', | ||
showFeedback && 'mb-0', | ||
smallCard && ' !my-0 !h-26', | ||
), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed icon props because we seem to ignore the icon and select one based on a condition inside this component