-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Hook to control application state (#46)
* remove .old files * add store and actions, rewrite EventItem using hook instead of class constructor * fix time format doesn't have prefix 0 when there is only one digit * add star to mark favorite events. TODO, save to localStorage, render in selected events tab * use json instead of csv, and use data directly from backend/data, also fix time parse format * save event_index to store instead of event_id
- Loading branch information
Showing
17 changed files
with
3,310 additions
and
3,498 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const toggleSelectedEvent = (store, selectedEventId) => { | ||
const { selectedEvents } = store.state; | ||
|
||
store.setState({ | ||
selectedEvents: selectedEvents.includes(selectedEventId) | ||
? selectedEvents.filter(x => x !== selectedEventId) | ||
: [...selectedEvents, selectedEventId], | ||
}); | ||
}; | ||
|
||
const saveToLocalStorage = (store) => { | ||
// eslint-disable-next-line | ||
console.log(`should save ${store} to localStorage here..`); | ||
}; | ||
|
||
export { toggleSelectedEvent, saveToLocalStorage }; |
42 changes: 0 additions & 42 deletions
42
gatsby_site/src/components/EventsContainer.old/EventItem/DescriptionBoxComponent.js
This file was deleted.
Oops, something went wrong.
88 changes: 0 additions & 88 deletions
88
...src/components/EventsContainer.old/EventItem/DetailBoxComponent/CategoryLabelComponent.js
This file was deleted.
Oops, something went wrong.
84 changes: 0 additions & 84 deletions
84
gatsby_site/src/components/EventsContainer.old/EventItem/DetailBoxComponent/index.js
This file was deleted.
Oops, something went wrong.
53 changes: 0 additions & 53 deletions
53
gatsby_site/src/components/EventsContainer.old/EventItem/TimeBoxComponent.js
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.