Conversation
|
I just pushed the changes from today. Let me know if anything needs to be changed! |
|
|
||
| </div> | ||
|
|
||
| <Event /> |
src/components/ControlPanel/event.js
Outdated
| @@ -0,0 +1,58 @@ | |||
| //Edited from components/Events/UserEvents/event.js | |||
src/components/ControlPanel/event.js
Outdated
|
|
||
| export default class EventCard extends React.Component { | ||
| //input: array of majors | ||
| translate(majors) { |
There was a problem hiding this comment.
if this function doesn't really depend on anything in the EventCard class or doesn't have anything to do with this file, put it in utils.js (in src/) and import it from there.
src/components/ControlPanel/event.js
Outdated
| //input: array of majors | ||
| translate(majors) { | ||
|
|
||
| const majorMap = Config.majorMap; |
src/components/ControlPanel/event.js
Outdated
| } | ||
|
|
||
| let reducedMajors = majors.map(decideMajor); | ||
| console.log(reducedMajors); |
src/components/ControlPanel/event.js
Outdated
|
|
||
| render() { | ||
|
|
||
| this.translate(["computer science", "computer science and engineering", "electrical engineering", "mathematics of computation", "cognitive science", "linguistics and computer science", "math of computation", "applied mathematics", "undeclared engineering", "physics", "computer science & engineering", "computational and systems biology", "economics", "statistics", "mathematics", "bioengineering", "biochemistry", "mathematics/economics", "neuroscience", "chemistry", "mechanical engineering", "cs", "computer science engineering", "business economics", "cse", "civil engineering", "chemical engineering", "electrical and computer engineering", "math", "computational & systems biology", "computer engineering"]); |
src/components/ControlPanel/event.js
Outdated
| this.translate(["computer science", "computer science and engineering", "electrical engineering", "mathematics of computation", "cognitive science", "linguistics and computer science", "math of computation", "applied mathematics", "undeclared engineering", "physics", "computer science & engineering", "computational and systems biology", "economics", "statistics", "mathematics", "bioengineering", "biochemistry", "mathematics/economics", "neuroscience", "chemistry", "mechanical engineering", "cs", "computer science engineering", "business economics", "cse", "civil engineering", "chemical engineering", "electrical and computer engineering", "math", "computational & systems biology", "computer engineering"]); | ||
|
|
||
| const className = "event-card user-card"; | ||
| return( |
There was a problem hiding this comment.
make sure your indentation is consistent
src/components/ControlPanel/event.js
Outdated
|
|
||
| this.translate(["computer science", "computer science and engineering", "electrical engineering", "mathematics of computation", "cognitive science", "linguistics and computer science", "math of computation", "applied mathematics", "undeclared engineering", "physics", "computer science & engineering", "computational and systems biology", "economics", "statistics", "mathematics", "bioengineering", "biochemistry", "mathematics/economics", "neuroscience", "chemistry", "mechanical engineering", "cs", "computer science engineering", "business economics", "cse", "civil engineering", "chemical engineering", "electrical and computer engineering", "math", "computational & systems biology", "computer engineering"]); | ||
|
|
||
| const className = "event-card user-card"; |
There was a problem hiding this comment.
this variable is unnecessary
src/components/ControlPanel/event.js
Outdated
| return( | ||
| <div className={className}> | ||
| <div className="content"> | ||
| <h2>THIS IS A VERY LONG EVENT TITLE THAT WILL OVERFLOW THE DIV</h2> |
There was a problem hiding this comment.
Let's change this back to something normal. When we add the reducer for event analytics, we can templatize all of these.
|
|
||
|
|
||
|
|
||
| export default class EventAnalytics extends React.Component { |
There was a problem hiding this comment.
change this component to take in the data and labels through props instead of hard coding.
For example, you might pass in:
const yearData = { 1: 100, 2: 50, 3: 25, 4: 10 };
const majorData= { "CS/CSE": 300, "Ling CS": 100, "Math": 25 };
<EventAnalytics yearData={yearData} majorData={majorData} />And then use the passed in objects to derive the labels, data, and display them.
|
Ok, I finished all requested changes. |
For each individual event, there is an event card that I mostly copied form components/UserEvents/event.js. Inside this event card, there are 2 graphs, one for year and one for major. All data is currently a placeholder.