Skip to content

Commit

Permalink
fix: version and logo importing
Browse files Browse the repository at this point in the history
  • Loading branch information
frederic-maury committed Nov 26, 2024
1 parent b42222e commit dc28c9c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
4 changes: 1 addition & 3 deletions frontend/src/components/Common/RealtLogo.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import logo from "../../../public/RealT_Logo.png";

export function RealtLogo({
className,
}: {
className?: string;
}) {
return (
<img className={className} src={logo} alt="RealT" />
<img className={className} src="/RealT_Logo.png" alt="RealT" />
)
}
22 changes: 20 additions & 2 deletions frontend/src/components/Common/Version.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
import rootPackageJson from '../../../../package.json';
import { useEffect, useState } from 'react';
import Env from '../../utils/env';
import { Anchor } from '@mantine/core';

const Version = () => {
const [version, setVersion] = useState('1.0.0');

useEffect(() => {
fetch(`${Env.VITE_GITHUB_RAW_URL}/${Env.VITE_GITHUB_REPO}/refs/heads/main/package.json`)
.then(res => res.json())
.then(data => {
setVersion(data.version);
});
}, []);


return (
<h2>Version: {rootPackageJson.version}</h2>
<h2>
Version:&nbsp;
<Anchor href={`/~https://github.com/${Env.VITE_GITHUB_REPO}/releases/tag/v${version}`} target="_blank" size="sm">
{version}
</Anchor>
</h2>
);
};

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Settings/SettingsPanelContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function SettingsPanelContent({
{t('reportIssue')}
</Button>
</Box>
<Flex>
<Flex gap="md">
<Version />
<MadeBy extra />
</Flex>
Expand Down

0 comments on commit dc28c9c

Please sign in to comment.