Skip to content

Commit a240925

Browse files
committed
feat: Link to releases when possible
When we’re using v5 of Harper, or when we have a Studio release, we can link to the corresponding GitHub release. The config page has been linkified accordingly, and the link already in the header has been made more specific. #1175
1 parent a605fbe commit a240925

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

src/components/Version.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@ import { badgeVariants } from '@/components/ui/badgeVariants';
22
import { cn } from '@/lib/cn';
33

44
export function Version() {
5+
let studioVersion = import.meta.env.VITE_STUDIO_VERSION;
6+
const link = studioVersion?.startsWith('v')
7+
? `https://github.com/HarperFast/studio/releases/tag/${studioVersion}`
8+
: 'https://github.com/HarperFast/studio/releases';
59
return (
6-
<a href="https://github.com/HarperFast/studio/releases" target="_blank" rel="noopener noreferrer">
10+
<a href={link} target="_blank" rel="noopener noreferrer">
711
<span className={cn(badgeVariants({ variant: 'default' }), 'text-xs inline-block ml-2 align-text-top')}>
8-
{import.meta.env.VITE_STUDIO_VERSION} BETA
12+
{studioVersion} BETA
913
</span>
1014
</a>
1115
);

src/features/instance/config/overview/components/HarperVersion.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,22 @@ export const HarperVersion = ({
88
loadingRegistration?: boolean;
99
registrationInfo?: RegistrationInfoResponse;
1010
}) => {
11+
const link = !!registrationInfo?.version
12+
&& parseInt(registrationInfo.version[0], 10) >= 5
13+
&& `https://github.com/HarperFast/harper/releases/tag/v${registrationInfo.version}`;
1114
return (
1215
<>
1316
<dt className="font-bold text-sm/6">Harper Version</dt>
1417
<dd className="text-sm/6 sm:mt-2">
15-
{loadingRegistration ? <TextLoadingSkeleton className="w-10" /> : registrationInfo?.version || 'Unknown'}
18+
{loadingRegistration
19+
? <TextLoadingSkeleton className="w-10" />
20+
: link
21+
? (
22+
<a href={link} target="_blank" className="underline hover:text-blue-300" rel="noopener noreferrer">
23+
{registrationInfo.version}
24+
</a>
25+
)
26+
: registrationInfo?.version || 'Unknown'}
1627
</dd>
1728
</>
1829
);

0 commit comments

Comments
 (0)