Skip to content

Commit

Permalink
Merge pull request #65 from RENCI/help-about
Browse files Browse the repository at this point in the history
Adding a help/about tray
  • Loading branch information
mbwatson authored May 23, 2024
2 parents d49b0e1 + 20e1f96 commit 94ebeef
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 12 deletions.
24 changes: 24 additions & 0 deletions src/components/help-about/helpAboutTray.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React, {Fragment} from 'react';

/**
* This component renders the help/about try
*
* @returns {JSX.Element}
* @constructor
*/
export const HelpAboutTray = () => {
// render the form
return (
<Fragment>
<div>App version: {process.env.REACT_APP_VERSION}</div>
</Fragment>
);
};

/**
* this method populates the controls on the form.
*
*/
// const dataLoader = () => {
//
// };
10 changes: 1 addition & 9 deletions src/components/model-selection/modelSelectionTray.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {SynopticTabForm} from "@model-selection/synopticTab";
import {TropicalTabForm} from "@model-selection/tropicalTab";

/**
* This component renders the layer selection form
* This component renders the model selection tray
*
* @returns {JSX.Element}
* @constructor
Expand All @@ -30,11 +30,3 @@ export const ModelSelectionTray = () => {
</Fragment>
);
};

/**
* this method populates the controls on the form.
*
*/
// const dataLoader = () => {
//
// };
17 changes: 17 additions & 0 deletions src/components/trays/help_about/help_about.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React, { Fragment } from 'react';
import { HelpAboutTray } from "@help-about/helpAboutTray.js";

/**
* component that renders the help/about tray.
*
* @returns {JSX.Element}
* @constructor
*/
export const HelpAbout = () => {
// render the layer selection component
return (
<Fragment>
<HelpAboutTray />
</Fragment>
);
};
23 changes: 23 additions & 0 deletions src/components/trays/help_about/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from 'react';
import { Stack } from '@mui/joy';
import { HelpCenter as HelpAboutIcon} from '@mui/icons-material';

// import the component that will allow the user to view things about the app
import { HelpAbout } from "./help_about.js";

// get an icon for the tray
export const icon = <HelpAboutIcon />;

// create a title for this tray element
export const title = 'ADCIRC Help/About';

/**
* render the removal component
*
* @returns {JSX.Element}
*/
export const trayContents = () => (
<Stack gap={ 2 } p={ 2 }>
<HelpAbout />
</Stack>
);
4 changes: 3 additions & 1 deletion src/components/trays/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ import * as layers from './layers';
import * as model_selection from './model-selection';
import * as remove_items from './remove';
import * as settings from './settings';
import * as help_about from './help_about';

export default {
layers,
hurricanes,
model_selection,
remove_items,
settings
settings,
help_about
};

/*
Expand Down
2 changes: 1 addition & 1 deletion src/components/trays/model-selection/model-selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { Fragment } from 'react';
import { ModelSelectionTray } from "@model-selection/modelSelectionTray.js";

/**
* component that handles the selection of layers for the map.
* component that handles the filtered selections of layers for the map.
*
* @returns {JSX.Element}
* @constructor
Expand Down
3 changes: 2 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ module.exports = {
'@hooks': path.resolve(__dirname, 'src/hooks/'),
'@images': path.resolve(__dirname, 'src/images/'),
'@model-selection': path.resolve(__dirname, 'src/components/model-selection'),
'@utils': path.resolve(__dirname, 'src/utils/')
'@utils': path.resolve(__dirname, 'src/utils/'),
'@help-about': path.resolve(__dirname, 'src/components/help-about/'),
}
},

Expand Down

0 comments on commit 94ebeef

Please sign in to comment.