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

Add confirm to staff status

parent 330fa3b4
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,7 @@ import { Link } from 'react-router-dom'; ...@@ -3,6 +3,7 @@ import { Link } from 'react-router-dom';
import { Container, Table, Label, Button } from 'semantic-ui-react'; import { Container, Table, Label, Button } from 'semantic-ui-react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { getProfiles, setStatus } from '../../actions/statistics'; import { getProfiles, setStatus } from '../../actions/statistics';
import ConfirmModal from '../forms/ConfirmModal';
class Applications extends Component { class Applications extends Component {
componentWillMount() { componentWillMount() {
...@@ -47,13 +48,16 @@ class Applications extends Component { ...@@ -47,13 +48,16 @@ class Applications extends Component {
</Table.Cell> </Table.Cell>
} }
<Table.Cell> <Table.Cell>
<Button <ConfirmModal
onClick={() => this.props.setStatus(profile.id, 'Staff')} button = {<Button
color='blue' color='blue'
size='tiny' size='tiny'
> >
ADD STAFF STATUS ADD STAFF STATUS
</Button> </Button>}
text='staff jogot adsz neki'
onAccept={() => this.props.setStatus(profile.id, 'Staff')}
/>
</Table.Cell> </Table.Cell>
</Table.Row> </Table.Row>
); );
......
...@@ -14,7 +14,7 @@ export default (state = INITIAL_STATE, action) => { ...@@ -14,7 +14,7 @@ export default (state = INITIAL_STATE, action) => {
const index = state.profiles.findIndex(item => item.id === action.payload.id); const index = state.profiles.findIndex(item => item.id === action.payload.id);
state.profiles.splice(index, 1, action.payload); state.profiles.splice(index, 1, action.payload);
if (action.payload.id === state.selectedProfile.id) { 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] } return { ...state, profiles: [...state.profiles] }
default: default:
......
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