Skip to content

Commit 6307d6a

Browse files
authored
Merge pull request #12 from oslabs-beta/ui-changes
UI changes
2 parents 989a6f7 + 351fe4d commit 6307d6a

File tree

7 files changed

+52
-8
lines changed

7 files changed

+52
-8
lines changed

package-lock.json

Lines changed: 11 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "reacttime-extension",
2+
"name": "reactime",
33
"description": "build web extension bundle.js",
44
"scripts": {
55
"build": "webpack --mode production",
@@ -26,7 +26,7 @@
2626
"David Chai",
2727
"Josh Kim",
2828
"Ruthba Anam",
29-
"Ryan Dang",
29+
"Ryan Dang",
3030
"Sierra Swaby",
3131
"Yujin Kang"
3232
],

package/linkFiber.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ module.exports = (snap, mode) => {
5353
if (mode.locked && !mode.jumping) return;
5454
oldDispatch(fiber, queue, action);
5555
setTimeout(() => {
56-
console.log('Updating the snapshot tree after an action has been dispatched');
5756
updateSnapShotTree();
5857
sendSnapshot();
5958
}, 100);
@@ -113,7 +112,6 @@ module.exports = (snap, mode) => {
113112

114113
function updateSnapShotTree() {
115114
const { current } = fiberRoot;
116-
console.log('current', current);
117115
snap.tree = createTree(current);
118116
}
119117

package/timeJump.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ module.exports = (origin, mode) => {
2020
jump(child, coords.concat(i));
2121
});
2222
});
23-
}
24-
else {
23+
} else {
2524
// if component uses hooks
2625
// variable for current location
2726
let currLocation = originNode.component;
@@ -38,7 +37,6 @@ module.exports = (origin, mode) => {
3837
}
3938

4039
return target => {
41-
console.log('im a target', target);
4240
// setting mode disables setState from posting messages to window
4341
mode.jumping = true;
4442
jump(target);

src/app/components/SwitchState.jsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import React from 'react';
2+
import Select from 'react-select';
3+
4+
// SwitchStateDropdown should display options including all
5+
// and specific states being used
6+
// TODO: Need to get the getter name (for functional components)
7+
// and state name for stateful components
8+
const SwitchStateDropdown = () => {
9+
// Requirements:
10+
// Should be able to filter the Actions by the name of the state being changed
11+
// Should consider how to import the state names being changed
12+
// Should display the "All state", as well as specific state names as the options
13+
// When clicked on "All state" >> should display all Actions
14+
// When clicked on a specific "state" >> should only display Actions corresponding to the state
15+
16+
const sampleDropdown = [
17+
{label: 'Overview'},
18+
{label: 'setUsername'},
19+
{label: 'setPassword'}
20+
];
21+
22+
return (
23+
<Select
24+
className="state-dropdown"
25+
placeholder="Choose your state"
26+
options={sampleDropdown}
27+
/>
28+
)
29+
}
30+
31+
export default SwitchStateDropdown;

src/app/containers/ActionContainer.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* eslint-disable react/no-array-index-key */
22
import React from 'react';
3+
import SwitchStateDropdown from '../components/SwitchState';
34
import Action from '../components/Action';
45

56
import { emptySnapshots } from '../actions/actions';
@@ -32,6 +33,7 @@ function ActionContainer() {
3233
<button className="empty-button" onClick={() => dispatch(emptySnapshots())} type="button">
3334
Empty
3435
</button>
36+
<SwitchStateDropdown />
3537
</div>
3638
<div>{actionsArr}</div>
3739
</div>

src/app/styles/components/_buttons.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
width: 120px;
44
}
55

6+
.state-dropdown {
7+
width: 240px;
8+
margin-left: 20px;
9+
}
10+
611
.action-component:hover .jump-button {
712
opacity: 1;
813
transform: rotateX(0deg);

0 commit comments

Comments
 (0)