mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-04 21:59:58 -05:00
Displaying name and version in footer.
This commit is contained in:
parent
3821722d0c
commit
8170313dd7
5 changed files with 35 additions and 2 deletions
17
app/src/hooks/useVersion.js
Normal file
17
app/src/hooks/useVersion.js
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import {useEffect, useState} from "react";
|
||||
import {getVersion} from "../api";
|
||||
|
||||
export const useVersion = () => {
|
||||
const [version, setVersion] = useState('');
|
||||
|
||||
const fetchVersion = async () => {
|
||||
let version = await getVersion();
|
||||
setVersion(version);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
fetchVersion();
|
||||
})
|
||||
|
||||
return version;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue