Skip to content
Snippets Groups Projects
Commit 60d9c3cf authored by Chif Gergő's avatar Chif Gergő
Browse files

Add cases to handle note creation, modify Table style.

parent a894f3c8
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,7 @@ class Events extends Component {
</Table.Cell>
<Table.Cell>{moment(event.date).format('LL')}</Table.Cell>
<Table.Cell>{event.visitor_number}</Table.Cell>
<Table.Cell compact>
<Table.Cell>
<Button
onClick={() => this.props.deleteEvent(event)}
color='red'
......
......@@ -13,12 +13,12 @@ class Trainees extends Component {
return (this.props.events.map((event) => {
if (event.visitors.includes(trainee.id)) {
return (
<Table.Cell>
<Table.Cell textAlign='center'>
<Icon color='green' name='checkmark' />
</Table.Cell>);
}
return (
<Table.Cell>
<Table.Cell textAlign='center'>
<Icon color='red' name='cancel' />
</Table.Cell>);
}));
......
import { GET_NOTES_BY_EVENT } from '../actions/types';
import { GET_NOTES_BY_EVENT, WRITE_NOTE, ADD_EVENT_NOTE } from '../actions/types';
const INITIAL_STATE = {};
const INITIAL_STATE = { eventNotes: [], actualNote: {} };
export default (state = INITIAL_STATE, action) => {
switch (action.type) {
case GET_NOTES_BY_EVENT:
return { ...state, eventNotes: action.payload };
case WRITE_NOTE:
return { ...state, actualNote: { ...state.actualNote, note: action.payload } };
case ADD_EVENT_NOTE:
return { ...state, eventNotes: [...state.eventNotes, action.payload] };
default:
return state;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment