Merge pull request #784 from PicPeak/feat/admin-github-repo-button
feat(admin): GitHub repo button in the sidebar footer (#778)
This commit is contained in:
@@ -15,11 +15,13 @@ import {
|
|||||||
Workflow,
|
Workflow,
|
||||||
PanelLeftClose,
|
PanelLeftClose,
|
||||||
PanelLeftOpen,
|
PanelLeftOpen,
|
||||||
|
Github,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
import { useQuery } from '@tanstack/react-query';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { settingsService } from '../../services/settings.service';
|
import { settingsService } from '../../services/settings.service';
|
||||||
import { VersionInfo } from './VersionInfo';
|
import { VersionInfo } from './VersionInfo';
|
||||||
|
import { repoUrl } from '../../utils/githubReleaseUrl';
|
||||||
import { usePermissions } from '../../contexts/PermissionsContext';
|
import { usePermissions } from '../../contexts/PermissionsContext';
|
||||||
import { useAdminDarkMode } from '../../contexts/AdminDarkModeContext';
|
import { useAdminDarkMode } from '../../contexts/AdminDarkModeContext';
|
||||||
import { useFeatureFlags, type FeatureKey } from '../../contexts/FeatureFlagsContext';
|
import { useFeatureFlags, type FeatureKey } from '../../contexts/FeatureFlagsContext';
|
||||||
@@ -324,6 +326,20 @@ export const AdminSidebar: React.FC<AdminSidebarProps> = ({ isOpen, onClose, col
|
|||||||
|
|
||||||
{/* Storage Info */}
|
{/* Storage Info */}
|
||||||
<StorageInfo />
|
<StorageInfo />
|
||||||
|
|
||||||
|
{/* Link to the project on GitHub (#778). Subtle footer row so
|
||||||
|
admins can reach the repo — star, source, report an issue —
|
||||||
|
from anywhere in the dashboard, not just the setup screen. */}
|
||||||
|
<a
|
||||||
|
href={repoUrl}
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="mx-4 mb-3 flex items-center gap-2 text-xs text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200 transition-colors"
|
||||||
|
title={t('admin.viewOnGithub', 'View PicPeak on GitHub')}
|
||||||
|
>
|
||||||
|
<Github className="w-3.5 h-3.5" />
|
||||||
|
<span>{t('admin.viewOnGithub', 'View PicPeak on GitHub')}</span>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2411,6 +2411,7 @@
|
|||||||
"channelBeta": "Beta",
|
"channelBeta": "Beta",
|
||||||
"beta": "BETA",
|
"beta": "BETA",
|
||||||
"viewReleaseNotes": "Versionshinweise anzeigen",
|
"viewReleaseNotes": "Versionshinweise anzeigen",
|
||||||
|
"viewOnGithub": "PicPeak auf GitHub ansehen",
|
||||||
"updateAvailableShort": "v{{version}} verfügbar",
|
"updateAvailableShort": "v{{version}} verfügbar",
|
||||||
"upToDate": "Alles aktuell",
|
"upToDate": "Alles aktuell",
|
||||||
"updateNow": "Jetzt aktualisieren",
|
"updateNow": "Jetzt aktualisieren",
|
||||||
|
|||||||
@@ -1987,6 +1987,7 @@
|
|||||||
"channelBeta": "Beta",
|
"channelBeta": "Beta",
|
||||||
"beta": "BETA",
|
"beta": "BETA",
|
||||||
"viewReleaseNotes": "View Release Notes",
|
"viewReleaseNotes": "View Release Notes",
|
||||||
|
"viewOnGithub": "View PicPeak on GitHub",
|
||||||
"updateAvailableShort": "v{{version}} available",
|
"updateAvailableShort": "v{{version}} available",
|
||||||
"upToDate": "You're up to date",
|
"upToDate": "You're up to date",
|
||||||
"updateNow": "Update Now",
|
"updateNow": "Update Now",
|
||||||
|
|||||||
@@ -10,5 +10,10 @@
|
|||||||
* notes for the running version (#566) and by the update-available
|
* notes for the running version (#566) and by the update-available
|
||||||
* indicator to link to the upgrade target's notes.
|
* indicator to link to the upgrade target's notes.
|
||||||
*/
|
*/
|
||||||
|
/** Repository home on GitHub. Single source of truth for the org URL so
|
||||||
|
* links (release notes, the admin "view on GitHub" button, #778) don't
|
||||||
|
* each hardcode it. */
|
||||||
|
export const repoUrl = 'https://github.com/PicPeak/picpeak';
|
||||||
|
|
||||||
export const githubReleaseUrl = (version: string): string =>
|
export const githubReleaseUrl = (version: string): string =>
|
||||||
`https://github.com/PicPeak/picpeak/releases/tag/v${version}`;
|
`${repoUrl}/releases/tag/v${version}`;
|
||||||
|
|||||||
Reference in New Issue
Block a user