Skip to content

Commit

Permalink
Merge pull request #86 from animalnots/dev
Browse files Browse the repository at this point in the history
A: attempted Fix for version display
  • Loading branch information
animalnots authored Dec 11, 2024
2 parents 7ceb40c + 8de6999 commit 4f8bc5c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
15 changes: 0 additions & 15 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,6 @@
<body>
<div id="root"></div>
<div id="modal-root"></div>
<div id="version-info"></div>
<script type="module" src="/src/main.tsx"></script>
<script>
fetch('/package.json')
.then(response => response.json())
.then(data => {
const versionInfo = document.getElementById('version-info');
versionInfo.textContent = `Version: ${data.version}`;
versionInfo.style.position = 'fixed';
versionInfo.style.bottom = '10px';
versionInfo.style.right = '10px';
versionInfo.style.fontSize = '12px';
versionInfo.style.color = '#888';
})
.catch(error => console.error('Error fetching version:', error));
</script>
</body>
</html>
2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import ApiPopup from '@components/ApiPopup';
import Toast from '@components/Toast';
import { ToastContainer } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';
import VersionInfo from '@components/Footer/VersionInfo';

function App() {
const initialiseNewChat = useInitialiseNewChat();
Expand Down Expand Up @@ -84,6 +85,7 @@ function App() {
<ApiPopup />
<Toast />
<ToastContainer />
<VersionInfo />
</div>
</div>
);
Expand Down
11 changes: 11 additions & 0 deletions src/components/Footer/VersionInfo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { version } from '../../../package.json';

const VersionInfo = () => {
return (
<div className="fixed bottom-2 right-2 text-xs text-gray-400 dark:text-gray-600 print:hidden">
Version: {version}
</div>
);
};

export default VersionInfo;

0 comments on commit 4f8bc5c

Please sign in to comment.