Skip to content

Commit 9531171

Browse files
added show/noShow div
1 parent f6dab23 commit 9531171

File tree

3 files changed

+50
-1
lines changed

3 files changed

+50
-1
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React from 'react';
2+
3+
const Clickable = (): JSX.Element => {
4+
return (
5+
<div>
6+
<p> this is the clickable component </p>
7+
</div>
8+
);
9+
}
10+
11+
export default Clickable;
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import React, {useState} from 'react';
2+
3+
const ClickableLink = (): JSX.Element => {
4+
//initialize showInfo to false
5+
const [showInfo, setShowInfo] = useState(false);
6+
7+
const toggleInfo = () => {
8+
//invert the value of showInfo
9+
setShowInfo(!showInfo);
10+
};
11+
12+
13+
return (
14+
<div>
15+
<span
16+
style={{ color: 'blue', cursor: 'pointer' }}
17+
onClick={toggleInfo}
18+
>
19+
ThemeProvider
20+
</span>
21+
{/* displayed onClick
22+
logical And operator: if showInfo is true --> thes result on the righthand side is evaluated and returned
23+
*/}
24+
{showInfo && (
25+
<div>
26+
<h1>ThemeContext</h1>
27+
<p>
28+
theme: 'dark', toggleTheme: f(), colors: primary: bdjsbdjsbj
29+
</p>
30+
</div>
31+
)}
32+
</div>
33+
);
34+
}
35+
36+
export default ClickableLink;

src/app/containers/ActionContainer.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import RouteDescription from '../components/Actions/RouteDescription';
99
import DropDown from '../components/Actions/DropDown';
1010
import { ActionContainerProps, CurrentTab, MainState, Obj, RootState } from '../FrontendTypes';
1111
import { Button, Switch } from '@mui/material';
12-
12+
import ClickableLink from '../components/Actions/ClickableLink';
1313
/*
1414
This file renders the 'ActionContainer'. The action container is the leftmost column in the application. It includes the button that shrinks and expands the action container, a dropdown to select the active site, a clear button, the current selected Route, and a list of selectable snapshots with timestamps.
1515
*/
@@ -224,7 +224,9 @@ function ActionContainer(props: ActionContainerProps): JSX.Element {
224224
</a>
225225
<SwitchAppDropdown />
226226
{/* add new component here for dropdown menu for useStae/ useReducer- ragad */}
227+
227228
<DropDown />
229+
<ClickableLink />
228230
<div className='action-component exclude'>
229231
<Button
230232
className='clear-button'

0 commit comments

Comments
 (0)