Skip to content

Commit e71c580

Browse files
committed
fix cards display on compact mode
1 parent a7c98e9 commit e71c580

File tree

4 files changed

+21
-11
lines changed

4 files changed

+21
-11
lines changed

src/assets/App.css

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,20 +431,32 @@ a {
431431
background-color: var(--placeholder-background-color);
432432
margin-bottom: 12px;
433433
}
434+
434435
.rowTitle {
435436
color: var(--primary-text-color);
436437
margin: 0;
437438
padding: 0;
438439
font-size: 16px;
439440
text-decoration: none;
440-
display: block;
441+
display: flex;
442+
flex-direction: row;
443+
}
444+
.rowLink {
445+
color: var(--primary-text-color);
446+
margin: 0;
447+
padding: 0;
448+
font-size: 16px;
449+
text-decoration: none;
450+
display: flex;
441451
flex-direction: row;
442452
}
443453

444454
.rowTitle:hover {
445455
color: var(--primary-hover-text-color);
446456
}
447-
457+
.titleWithCover {
458+
display: block;
459+
}
448460
.dark .blockHeaderWhite {
449461
color: white;
450462
}

src/components/Elements/CardLink/CardLink.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const CardLink = ({
2020
return (
2121
<ClickableItem
2222
link={link}
23-
className={'rowTitle' + (className ? ` ${className}` : '')}
23+
className={'rowLink' + (className ? ` ${className}` : '')}
2424
analyticsAttributes={analyticsAttributes}
2525
appendRef={appendRef}>
2626
{children}

src/features/cards/components/aiCard/AICard.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ export function AICard({ meta, withAds }: CardPropsType) {
2020
error,
2121
} = useGetAIArticles({
2222
userTopics: userSelectedTags.map((tag) => tag.label.toLocaleLowerCase()),
23+
config: {
24+
cacheTime: 0,
25+
staleTime: 0,
26+
useErrorBoundary: false,
27+
},
2328
})
2429

2530
const renderItem = (item: Article, index: number) => (

src/features/cards/components/aiCard/ArticleItem.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { BiCommentDetail } from 'react-icons/bi'
22
import { GoDotFill } from 'react-icons/go'
33
import { MdAccessTime } from 'react-icons/md'
4-
import { VscTriangleUp } from 'react-icons/vsc'
54
import { CardItemWithActions, CardLink, ClickableItem } from 'src/components/Elements'
65
import { Attributes } from 'src/lib/analytics'
76
import { useUserPreferences } from 'src/stores/preferences'
@@ -23,6 +22,7 @@ const ArticleItem = (props: BaseItemPropsType<Article>) => {
2322
<p className="rowTitle">
2423
<CardLink
2524
link={item.url}
25+
className="titleWithCover"
2626
analyticsAttributes={{
2727
[Attributes.POINTS]: item.reactions,
2828
[Attributes.TRIGERED_FROM]: 'card',
@@ -33,13 +33,6 @@ const ArticleItem = (props: BaseItemPropsType<Article>) => {
3333
{item.image_url && listingMode === 'normal' && (
3434
<img src={item.image_url} className="rowCover" alt="" />
3535
)}
36-
{listingMode === 'compact' && (
37-
<span className="counterWrapper">
38-
<VscTriangleUp />
39-
<span className="value">{item.reactions}</span>
40-
</span>
41-
)}
42-
4336
<span className="subTitle">{item.title}</span>
4437
</CardLink>
4538
</p>

0 commit comments

Comments
 (0)