Skip to content
This repository was archived by the owner on Apr 30, 2020. It is now read-only.

Conversation

@eveninglily
Copy link
Member

  • Adds /admin/events page
  • UI for CRUD events

Some TODOs:

  • Edit/Delete inline
  • Deal with img field
  • Better editing for start and end tiem (use react plugin)

* Jammed delete and edit into the same UI as creating events
* TODO: Clean this all up, make it inline, more sane handling of data
Copy link
Member

@nyaculak nyaculak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Ready to merge after dealing with the TODO's.

import { Form } from 'semantic-ui-react'

class EventCreate extends React.Component {
state = {id: 0, title: '', description: '', startEpoch: 0, endEpoch: 0, location: '', beginner: false, tags: ''}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be nice to extract this out of the class level as const DEFAULT_STATE = ... then state = DEFAULT_STATE inside the class level

constructor (props) {
super(props);

if(this.props.edit) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: space between if and (

event.img = "http://semantic-ui.com/images/wireframe/image.png";
}

let labels = [];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can replace this logic with a call to Array.prototype.map. Also, every React element in a list should have a unique key prop.

Also thinking that category should be renamed categories.

labels.push(<Label>{cat}</Label>)
}

const st = (new Date(event.startTime)).toLocaleTimeString('en-US', {hour: '2-digit', minute:'2-digit'})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just name these startTime and endTime for readability purposes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants