Skip to content

Commit d131cce

Browse files
murphybrandonkiacolbert
authored andcommitted
kia delete all browser/chrome things plz (#27)
* adding styling * Delete manifest.json * Delete bundle.js
1 parent c3391fb commit d131cce

File tree

19 files changed

+141
-31393
lines changed

19 files changed

+141
-31393
lines changed

.DS_Store

6 KB
Binary file not shown.

src/app/components/App.jsx

Lines changed: 57 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ import TimeSlider from '../container/TimeSlider.jsx';
99
import Events from '../container/Events.jsx';
1010
import Details from '../container/Details.jsx';
1111

12+
// styled components
13+
import { Wrapper } from '../styles/SplitPane.jsx';
14+
1215
// import from styled components to create global styles
1316
const GlobalStyle = createGlobalStyle`
1417
html {
@@ -37,9 +40,10 @@ class App extends Component {
3740

3841
this.state = {
3942
data: [],
43+
searchField: '',
44+
filteredData: [],
4045
isPlaying: false,
4146
isRecording: false,
42-
isSearching: false,
4347
isPlayingIndex: 0,
4448
};
4549

@@ -55,6 +59,11 @@ class App extends Component {
5559
}
5660

5761
componentDidMount() {
62+
// *******************************************************
63+
// need to impletement setState for filteredData to same value as data
64+
// this.setState({ data, filteredData: data });
65+
// *******************************************************
66+
5867
// adds listener to the effects that are gonna be sent from
5968
// our edited useReducer from the 'react' library.
6069
chrome.runtime.onConnect.addListener((portFromExtension) => {
@@ -79,7 +88,6 @@ class App extends Component {
7988
this.setState({ isPlayingIndex: 0 });
8089
}
8190

82-
console.log('isplaying');
8391
let { isPlaying } = this.state;
8492
isPlaying = !isPlaying;
8593
this.setState({ isPlaying });
@@ -130,10 +138,21 @@ class App extends Component {
130138
}
131139

132140
// filter search bar results
133-
// *** NOT FINISHED ***
134141
searchChange(e) {
135142
const { data } = this.state;
136-
console.log(data);
143+
144+
// grab user entry from filter bar
145+
const compareSearchValue = e.target.value;
146+
147+
// set state with compare value
148+
this.setState({ searchField: compareSearchValue })
149+
150+
// match results from our filter entry to data
151+
const actions = data.filter(function(item) {
152+
const type = item.action.type.toLowerCase();
153+
return type.includes(compareSearchValue.toLowerCase());
154+
});
155+
this.setState({ filteredData: actions });
137156
}
138157

139158
// time travel bar change
@@ -178,42 +197,45 @@ class App extends Component {
178197
isPlaying,
179198
setIsRecording,
180199
isRecording,
200+
filteredData,
181201
} = this.state;
182202

183203
return (
184204
<>
185205
<GlobalStyle />
186-
<SplitPane
187-
left={
188-
(
189-
<Events
190-
data={data}
191-
addAction={this.addActionToView}
192-
toTheFuture={this.toTheFuture}
193-
toThePast={this.toThePast}
194-
activeEventId={id}
195-
/>
196-
)}
197-
right={
198-
(
199-
<Details
200-
action={action}
201-
id={id}
202-
actionState={state}
203-
/>
204-
)}
205-
/>
206-
<TimeSlider
207-
data={data}
208-
toTheFuture={this.toTheFuture}
209-
toThePast={this.toThePast}
210-
isPlaying={isPlaying}
211-
isPlayingIndex={this.state.isPlayingIndex}
212-
isRecording={isRecording}
213-
setIsPlaying={this.setIsPlaying}
214-
setIsRecording={this.setIsRecording}
215-
handleBarChange={this.handleBarChange}
216-
/>
206+
<Wrapper>
207+
<SplitPane
208+
left={
209+
(
210+
<Events
211+
data={data}
212+
addAction={this.addActionToView}
213+
activeEventId={id}
214+
searchChange={this.searchChange}
215+
filteredData={filteredData}
216+
/>
217+
)}
218+
right={
219+
(
220+
<Details
221+
action={action}
222+
id={id}
223+
actionState={state}
224+
/>
225+
)}
226+
/>
227+
<TimeSlider
228+
data={data}
229+
toTheFuture={this.toTheFuture}
230+
toThePast={this.toThePast}
231+
isPlaying={isPlaying}
232+
isPlayingIndex={this.state.isPlayingIndex}
233+
isRecording={isRecording}
234+
setIsPlaying={this.setIsPlaying}
235+
setIsRecording={this.setIsRecording}
236+
handleBarChange={this.handleBarChange}
237+
/>
238+
</Wrapper>
217239
</>
218240
);
219241
}
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
import React from 'react';
22

3+
//styled components
4+
import { DetailsWrapper } from '../../../styles/Details.jsx';
5+
36
export default function Actions(props) {
47
// renders action information
58
const { action } = props;
69
return (
7-
<>
10+
<DetailsWrapper>
811
action:
912
{(action && action.type) || 'select an event'}
1013
<br></br>
1114
payload:
1215
{(action && action.payload) || 'select an event'}
13-
</>
16+
</DetailsWrapper>
1417
);
1518
}

src/app/components/DetailCards/DetailsNav.jsx

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

3-
var Link = require('react-router-dom').Link;
4-
var NavLink = require('react-router-dom').NavLink;
5-
//styled component imports
6-
import { Buttons, Button, DetailsNavWrapper, Ul } from '../../styles/Nav.jsx';
3+
let NavLink = require('react-router-dom').NavLink;
4+
5+
// styled component imports
6+
import { Buttons, Button, DetailsNavWrapper } from '../../styles/Nav.jsx';
77

88

99
export default function RightNav(props) {
1010
return (
1111
<>
1212
<DetailsNavWrapper>
1313
<Buttons>
14-
<NavLink activeClassName='active' to='/'>
14+
<NavLink exact activeClassName='active' to='/'>
1515
<Button>actions</Button>
1616
</NavLink>
1717
<NavLink activeClassName='active' to='/effects'>
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import React from 'react';
2+
import { DetailsWrapper } from '../../../styles/Details.jsx';
23

34
export default function Effects(props) {
45
return (
5-
<div>effects display page</div>
6+
<DetailsWrapper>effects display page</DetailsWrapper>
67
);
78
}
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
import React from 'react';
22
import StateCard from './StateCard.jsx';
33

4+
// styled component
5+
import { DetailsWrapper } from '../../../styles/Details.jsx';
6+
47
export default function State(props) {
58
// stringifying data to pass down to StateCard to display
69
const { actionState } = props;
710
const stringData = JSON.stringify(actionState, null, '\t');
811

912
return (
10-
<>
13+
<DetailsWrapper>
1114
{<StateCard stringData={stringData} />}
12-
</>
15+
</DetailsWrapper>
1316
);
1417
}

src/app/components/EventCards/EventsDisplay.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ import EventCreator from './EventCreator.jsx';
77
import { EventsWrapper } from '../../styles/Events.jsx';
88

99
export default function Events(props) {
10-
const { data, activeEventId } = props;
10+
const { data,
11+
activeEventId,
12+
filteredData,
13+
} = props;
1114
return (
1215
<EventsWrapper>
13-
{data.map((e, i) => (
16+
{filteredData.map((e, i) => (
1417
<EventCreator
1518
selectedEvent={activeEventId === e.id ? 'true' : 'false'}
1619
action={e.action.type}
Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
import React from 'react';
22

3+
4+
// styled components
5+
import { FilterWrapper } from '../../styles/FilterBar.jsx';
6+
37
export default function FilterBar(props) {
48
const {
5-
searchChange,
9+
searchChange
610
} = props;
711

812
return (
9-
<input
10-
type="text"
11-
placeholder="filter"
12-
onChange={searchChange}
13-
/>
13+
<>
14+
<FilterWrapper>
15+
<input
16+
type="text"
17+
placeholder="filter actions by name..."
18+
onChange={searchChange}
19+
/>
20+
</FilterWrapper>
21+
</>
1422
);
1523
}

src/app/components/EventCards/TimeTravel.jsx

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/app/container/Events.jsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React, { useContext, useState, Component} from 'react';
33
// components
44
import EventsNav from '../components/EventCards/EventsNav.jsx';
55
import EventsDisplay from '../components/EventCards/EventsDisplay.jsx'
6-
import TimeTravel from '../components/EventCards/TimeTravel.jsx';
6+
import FilterBar from '../components/EventCards/FilterBar.jsx';
77

88
class Events extends Component {
99
constructor(props) {
@@ -16,21 +16,19 @@ class Events extends Component {
1616
activeEventId,
1717
addAction,
1818
data,
19-
toTheFuture,
20-
toThePast,
19+
searchChange,
20+
filteredData,
2121
} = this.props;
2222
return (
2323
<>
2424
<EventsNav />
25+
<FilterBar searchChange={searchChange} />
2526
<EventsDisplay
2627
data={data}
28+
filteredData={filteredData}
2729
addAction={addAction}
2830
activeEventId={activeEventId}
2931
/>
30-
<TimeTravel
31-
toTheFuture={toTheFuture}
32-
toThePast={toThePast}
33-
/>
3432
</>
3533
);
3634
}

0 commit comments

Comments
 (0)