Skip to content

Commit 213639b

Browse files
committed
feat: show open source plugin url on plugin page
1 parent 880bd7b commit 213639b

File tree

3 files changed

+49
-3
lines changed

3 files changed

+49
-3
lines changed

src/pages/plugin/plugin.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ export default async function PluginInclude(
111111
license: installedPlugin.license,
112112
keywords: installedPlugin.keywords,
113113
contributors: installedPlugin.contributors,
114+
repository: installedPlugin.repository,
114115
description,
115116
changelogs,
116117
};

src/pages/plugin/plugin.scss

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,39 @@
2121
background-size: contain;
2222
}
2323
.plugin-info {
24-
.plugin-name {
25-
font-size: 24px;
24+
.title-wrapper {
25+
display: flex;
26+
align-items: center;
27+
flex-wrap: wrap;
28+
gap: 16px;
2629
margin-bottom: 8px;
30+
.plugin-name {
31+
font-size: 24px;
32+
margin-bottom: 0;
33+
}
34+
.source-indicator {
35+
display: flex;
36+
align-items: center;
37+
gap: 6px;
38+
background: rgba(0, 0, 0, 0.3);
39+
backdrop-filter: blur(10px);
40+
border-radius: 20px;
41+
padding: 6px 10px;
42+
font-size: 11px;
43+
color: var(--primary-text-color);
44+
cursor: pointer;
45+
transition: all 0.3s ease;
46+
border: 1px solid rgba(255, 255, 255, 0.1);
47+
text-decoration: none;
48+
&:hover {
49+
background-color: rgba(0, 0, 0, 0.5);
50+
transform: translateY(-1px);
51+
}
52+
.icon {
53+
color: var(--primary-text-color);
54+
font-size: 14px;
55+
}
56+
}
2757
}
2858
.plugin-meta {
2959
display: flex;
@@ -274,6 +304,12 @@
274304
text-align: center;
275305
}
276306

307+
.source-indicator {
308+
position: absolute;
309+
top: 20px;
310+
right: 20px;
311+
}
312+
.title-wrapper,
277313
.plugin-meta,
278314
.metrics-row,
279315
.keywords {

src/pages/plugin/plugin.view.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export default (props) => {
1919
downloads,
2020
license,
2121
changelogs,
22+
repository,
2223
keywords: keywordsRaw,
2324
contributors: contributorsRaw,
2425
votes_up: votesUp,
@@ -49,7 +50,15 @@ export default (props) => {
4950
style={{ backgroundImage: `url(${icon})` }}
5051
></div>
5152
<div className="plugin-info">
52-
<h1 className="plugin-name">{name}</h1>
53+
<div className="title-wrapper">
54+
<h1 className="plugin-name">{name}</h1>
55+
{repository ? (
56+
<a href={repository} className="source-indicator">
57+
<i className="icon github"></i>
58+
<span>Open Source</span>
59+
</a>
60+
) : null}
61+
</div>
5362
<div className="plugin-meta">
5463
<span className="meta-item">
5564
<i className="licons tag" style={{ fontSize: "12px" }}></i>

0 commit comments

Comments
 (0)