Skip to content

Commit 7f179ca

Browse files
authored
chore: remove card_ui_colors_v2 exp - it lost (#4916)
1 parent 23df82e commit 7f179ca

11 files changed

Lines changed: 6 additions & 63 deletions

File tree

packages/shared/src/components/cards/ActionsButtons/ActionButtons.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ import { useBlockPostPanel } from '../../../hooks/post/useBlockPostPanel';
1919
import { usePostActions } from '../../../hooks/post/usePostActions';
2020
import { Tooltip } from '../../tooltip/Tooltip';
2121
import PostAwardAction from '../../post/PostAwardAction';
22-
import { featureCardUiColors } from '../../../lib/featureManagement';
23-
import { useFeature } from '../../GrowthBookProvider';
2422

2523
export interface ActionButtonsProps {
2624
post: Post;
@@ -41,7 +39,6 @@ const ActionButtons = ({
4139
className,
4240
onDownvoteClick,
4341
}: ActionButtonsProps): ReactElement => {
44-
const colorExp = useFeature(featureCardUiColors);
4542
const { onInteract, interaction, previousInteraction } = usePostActions({
4643
post,
4744
});
@@ -190,8 +187,7 @@ const ActionButtons = ({
190187
icon={<LinkIcon size={IconSize.XSmall} />}
191188
onClick={onCopyLink}
192189
variant={ButtonVariant.Tertiary}
193-
color={colorExp ? ButtonColor.Water : ButtonColor.Cabbage}
194-
buttonClassName={colorExp && 'hover:text-text-link'}
190+
color={ButtonColor.Cabbage}
195191
/>
196192
</Tooltip>
197193
</div>

packages/shared/src/components/cards/Freeform/FreeformGrid.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ import { WelcomePostCardFooter } from '../common/WelcomePostCardFooter';
1818
import ActionButtons from '../ActionsButtons/ActionButtons';
1919
import { ClickbaitShield } from '../common/ClickbaitShield';
2020
import { useSmartTitle } from '../../../hooks/post/useSmartTitle';
21-
import { useFeature } from '../../GrowthBookProvider';
22-
import { featureCardUiColors } from '../../../lib/featureManagement';
2321

2422
export const FreeformGrid = forwardRef(function SharePostCard(
2523
{
@@ -43,7 +41,6 @@ export const FreeformGrid = forwardRef(function SharePostCard(
4341
const containerRef = useRef<HTMLDivElement>();
4442
const image = usePostImage(post);
4543
const { title } = useSmartTitle(post);
46-
const colorExp = useFeature(featureCardUiColors);
4744

4845
return (
4946
<FeedItemContainer
@@ -71,7 +68,6 @@ export const FreeformGrid = forwardRef(function SharePostCard(
7168
hasImage: !!image,
7269
hasHtmlContent: !!post.contentHtml,
7370
}),
74-
{ '!text-text-quaternary': post.read && colorExp },
7571
)}
7672
>
7773
{title}

packages/shared/src/components/cards/ad/AdGrid.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,11 @@ import type { InViewRef } from '../../../hooks/feed/useAutoRotatingAds';
1313
import { useAutoRotatingAds } from '../../../hooks/feed/useAutoRotatingAds';
1414
import { AdRefresh } from './common/AdRefresh';
1515
import { ButtonSize, ButtonVariant } from '../../buttons/common';
16-
import { featureCardUiColors } from '../../../lib/featureManagement';
17-
import { useFeature } from '../../GrowthBookProvider';
1816

1917
export const AdGrid = forwardRef(function AdGrid(
2018
{ ad, onLinkClick, onRefresh, domProps, index, feedIndex }: AdCardProps,
2119
inViewRef: InViewRef,
2220
): ReactElement {
23-
const colorExp = useFeature(featureCardUiColors);
2421
const { isPlus } = usePlusSubscription();
2522
const { ref, refetch, isRefetching } = useAutoRotatingAds(
2623
ad,
@@ -35,12 +32,7 @@ export const AdGrid = forwardRef(function AdGrid(
3532
}, [ad, onRefresh, refetch]);
3633

3734
return (
38-
<Card
39-
className={colorExp && '!bg-background-default'}
40-
{...domProps}
41-
data-testid="adItem"
42-
ref={ref}
43-
>
35+
<Card {...domProps} data-testid="adItem" ref={ref}>
4436
<AdLink ad={ad} onLinkClick={onLinkClick} />
4537
<CardTextContainer className="flex-1">
4638
<CardTitle className="line-clamp-4 typo-title3">

packages/shared/src/components/cards/article/ArticleGrid.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ import { useSmartTitle } from '../../../hooks/post/useSmartTitle';
2828
import useInteractiveFeed from '../../../hooks/feed/useInteractiveFeed';
2929
import RelevancyTag from '../../tags/RelevancyTag';
3030
import InteractiveFeedTagOverlay from '../../post/tags/InteractiveFeedTagOverlay';
31-
import { useFeature } from '../../GrowthBookProvider';
32-
import { featureCardUiColors } from '../../../lib/featureManagement';
3331

3432
export const ArticleGrid = forwardRef(function ArticleGrid(
3533
{
@@ -71,7 +69,6 @@ export const ArticleGrid = forwardRef(function ArticleGrid(
7169
post,
7270
});
7371
const smallCard = interactiveFeedExp && isFeedPreview;
74-
const colorExp = useFeature(featureCardUiColors);
7572

7673
if (showInteractiveFeedOverlay) {
7774
return <InteractiveFeedTagOverlay onClose={onClose} post={post} />;
@@ -151,7 +148,6 @@ export const ArticleGrid = forwardRef(function ArticleGrid(
151148
<CardTitle
152149
className={classNames({
153150
'typo-callout': smallCard,
154-
'!text-text-quaternary': post.read && colorExp,
155151
})}
156152
lineClamp={showFeedback ? 'line-clamp-2' : undefined}
157153
>

packages/shared/src/components/cards/collection/CollectionGrid.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ import PostMetadata from '../common/PostMetadata';
1717
import { usePostImage } from '../../../hooks/post/usePostImage';
1818
import CardOverlay from '../common/CardOverlay';
1919
import PostTags from '../common/PostTags';
20-
import { useFeature } from '../../GrowthBookProvider';
21-
import { featureCardUiColors } from '../../../lib/featureManagement';
2220

2321
export const CollectionGrid = forwardRef(function CollectionCard(
2422
{
@@ -40,7 +38,6 @@ export const CollectionGrid = forwardRef(function CollectionCard(
4038
const image = usePostImage(post);
4139
const onPostCardClick = () => onPostClick(post);
4240
const onPostCardAuxClick = () => onPostAuxClick(post);
43-
const colorExp = useFeature(featureCardUiColors);
4441

4542
return (
4643
<FeedItemContainer
@@ -66,9 +63,6 @@ export const CollectionGrid = forwardRef(function CollectionCard(
6663
hasHtmlContent: !!post.contentHtml,
6764
}),
6865
'font-bold text-text-primary typo-title3',
69-
{
70-
'!text-text-quaternary': post.read && colorExp,
71-
},
7266
)}
7367
>
7468
{post.title}

packages/shared/src/components/cards/common/FeedItemContainer.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import {
1010
} from './RaisedLabel';
1111
import ConditionalWrapper from '../../ConditionalWrapper';
1212
import { useBookmarkProvider, useFeedPreviewMode } from '../../../hooks';
13-
import { useFeature } from '../../GrowthBookProvider';
14-
import { featureCardUiColors } from '../../../lib/featureManagement';
1513

1614
export interface FlagProps extends Pick<Post, 'trending' | 'pinnedAt'> {
1715
listMode?: boolean;
@@ -38,7 +36,6 @@ function FeedItemContainer(
3836
? `${trending} devs read it last hour`
3937
: undefined;
4038
const isFeedPreview = useFeedPreviewMode();
41-
const colorExp = useFeature(featureCardUiColors);
4239

4340
return (
4441
<ConditionalWrapper
@@ -59,7 +56,6 @@ function FeedItemContainer(
5956
data-testid="postItem"
6057
ref={ref}
6158
className={classNames(
62-
colorExp && `!bg-background-default`,
6359
domProps.className,
6460
!listMode && isFeedPreview && 'hover:border-border-subtlest-tertiary',
6561
highlightBookmarkedPost &&

packages/shared/src/components/cards/common/WelcomePostCardFooter.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import type { Post } from '../../../graphql/posts';
66
import { CardCover } from './CardCover';
77
import { useCardCover } from '../../../hooks/feed/useCardCover';
88
import { sanitizeMessage } from '../../../features/onboarding/shared';
9-
import { useFeature } from '../../GrowthBookProvider';
10-
import { featureCardUiColors } from '../../../lib/featureManagement';
119

1210
interface WelcomePostCardFooterProps {
1311
post: Post;
@@ -22,7 +20,6 @@ export const WelcomePostCardFooter = ({
2220
onShare,
2321
contentHtml,
2422
}: WelcomePostCardFooterProps): ReactElement => {
25-
const colorExp = useFeature(featureCardUiColors);
2623
const { overlay } = useCardCover({
2724
post,
2825
className: {
@@ -67,9 +64,6 @@ export const WelcomePostCardFooter = ({
6764
<p
6865
className={classNames(
6966
'mt-1 line-clamp-6 break-words px-2 typo-callout',
70-
{
71-
'text-text-quaternary': colorExp && post.read,
72-
},
7367
)}
7468
>
7569
{decodedText}

packages/shared/src/components/cards/common/list/ActionButtons.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ import { BookmarkButton } from '../../../buttons';
2525
import { Tooltip } from '../../../tooltip/Tooltip';
2626
import { QuaternaryButton } from '../../../buttons/QuaternaryButton';
2727
import PostAwardAction from '../../../post/PostAwardAction';
28-
import { featureCardUiColors } from '../../../../lib/featureManagement';
29-
import { useFeature } from '../../../GrowthBookProvider';
3028

3129
interface ActionButtonsPropsList extends ActionButtonsProps {
3230
onDownvoteClick?: (post: Post) => unknown;
@@ -41,7 +39,6 @@ export default function ActionButtons({
4139
onCopyLinkClick,
4240
className,
4341
}: ActionButtonsPropsList): ReactElement {
44-
const colorExp = useFeature(featureCardUiColors);
4542
const { onInteract, interaction, previousInteraction } = usePostActions({
4643
post,
4744
});
@@ -206,8 +203,7 @@ export default function ActionButtons({
206203
icon={<LinkIcon />}
207204
onClick={onCopyLink}
208205
variant={ButtonVariant.Tertiary}
209-
color={colorExp ? ButtonColor.Water : ButtonColor.Cabbage}
210-
buttonClassName={colorExp && 'hover:text-text-link'}
206+
color={ButtonColor.Cabbage}
211207
/>
212208
</Tooltip>
213209
</div>

packages/shared/src/components/cards/share/ShareGrid.tsx

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { ReactElement, Ref } from 'react';
22
import React, { forwardRef, useMemo, useRef } from 'react';
3-
import classNames from 'classnames';
43
import type { PostCardProps } from '../common/common';
54
import { Container } from '../common/common';
65
import { isVideoPost } from '../../../graphql/posts';
@@ -25,8 +24,6 @@ import classed from '../../../lib/classed';
2524
import { BlockIcon, EarthIcon } from '../../icons';
2625
import { Typography, TypographyType } from '../../typography/Typography';
2726
import { IconSize } from '../../Icon';
28-
import { useFeature } from '../../GrowthBookProvider';
29-
import { featureCardUiColors } from '../../../lib/featureManagement';
3027

3128
const EmptyStateContainer = classed(
3229
'div',
@@ -61,7 +58,6 @@ export const ShareGrid = forwardRef(function ShareGrid(
6158
const isPrivate =
6259
sharedPostPrivate && sharedPostSource?.type === SourceType.Squad;
6360
const isVideoType = isVideoPost(post);
64-
const colorExp = useFeature(featureCardUiColors);
6561

6662
const footer = useMemo(() => {
6763
if (isDeleted) {
@@ -134,13 +130,7 @@ export const ShareGrid = forwardRef(function ShareGrid(
134130
postLink={post.sharedPost.permalink}
135131
onReadArticleClick={onReadArticleClick}
136132
/>
137-
<CardTitle
138-
className={classNames({
139-
'!text-text-quaternary': post.read && colorExp,
140-
})}
141-
>
142-
{title}
143-
</CardTitle>
133+
<CardTitle>{title}</CardTitle>
144134
</CardTextContainer>
145135
<Container>
146136
<CardSpace />

packages/shared/src/components/post/PostActions.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ import type { LoggedUser } from '../../lib/user';
3232
import { useCanAwardUser } from '../../hooks/useCoresFeature';
3333
import { useUpdateQuery } from '../../hooks/useUpdateQuery';
3434
import { Tooltip } from '../tooltip/Tooltip';
35-
import { useFeature } from '../GrowthBookProvider';
36-
import { featureCardUiColors } from '../../lib/featureManagement';
3735

3836
interface PostActionsProps {
3937
post: Post;
@@ -49,7 +47,6 @@ export function PostActions({
4947
onComment,
5048
origin = Origin.ArticlePage,
5149
}: PostActionsProps): ReactElement {
52-
const colorExp = useFeature(featureCardUiColors);
5350
const { showLogin, user } = useAuthContext();
5451
const { openModal } = useLazyModal();
5552
const { data, onShowPanel, onClose } = useBlockPostPanel(post);
@@ -298,11 +295,9 @@ export function PostActions({
298295
variant={ButtonVariant.Tertiary}
299296
className={classNames(
300297
'text-text-tertiary',
301-
colorExp
302-
? 'group-hover/link-btn:text-text-link'
303-
: ' group-hover/link-btn:text-accent-cabbage-default',
298+
'group-hover/link-btn:text-accent-cabbage-default',
304299
)}
305-
color={colorExp ? ButtonColor.Water : ButtonColor.Cabbage}
300+
color={ButtonColor.Cabbage}
306301
>
307302
Copy
308303
</QuaternaryButton>

0 commit comments

Comments
 (0)