Skip to content

Commit d4274ff

Browse files
committed
update about model and add version test
1 parent 5510466 commit d4274ff

File tree

2 files changed

+30
-3
lines changed

2 files changed

+30
-3
lines changed

.github/workflows/gh-pages.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ jobs:
123123
run: ls -l
124124
- name: Debug VERSION
125125
run: |
126-
echo "VERSION is: $VERSION"
126+
VERSION=$VERSION
127+
echo "VERSION is: ${VERSION}"
127128
env:
128129
VERSION: ${{ env.VERSION }}
129130
- name: Create GitHub Release
@@ -141,6 +142,7 @@ jobs:
141142
- name: Find All Files Matching VERSION
142143
id: find_files
143144
run: |
145+
VERSION=$VERSION
144146
files=($(ls ./*${VERSION}* 2>/dev/null || echo ""))
145147
if [ ${#files[@]} -eq 0 ]; then
146148
echo "Error: No files found matching VERSION $VERSION"

src/App.js

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useState } from 'react';
22
import './App.css';
33
import { makeStyles } from '@material-ui/core/styles';
4-
import { AppBar, Typography, Button, Toolbar, Grid, Slide, IconButton, Menu, MenuItem } from '@material-ui/core';
4+
import { AppBar, Typography, Button, Toolbar, Grid, Slide, Dialog, DialogActions, DialogContent, DialogTitle, IconButton, Menu, MenuItem } from '@material-ui/core';
55
import SettingsIcon from '@material-ui/icons/Settings';
66
import coverPic from './image/cover.jpg';
77
import CRCP from './component/CRCP';
@@ -54,10 +54,18 @@ function App() {
5454
const [AnalysisPunchouts, setAnalysisPunchouts] = React.useState(0);
5555
const [AnalysisSlabThickness, setAnalysisSlabThickness] = React.useState(0);
5656
const [anchorEl, setAnchorEl] = useState(null); // State to manage the settings menu
57+
const [openModal, setOpenModal] = useState(false); // State to control modal visibility
5758

5859
const classes = useStyles();
5960
const AnalysisPunchoutsFunc = (d) => d === undefined ? AnalysisPunchouts : setAnalysisPunchouts(d);
6061
const AnalysisSlabThicknessFunc = (d) => d === undefined ? AnalysisSlabThickness : setAnalysisSlabThickness(d);
62+
const handleAboutClick = () => {
63+
setOpenModal(true); // Open the modal
64+
console.log('Version: ', packagejson.version);
65+
};
66+
const handleCloseModal = () => {
67+
setOpenModal(false); // Close the modal
68+
};
6169

6270
return (
6371
<ThemeProvider theme={theme}>
@@ -90,10 +98,27 @@ function App() {
9098
>
9199
<MenuItem onClick={() => setPage('TransferFunc')}>Transfer Function</MenuItem>
92100
<MenuItem onClick={() => console.log('Version: ', packagejson.version)}>Help</MenuItem>
93-
<MenuItem onClick={() => console.log("About clicked")}>About</MenuItem>
101+
<MenuItem onClick={handleAboutClick}>About</MenuItem>
94102
</Menu>
103+
95104
</Toolbar>
96105
</AppBar>
106+
{/* About Modal */}
107+
<Dialog open={openModal} onClose={handleCloseModal}>
108+
<DialogTitle>About</DialogTitle>
109+
<DialogContent>
110+
<h3>Program Name</h3>
111+
<p>TxDOT Mechanistic-Empirical CRCP Design System</p>
112+
113+
<h3>Version</h3>
114+
<p>{packagejson.version}</p>
115+
<h3>Developed By</h3>
116+
<p>iDataVisualizationLab</p>
117+
</DialogContent>
118+
<DialogActions>
119+
<Button onClick={handleCloseModal} color="primary">Close</Button>
120+
</DialogActions>
121+
</Dialog>
97122

98123
<div className={classes.root}>
99124
{/* Home Page */}

0 commit comments

Comments
 (0)