Skip to content

Commit b077de3

Browse files
committed
feat: move doc link to top with name
1 parent eb23e36 commit b077de3

File tree

3 files changed

+20
-22
lines changed

3 files changed

+20
-22
lines changed

src/Shared/Components/Plugin/PluginCard.tsx

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,22 @@ const PluginCard = ({
6060
<div className="flexbox-col dc__gap-12 w-100">
6161
<div className="flexbox-col dc__gap-8">
6262
<div className="flexbox-col dc__gap-4">
63-
<div className="flexbox dc__gap-4">
64-
<h4 className="m-0 dc__truncate cn-9 fs-13 fw-6 lh-20 plugin-card__title">{name}</h4>
65-
{!isSelectable && (
66-
<span className="dc__truncate cn-7 fs-12 fw-4 lh-20">({pluginVersion})</span>
63+
<div className="flexbox dc__gap-6 w-100 dc__align-start dc__content-space">
64+
<div className="flexbox dc__gap-4">
65+
<h4 className="m-0 dc__truncate cn-9 fs-13 fw-6 lh-20 plugin-card__title">{name}</h4>
66+
{!isSelectable && (
67+
<span className="dc__truncate cn-7 fs-12 fw-4 lh-20">({pluginVersion})</span>
68+
)}
69+
</div>
70+
71+
{docLink && (
72+
<div className="flexbox dc__gap-4 dc__visible-hover--child dc__align-items-center">
73+
<a href={docLink} className="anchor" target="_blank" rel="noopener noreferrer">
74+
Learn more
75+
</a>
76+
77+
<ICBookOpen className="icon-dim-12 dc__no-shrink" />
78+
</div>
6779
)}
6880
</div>
6981

@@ -75,22 +87,7 @@ const PluginCard = ({
7587
</div>
7688

7789
{/* Tag container */}
78-
<div className="flexbox dc__gap-6 w-100 dc__align-start">
79-
<PluginTagsContainer tags={tags} />
80-
81-
{/* Adding a div with min width so that tags won't have layout shift on hover and will give flex-grow as 1 with flex end so that it sticks to end even if tags don't exist */}
82-
<div className="mw-84 flexbox dc__content-end flex-grow-1">
83-
{docLink && (
84-
<div className="flexbox dc__gap-4 dc__visible-hover--child dc__align-items-center">
85-
<a href={docLink} className="anchor" target="_blank" rel="noopener noreferrer">
86-
Learn more
87-
</a>
88-
89-
<ICBookOpen className="icon-dim-12 dc__no-shrink" />
90-
</div>
91-
)}
92-
</div>
93-
</div>
90+
<PluginTagsContainer tags={tags} />
9491
</div>
9592
</div>
9693
)

src/Shared/Components/Plugin/PluginTagsContainer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { PluginTagsContainerProps } from './types'
22

3-
const PluginTagsContainer = ({ tags }: PluginTagsContainerProps) => {
3+
const PluginTagsContainer = ({ tags, rootClassName }: PluginTagsContainerProps) => {
44
if (!tags?.length) {
55
return null
66
}
77

88
return (
9-
<div className="flexbox dc__gap-6 flex-wrap">
9+
<div className={`flexbox dc__gap-6 flex-wrap ${rootClassName}`}>
1010
{tags.map((tag) => (
1111
<div className="flexbox px-6 br-4 bcn-1 dc__align-items-center dc__mxw-160" key={tag}>
1212
<span className="dc__mxw-160 dc__truncate cn-8 fs-11 fw-4 lh-20">{tag}</span>

src/Shared/Components/Plugin/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,4 +195,5 @@ export interface PluginCardSkeletonListProps {
195195

196196
export interface PluginTagsContainerProps {
197197
tags: string[]
198+
rootClassName?: string
198199
}

0 commit comments

Comments
 (0)