-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5e7f8e2
commit 9214f73
Showing
17 changed files
with
307 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { createAction } from "@reduxjs/toolkit"; | ||
|
||
export const createNewEmployee = createAction( | ||
'create-new-employee', | ||
(employee) => { | ||
return { | ||
payload: employee, | ||
} | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { createReducer } from "@reduxjs/toolkit" | ||
import { createNewEmployee } from "../actions/actionCreateEmployee" | ||
|
||
|
||
const initialStateNewEmployee = { | ||
employee: {}, | ||
isCreated: false, | ||
} | ||
|
||
export const newEmployeeReducer = createReducer(initialStateNewEmployee, (builder) => { | ||
return builder | ||
.addCase(createNewEmployee, (draft, action) => { | ||
draft.employee = action.payload | ||
draft.isCreated = true | ||
return | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { configureStore } from "@reduxjs/toolkit"; | ||
import { newEmployeeReducer } from "../reducers/newEmployeeReducer"; | ||
|
||
|
||
export const store = configureStore({ | ||
reducer: { | ||
newEmployee: newEmployeeReducer, | ||
} | ||
}) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react' | ||
import close from '../assets/close.svg' | ||
import { IMG, ModaleContent, ModaleDiv } from '../styles/components/modale' | ||
|
||
const Modale = ({hideModale}) => { | ||
return ( | ||
<ModaleDiv> | ||
<ModaleContent> | ||
<p>Employee Created !</p> | ||
<IMG src={close} alt="close" onClick={hideModale} /> | ||
</ModaleContent> | ||
</ModaleDiv> | ||
) | ||
} | ||
|
||
export default Modale |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
const departments = [ | ||
'Sales', | ||
'Marketing', | ||
'Engineering', | ||
'Human Resources', | ||
'Legal' | ||
{ | ||
name: 'Sales', | ||
}, | ||
{ | ||
name: 'Marketing', | ||
}, | ||
{ | ||
name: 'Engineering', | ||
}, | ||
{ | ||
name: 'Human Resources', | ||
}, | ||
{ | ||
name: 'Legal', | ||
}, | ||
] | ||
|
||
export default departments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import App from './App.jsx'; | ||
import reportWebVitals from './reportWebVitals'; | ||
import React from 'react' | ||
import ReactDOM from 'react-dom' | ||
import { App } from './App.jsx' | ||
import reportWebVitals from './reportWebVitals' | ||
|
||
ReactDOM.render( | ||
<React.StrictMode> | ||
<App /> | ||
</React.StrictMode>, | ||
document.getElementById('root') | ||
); | ||
) | ||
|
||
// If you want to start measuring performance in your app, pass a function | ||
// to log results (for example: reportWebVitals(console.log)) | ||
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals | ||
reportWebVitals(); | ||
reportWebVitals() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import styled from 'styled-components' | ||
|
||
export const ModaleDiv = styled.div` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
width: auto; | ||
height: auto; | ||
z-index: 10; | ||
background-color: rgba(0, 0, 0, 0.8); | ||
overflow: auto; | ||
` | ||
export const ModaleContent = styled.div` | ||
width: 10rem; | ||
height: auto; | ||
background-color: white; | ||
position: absolute; | ||
top: 40vh; | ||
padding: 1rem; | ||
border-radius: 0.8rem; | ||
text-align: center; | ||
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.4); | ||
` | ||
export const IMG = styled.img` | ||
position: absolute; | ||
top: -0.8rem; | ||
right: -0.8rem; | ||
width: 1.6rem; | ||
height: 1.6rem; | ||
cursor: pointer; | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.