Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin view resposive #258

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37,455 changes: 0 additions & 37,455 deletions client/package-lock.json

This file was deleted.

1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@testing-library/jest-dom": "5.11.4",
"@testing-library/react": "11.1.0",
"@testing-library/user-event": "12.1.10",
"package-name": "0.1.0",
"react": "17.0.2",
"react-big-scheduler": "0.2.7",
"react-chatbot-kit": "^1.1.20",
Expand Down
102 changes: 47 additions & 55 deletions client/src/App.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
//import logo from './assets/company_shift_logo.png';
//import company from './assets/company_shift.png';
import React, { useState } from "react";
import React, { useState } from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import Chatbot from 'react-chatbot-kit';
import './components/chatbot/chatbot.css';
import ActionProvider from './components/chatbot/ActionProvider';
import config from './components/chatbot/config';
import MessageParser from './components/chatbot/MessageParser';

import './assets/main.css';
import { BrowserRouter as Router } from "react-router-dom";
import Chatbot from "react-chatbot-kit";
import "./components/chatbot/chatbot.css"
import ActionProvider from "./components/chatbot/ActionProvider";
import config from "./components/chatbot/config";
import MessageParser from "./components/chatbot/MessageParser";

import './components/chatbot/chatbot.css';

// import ManagementHome from './pages/shift_management';

import Routes from "./routes";
import Routes from './routes';

function App() {
const [showChatbot, setShowChatbot] = useState(false);
const [showChatbot, setShowChatbot] = useState(false);

const saveMessages = (messages) => {
localStorage.setItem("chat_messages", JSON.stringify(messages));
};
const saveMessages = (messages) => {
localStorage.setItem('chat_messages', JSON.stringify(messages));
};

const loadMessages = () => {
const messages = JSON.parse(localStorage.getItem("chat_messages"));
return messages;
};
return (
<div className='App'>
{/* <header className='App-header' style={{ display: 'none' }}>
const loadMessages = () => {
const messages = JSON.parse(localStorage.getItem('chat_messages'));
return messages;
};
return (
<div className='App'>
{/* <header className='App-header' style={{ display: 'none' }}>
<div className='cs-left split'>
<div className='cs-logo'>
<img src={logo} className='cs-logo_img' alt='Employee Shift Logo' />
Expand All @@ -41,46 +44,35 @@ function App() {
<div className='cs-right split'>
<img src={company} className='cs-company_img' alt='Employee Shift' />
</div>
<<<<<<< HEAD

</header>
<ManagementHome/>
</div>
);
}

export default App;
=======
>>>>>>> refs/remotes/origin/devbash
</header>*/}

{showChatbot && (
<div className='app-chatbot-container'>
<Chatbot
config={config}
actionProvider={ActionProvider}
messageHistory={loadMessages()}
messageParser={MessageParser}
saveMessages={saveMessages}
/>
</div>
)}
<div className='app-chatbot-container'>
<Chatbot
config={config}
actionProvider={ActionProvider}
messageHistory={loadMessages()}
messageParser={MessageParser}
saveMessages={saveMessages}
/>
</div>
)}

<button
onClick={() => setShowChatbot(!showChatbot)}
className='app-chatbot-button'
>
<svg viewBox='0 0 640 512' class='app-chatbot-button-icon'>
<path d='M192,408h64V360H192ZM576,192H544a95.99975,95.99975,0,0,0-96-96H344V24a24,24,0,0,0-48,0V96H192a95.99975,95.99975,0,0,0-96,96H64a47.99987,47.99987,0,0,0-48,48V368a47.99987,47.99987,0,0,0,48,48H96a95.99975,95.99975,0,0,0,96,96H448a95.99975,95.99975,0,0,0,96-96h32a47.99987,47.99987,0,0,0,48-48V240A47.99987,47.99987,0,0,0,576,192ZM96,368H64V240H96Zm400,48a48.14061,48.14061,0,0,1-48,48H192a48.14061,48.14061,0,0,1-48-48V192a47.99987,47.99987,0,0,1,48-48H448a47.99987,47.99987,0,0,1,48,48Zm80-48H544V240h32ZM240,208a48,48,0,1,0,48,48A47.99612,47.99612,0,0,0,240,208Zm160,0a48,48,0,1,0,48,48A47.99612,47.99612,0,0,0,400,208ZM384,408h64V360H384Zm-96,0h64V360H288Z'></path>
</svg>
</button>
<button
onClick={() => setShowChatbot(!showChatbot)}
className='app-chatbot-button'
>
<svg viewBox='0 0 640 512' class='app-chatbot-button-icon'>
<path d='M192,408h64V360H192ZM576,192H544a95.99975,95.99975,0,0,0-96-96H344V24a24,24,0,0,0-48,0V96H192a95.99975,95.99975,0,0,0-96,96H64a47.99987,47.99987,0,0,0-48,48V368a47.99987,47.99987,0,0,0,48,48H96a95.99975,95.99975,0,0,0,96,96H448a95.99975,95.99975,0,0,0,96-96h32a47.99987,47.99987,0,0,0,48-48V240A47.99987,47.99987,0,0,0,576,192ZM96,368H64V240H96Zm400,48a48.14061,48.14061,0,0,1-48,48H192a48.14061,48.14061,0,0,1-48-48V192a47.99987,47.99987,0,0,1,48-48H448a47.99987,47.99987,0,0,1,48,48Zm80-48H544V240h32ZM240,208a48,48,0,1,0,48,48A47.99612,47.99612,0,0,0,240,208Zm160,0a48,48,0,1,0,48,48A47.99612,47.99612,0,0,0,400,208ZM384,408h64V360H384Zm-96,0h64V360H288Z'></path>
</svg>
</button>

<Router>
<Routes />
</Router>
{/* <CreateShift/> */}
</div>
);
<Router>
<Routes />
</Router>
{/* <CreateShift/> */}
</div>
);
}

export default App;
export default App;
153 changes: 153 additions & 0 deletions client/src/assets/swapShiftData.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
const swapRequest = [
{
requestedSwap: {
name: 'Emmanuel Abu',
Date: '24 Aug 2021',
startTime: '09:00am',
endTime: '04:00pm',
shift: 'Evening',
totalSwapRequest: 21,
color: 'rgba(48, 198, 126, 1)',
backgroundColor: 'rgba(232, 240, 255, 0.3)',
},
swapPartner: {
name: 'Florence Uzo',
Date: '27 Aug 2021',
startTime: '09:00am',
endTime: '04:00pm',
shift: 'Morning',
},
},
{
requestedSwap: {
name: 'Emmanuel Abu',
Date: '24 Aug 2021',
startTime: '09:00am',
endTime: '04:00pm',
shift: 'Evening',
totalSwapRequest: 2,
color: 'rgba(235, 185, 87, 1)',
backgroundColor: 'rgba(232, 232, 232, 0.12)',
},
swapPartner: {
name: 'Florence Uzo',
Date: '27 Aug 2021',
startTime: '09:00am',
endTime: '04:00pm',
shift: 'Morning',
},
},
{
requestedSwap: {
name: 'Emmanuel Abu',
Date: '24 Aug 2021',
startTime: '09:00am',
endTime: '04:00pm',
shift: 'Evening',
totalSwapRequest: 5,
color: 'rgba(48, 198, 126, 1)',
backgroundColor: 'rgba(232, 240, 255, 0.3)',
},
swapPartner: {
name: 'Florence Uzo',
Date: '27 Aug 2021',
startTime: '09:00am',
endTime: '04:00pm',
shift: 'Morning',
},
},
{
requestedSwap: {
name: 'Emmanuel Abu',
Date: '24 Aug 2021',
startTime: '09:00am',
endTime: '04:00pm',
shift: 'Evening',
totalSwapRequest: 10,
color: 'rgba(255, 69, 80, 1)',
backgroundColor: 'rgba(232, 232, 232, 0.12)',
},
swapPartner: {
name: 'Florence Uzo',
Date: '27 Aug 2021',
startTime: '09:00am',
endTime: '04:00pm',
shift: 'Morning',
},
},
{
requestedSwap: {
name: 'Emmanuel Abu',
Date: '24 Aug 2021',
startTime: '09:00am',
endTime: '04:00pm',
shift: 'Evening',
totalSwapRequest: 1,
backgroundColor: 'rgba(232, 240, 255, 0.3)',
},
swapPartner: {
name: 'Florence Uzo',
Date: '27 Aug 2021',
startTime: '09:00am',
endTime: '04:00pm',
shift: 'Morning',
},
},
{
requestedSwap: {
name: 'Emmanuel Abu',
Date: '24 Aug 2021',
startTime: '09:00am',
endTime: '04:00pm',
shift: 'Evening',
totalSwapRequest: 5,
backgroundColor: 'rgba(232, 232, 232, 0.12)',
},
swapPartner: {
name: 'Florence Uzo',
Date: '27 Aug 2021',
startTime: '09:00am',
endTime: '04:00pm',
shift: 'Morning',
color: 'rgba(48, 198, 126, 1)',
},
},
{
requestedSwap: {
name: 'Emmanuel Abu',
Date: '24 Aug 2021',
startTime: '09:00am',
endTime: '04:00pm',
shift: 'Evening',
totalSwapRequest: 1,
backgroundColor: 'rgba(232, 240, 255, 0.3)',
},
swapPartner: {
name: 'Florence Uzo',
Date: '27 Aug 2021',
startTime: '09:00am',
endTime: '04:00pm',
shift: 'Morning',
},
},
{
requestedSwap: {
name: 'Emmanuel Abu',
Date: '24 Aug 2021',
startTime: '09:00am',
endTime: '04:00pm',
shift: 'Evening',
totalSwapRequest: 2,
backgroundColor: 'rgba(232, 232, 232, 0.12)',
},
swapPartner: {
name: 'Florence Uzo',
Date: '27 Aug 2021',
startTime: '09:00am',
endTime: '04:00pm',
shift: 'Morning',
},
},
];

export default swapRequest;
Loading