Skip to content

Commit a9a0ca8

Browse files
committed
chore: show app version in the footer
1 parent a718078 commit a9a0ca8

File tree

6 files changed

+43
-1
lines changed

6 files changed

+43
-1
lines changed

.env

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
REACT_APP_VERSION=$npm_package_version
2+
REACT_APP_NAME=$npm_package_name
3+
REACT_APP_REPO=$npm_package_repository

package-lock.json

+16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"dependencies": {
66
"bootstrap": "^5.2.3",
7+
"bootstrap-icons": "^1.10.5",
78
"file-saver": "^2.0.5",
89
"gojs": "^2.3.6",
910
"lodash": "^4.17.21",

src/components/App.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
unrichTreeData,
1818
} from '../family.util';
1919
import { useCache } from '../useCache';
20+
import Footer from './Footer';
2021

2122
interface AppProps {
2223
trees: Person[];
@@ -209,6 +210,8 @@ function App(props: AppProps) {
209210
<Family trees={trees} />
210211
</Container>
211212

213+
<Footer />
214+
212215
<ModalAddTree isOpen={showModalAddTree} toggle={toggleModalAddTree} />
213216
<ModalAddChild
214217
isOpen={showModalAddChild}

src/components/Footer.tsx

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { Container } from 'reactstrap';
2+
3+
const Footer = () => {
4+
const repo_url = 'https://github.com/rafgugi/family-grid';
5+
const version = process.env.REACT_APP_VERSION as string;
6+
7+
return (
8+
<footer className="d-print-none bg-dark text-light py-3 mt-5">
9+
<Container>
10+
<a href={repo_url} className="text-light mr-3">
11+
<i className="bi-github" /> family-grid {version}
12+
</a>
13+
</Container>
14+
</footer>
15+
);
16+
};
17+
18+
export default Footer;

src/index.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import { Person } from './family.interface';
55
import { enrichTreeData } from './family.util';
66
import rawFamilyData from './data.yml';
77

8-
import 'bootstrap/dist/css/bootstrap.css';
8+
import 'bootstrap/dist/css/bootstrap.min.css';
9+
import 'bootstrap-icons/font/bootstrap-icons.min.css';
910

1011
let familyData = [] as Person[];
1112
if (typeof rawFamilyData === 'object') {

0 commit comments

Comments
 (0)