diff --git a/src/components/pages/Applications.js b/src/components/pages/Applications.js index 93761d8df45bad2f149f7aaf359eb085515e4107..6fac3330108f0610c51405e8b85772edbd6aab6c 100644 --- a/src/components/pages/Applications.js +++ b/src/components/pages/Applications.js @@ -3,6 +3,7 @@ import { Link } from 'react-router-dom'; import { Container, Table, Label, Button } from 'semantic-ui-react'; import { connect } from 'react-redux'; import { getProfiles, setStatus } from '../../actions/statistics'; +import ConfirmModal from '../forms/ConfirmModal'; class Applications extends Component { componentWillMount() { @@ -47,13 +48,16 @@ class Applications extends Component { </Table.Cell> } <Table.Cell> - <Button - onClick={() => this.props.setStatus(profile.id, 'Staff')} + <ConfirmModal + button = {<Button color='blue' size='tiny' > ADD STAFF STATUS - </Button> + </Button>} + text='staff jogot adsz neki' + onAccept={() => this.props.setStatus(profile.id, 'Staff')} + /> </Table.Cell> </Table.Row> ); diff --git a/src/reducers/TraineeReducer.js b/src/reducers/TraineeReducer.js index 06f01ec8c9ffae5411512829a5607041807fadd1..526cd7ace95c4e1b758d31e7e81d84242e46a927 100644 --- a/src/reducers/TraineeReducer.js +++ b/src/reducers/TraineeReducer.js @@ -14,7 +14,7 @@ export default (state = INITIAL_STATE, action) => { const index = state.profiles.findIndex(item => item.id === action.payload.id); state.profiles.splice(index, 1, action.payload); if (action.payload.id === state.selectedProfile.id) { - return { ...state, selectedProfile: action.payload }; + return { ...state, profiles: [...state.profiles], selectedProfile: action.payload }; } return { ...state, profiles: [...state.profiles] } default: