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

Andrei/quick shift #25

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 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
7 changes: 6 additions & 1 deletion src/pages/testing/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
// use this to test your stuff
import QuickShiftBtn from '@/sprintFiles/QuickShift/QuickShiftBtn'

const index = () => {
return <div>inex</div>
return (
<div>
<QuickShiftBtn></QuickShiftBtn>
</div>
)
}
export default index
57 changes: 57 additions & 0 deletions src/sprintFiles/QuickShift/NewQuickShiftCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import {
Button,
Dialog,
Typography,
DialogContent,
DialogTitle,
} from '@mui/material'
import { useState } from 'react'
import ScheduledShiftForm from './QuickShiftForm'

//Quick Shift == New Shift card that deals wi
//TODOS: Look below
// Split quickshift card into shift card and quickshiftbtn.
// Have an assigned user. Well-defined date.
// no categories
// select a single day
// skips the shift step of creating schedule.
// will only create a scheduled shift, NOT a SHIFT object.
function NewQuickShiftCard({
setOpen,
open,
}: {
setOpen: (value: React.SetStateAction<boolean>) => void
open: boolean
}) {
// const [shiftValues, setShiftValues] = useState(null)
const handleClose = () => {
setOpen(false)
}

const handleOpen = () => {
setOpen(true)
}
return (
<>
<Dialog
fullWidth
maxWidth="md"
open={open}
onClose={handleClose}
className="dialog"
>
<DialogTitle variant="h4" component="h2">
Create Quick Shift
</DialogTitle>
<DialogContent>
<ScheduledShiftForm
setOpen={setOpen}
// shiftId={shiftId} //'6401c47de8d154aa9ccf5d93'
isNewShift={true}
/>
</DialogContent>
</Dialog>
</>
)
}
export default NewQuickShiftCard
39 changes: 39 additions & 0 deletions src/sprintFiles/QuickShift/QuickShiftBtn.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import {
Button,
Dialog,
Typography,
DialogContent,
DialogTitle,
} from '@mui/material'
import React from 'react'
import { useState } from 'react'
import NewQuickShiftCard from './NewQuickShiftCard'

//Quick Shift == New Shift card that deals wi
//TODOS: Look below
// Split quickshift card into shift card and quickshiftbtn.
// Have an assigned user. Well-defined date.
// no categories
// select a single day
// skips the shift step of creating schedule.
// will only create a scheduled shift, NOT a SHIFT object.
function QuickShiftBtn() {
const [open, setOpen] = useState(false)
// const [shiftValues, setShiftValues] = useState(null)
const handleClose = () => {
setOpen(false)
}

const handleOpen = () => {
setOpen(true)
}
return (
<React.Fragment>
<Button fullWidth variant="contained" onClick={handleOpen}>
<Typography>Quick Shift</Typography>
</Button>
<NewQuickShiftCard setOpen={setOpen} open={open} />
</React.Fragment>
)
}
export default QuickShiftBtn
Loading