-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Improve app information component
- Remove distinction between backend and frontend version - Add "Contribute on Github" link - Rename component from SoftwareVersion to AppInfo for clearer intent and purpose
- Loading branch information
1 parent
b532f28
commit c6b8fac
Showing
7 changed files
with
52 additions
and
46 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright DB InfraGO AG and contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { useState, useEffect } from 'react'; | ||
import { ROUTE_PREFIX } from '../APIConfig'; | ||
import { SiGithub } from '@icons-pack/react-simple-icons'; | ||
|
||
export const AppInfo = () => { | ||
const [currentVersion, setCurrentVersion] = useState(null); | ||
|
||
useEffect(() => { | ||
fetch(`${ROUTE_PREFIX}/static/version.json`) | ||
.then((response) => response.json()) | ||
.then((data) => setCurrentVersion(data.git)) | ||
.catch((error) => { | ||
console.error(error); | ||
setCurrentVersion({ version: 'Fetch failed' }); | ||
}); | ||
}, []); | ||
|
||
return ( | ||
<div className="text-black dark:text-gray-100 print:hidden"> | ||
{currentVersion && <p>Version: {currentVersion.version}</p>} | ||
<a | ||
href="https://github.com/DSD-DBS/capella-model-explorer" | ||
className="flex items-center space-x-2 hover:underline" | ||
target="_blank"> | ||
<span>Contribute on GitHub</span> | ||
<div className="flex h-6 w-6 items-center justify-center rounded-full bg-custom-light"> | ||
<SiGithub className="h-5 w-5 text-black" /> | ||
</div> | ||
</a> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters