Skip to content

Commit f339af5

Browse files
cleaning up some pseudocode formatting
1 parent 34b0573 commit f339af5

File tree

5 files changed

+28
-28
lines changed

5 files changed

+28
-28
lines changed

src/app/components/App.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ import mainReducer from '../reducers/mainReducer.js';
66
import { InitialStateProps } from '../FrontendTypes';
77
import { ThemeProvider } from '@mui/material/styles';
88
import theme from './theme';
9-
// currentTab is the current active tab within Google Chrome.
10-
// This is used to decide what tab Reactime should be monitoring. This can be "locked"
11-
// currentTabInApp is the current active tab within Reactime (Map, Performance, History, etc).
12-
// This is used to determine the proper tutorial to render when How To button is pressed.
139

14-
// we initialize what our initialState is here
15-
const initialState: InitialStateProps = {
10+
/*
11+
'currentTab' is the current active tab within Google Chrome.
12+
This is used to decide what tab Reactime should be monitoring. This can be "locked" currentTabInApp is the current active tab within Reactime (Map, Performance, History, etc).
13+
This is used to determine the proper tutorial to render when How To button is pressed.
14+
*/
15+
16+
const initialState: InitialStateProps = { // we initialize what our initialState is here
1617
port: null,
1718
currentTab: null,
1819
currentTitle: 'No Target',

src/app/components/RouteDescription.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ type RouteProps = {
1010

1111
const RouteDescription = (props: RouteProps): JSX.Element => {
1212
const { actions } = props;
13-
// Use new URL to use the url.pathname method.
14-
const url: URL = new URL(actions[0].props.routePath);
13+
14+
const url: URL = new URL(actions[0].props.routePath); // Use new URL to use the url.pathname method.
1515
return (
1616
<div className='routedescription'>
1717
<h3 className='route'>Route: {url.pathname}</h3>

src/app/components/SwitchApp.tsx

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,25 @@ import { setTab } from '../actions/actions';
1010
*/
1111

1212
const SwitchAppDropdown = (): JSX.Element => {
13-
// we destructure the returned context object from the invocation of the useStoreContext function. Properties not found on the initialState object (dispatch) are from the useReducer function invocation in the App component
14-
const [{ currentTab, tabs }, dispatch] = useStoreContext();
15-
// tabsArray is an empty array that will take objects as it's elements
16-
const tabsArray: {}[] = [];
13+
const [{ currentTab, tabs }, dispatch] = useStoreContext(); // we destructure the returned context object from the invocation of the useStoreContext function. Properties not found on the initialState object (dispatch) are from the useReducer function invocation in the App component
14+
15+
const tabsArray: {}[] = []; // tabsArray is an empty array that will take objects as it's elements
1716

18-
// We populate our 'tabsArray' with objects derived from the 'tab' that is currently being iterated on.
19-
Object.keys(tabs).forEach((tab) => {
17+
Object.keys(tabs).forEach((tab) => { // We populate our 'tabsArray' with objects derived from the 'tab' that is currently being iterated on.
2018
tabsArray.unshift({ value: tab, label: tabs[tab].title });
2119
});
2220

23-
// we create a 'currTab' object and populate it's values from the 'currentTab' that was destructured from our context object
24-
const currTab: {} = {
21+
const currTab: {} = { // we create a 'currTab' object and populate it's values from the 'currentTab' that was destructured from our context object
2522
value: currentTab,
2623
label: tabs[currentTab].title,
2724
};
2825

2926
const customStyles: {} = {
30-
// we define a menu method that takes in two parameters
31-
menu: (provided, state):{} => {
32-
// why does this ternary even matter if the end result is the same?
33-
const outline: string = state.isSelected ? 'transparent' : 'transparent';
27+
menu: (provided, state):{} => { // we define a menu method that takes in two parameters
28+
const outline: string = state.isSelected ? 'transparent' : 'transparent'; // why does this ternary even matter if the end result is the same?
3429
const margin: number = 0;
3530

36-
// we return an object that adds the ouline and margin to the provided object
37-
return { ...provided, outline, margin };
31+
return { ...provided, outline, margin }; // we return an object that adds the ouline and margin to the provided object
3832
},
3933
};
4034

src/app/components/Tutorial.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ import { Component } from 'react';
77
import 'intro.js/introjs.css';
88
import { tutorialSaveSeriesToggle, setCurrentTabInApp } from '../actions/actions';
99
import { TutorialProps, TutorialState, StepsObj } from '../FrontendTypes';
10-
//Must be required in. This enables compatibility with TS. If imported in, throws ts error of not rendering steps as a class component correctly.
1110
import { Button } from '@mui/material';
1211
import HelpOutlineIcon from '@mui/icons-material/HelpOutline';
13-
const { Steps } = require('intro.js-react');
12+
const { Steps } = require('intro.js-react'); //Must be required in. This enables compatibility with TS. If imported in, throws ts error of not rendering steps as a class component correctly.
13+
14+
/*
15+
This is the tutorial displayed when the "How to use" button is clicked
16+
This needs to be a class component to be compatible with updateStepElement from intro.js
17+
*/
1418

15-
// This is the tutorial displayed when the "How to use" button is clicked
16-
// This needs to be a class component to be compatible with updateStepElement from intro.js
1719
export default class Tutorial extends Component<TutorialProps, TutorialState> {
1820
constructor(props: TutorialProps) {
1921
super(props);

src/app/components/useForceUpdate.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { useState } from 'react';
22

3-
// This function will force a change in state and cause a re-render of the component.
4-
// The state information is irrelevant but an update is needed to force a re-render
3+
/*
4+
This function will force a change in state and cause a re-render of the component.
5+
The state information is irrelevant but an update is needed to force a re-render
6+
*/
7+
58
export default function useForceUpdate(): () => number {
69
const [, setValue] = useState(0);
710
return ():number => setValue((value:number): number => value + 1);

0 commit comments

Comments
 (0)