Skip to content

Commit

Permalink
feat: add-app-version-to-setup-screen (#1268)
Browse files Browse the repository at this point in the history
Fixes #1255 

### [ Summary ]
- Added `AppVersion` component which uses tauri api to get version and
displays it


![image](https://github.com/user-attachments/assets/ac734ce3-5a35-420a-84d9-ecc3909ad8c9)

![image](https://github.com/user-attachments/assets/8af878f1-3b64-456a-9f6d-364354007a10)
  • Loading branch information
Misieq01 authored Dec 17, 2024
1 parent 54c461d commit a4eff36
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/containers/phase/Setup/Setup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import HeroText from './components/HeroText';
import InfoNav from './components/InfoNav/InfoNav';
import { SetupWrapper } from '@app/containers/phase/Setup/Setup.styles';
import grain from '/assets/img/grain.png';
import AppVersion from './components/AppVersion';

export default function Setup() {
useSetUp();
Expand All @@ -12,6 +13,7 @@ export default function Setup() {
<HeroText />
<InfoNav />
<Footer />
<AppVersion />
</SetupWrapper>
);
}
19 changes: 19 additions & 0 deletions src/containers/phase/Setup/components/AppVersion.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { useEffect, useState } from 'react';
import { getVersion } from '@tauri-apps/api/app';
import { Typography } from '@app/components/elements/Typography';

export default function AppVersion() {
const [tariVersion, setTariVersion] = useState<string | null>(null);

useEffect(() => {
getVersion().then((version) => {
setTariVersion(version);
});
}, []);

return tariVersion ? (
<Typography variant="span" style={{ zIndex: 1000, position: 'absolute', right: 12, bottom: 6 }}>
{tariVersion}
</Typography>
) : null;
}

0 comments on commit a4eff36

Please sign in to comment.