feat: add react-router-dom for routing and implement plugin detail view

- Updated package.json to include react-router-dom dependency.
- Refactored App component to use React Router for navigation.
- Created PluginDetail component to display detailed information about a selected plugin.
- Added fetch functions for releases and commits in the server code.
- Enhanced UI with new styles for dark mode and improved layout.
- Implemented caching for API responses to optimize performance.
This commit is contained in:
2026-01-31 19:48:44 +00:00
parent 561f7fb5f2
commit 81d1d0910c
7 changed files with 2818 additions and 2383 deletions

View File

@@ -1,5 +1,5 @@
:root {
color-scheme: light;
color-scheme: light dark;
}
.app {
@@ -10,6 +10,12 @@
padding: 48px 8vw 64px;
}
.page {
display: flex;
flex-direction: column;
gap: 32px;
}
.hero {
display: flex;
align-items: center;
@@ -62,6 +68,13 @@
gap: 20px;
}
.actions {
display: flex;
align-items: center;
gap: 12px;
margin-top: auto;
}
.card {
background: #fff;
border-radius: 20px;
@@ -121,12 +134,20 @@
}
.link {
margin-top: auto;
color: #4f46e5;
font-weight: 600;
text-decoration: none;
}
.ghost {
border: 1px solid #c7d2fe;
color: #4338ca;
padding: 8px 14px;
border-radius: 999px;
text-decoration: none;
font-weight: 600;
}
.state {
background: #fff;
border-radius: 16px;
@@ -146,6 +167,64 @@
font-size: 0.9rem;
}
.detail-hero {
display: flex;
align-items: center;
justify-content: space-between;
gap: 24px;
flex-wrap: wrap;
}
.detail-actions {
display: flex;
align-items: center;
gap: 12px;
}
.detail-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 20px;
}
.detail-list {
display: grid;
gap: 12px;
margin: 16px 0;
}
.detail-list div {
display: flex;
flex-direction: column;
gap: 4px;
color: #64748b;
}
.detail-list strong {
color: inherit;
}
.list {
list-style: none;
padding: 0;
margin: 12px 0 0;
display: grid;
gap: 12px;
}
.list li {
display: flex;
justify-content: space-between;
gap: 12px;
color: #64748b;
}
.list a {
color: #4f46e5;
text-decoration: none;
font-weight: 600;
}
@media (max-width: 600px) {
.app {
padding: 40px 6vw 56px;
@@ -154,4 +233,74 @@
.hero {
align-items: flex-start;
}
}
@media (prefers-color-scheme: dark) {
.app {
background: radial-gradient(circle at top, #1e1b4b, #0b1120 50%);
color: #e2e8f0;
}
.subtitle {
color: #cbd5f5;
}
.card {
background: #0f172a;
box-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);
}
.card p {
color: #cbd5f5;
}
.pill {
background: #312e81;
color: #e0e7ff;
}
.meta {
color: #94a3b8;
}
.topic {
background: #1e293b;
color: #cbd5f5;
}
.link {
color: #a5b4fc;
}
.ghost {
border-color: #4f46e5;
color: #e0e7ff;
}
.detail-list div {
color: #cbd5f5;
}
.list li {
color: #cbd5f5;
}
.list a {
color: #a5b4fc;
}
.state {
background: #0f172a;
color: #cbd5f5;
box-shadow: 0 10px 20px rgba(15, 23, 42, 0.4);
}
.state.error {
background: #7f1d1d;
color: #fee2e2;
}
.footer {
color: #94a3b8;
}
}