Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dashboard
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
red-giant
dashboard
Merge requests
!60
New component to search senior (see
#12
). Enhance responsiveness and solve
#10
and
#11
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
New component to search senior (see
#12
). Enhance responsiveness and solve
#10
and
#11
dev
into
master
Overview
0
Commits
37
Pipelines
2
Changes
1
Merged
Defendi Alberto
requested to merge
dev
into
master
3 years ago
Overview
0
Commits
37
Pipelines
2
Changes
1
Expand
0
0
Merge request reports
Viewing commit
4b86a283
Prev
Next
Show latest version
1 file
+
46
−
69
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Verified
4b86a283
Remove deadcode and navbar.
· 4b86a283
Defendi Alberto
authored
3 years ago
src/components/Dashboard/ReservationPage/ReservationDialog.tsx
+
46
−
69
Options
import
React
,
{
FC
}
from
'
react
'
;
import
{
Grid
,
Typography
,
Dialog
,
DialogActions
,
DialogContent
,
@@ -9,15 +7,10 @@ import {
DialogTitle
,
Button
,
}
from
'
@material-ui/core
'
;
import
AddIcon
from
'
@material-ui/icons/Add
'
;
import
Fab
from
'
@material-ui/core/Fab
'
;
import
{
NavBar
}
from
'
components/Dashboard/HomePage/NavBar
'
;
import
{
Reservation
}
from
'
components/Dashboard/ReservationPage/Reservation/Reservation
'
;
import
{
useReservations
}
from
'
hooks/useReservations
'
;
import
{
ReservationProps
}
from
'
components/Dashboard/ReservationPage/Reservation/ReservationProps
'
;
import
{
SubmitHandler
,
useForm
}
from
'
react-hook-form
'
;
import
{
InputField
}
from
'
components/Auth/InputField/InputField
'
;
import
{
useStyles
}
from
'
./ReservationPage.style
'
;
type
ReservationDialogProps
=
{
handleClose
:
()
=>
void
;
@@ -27,7 +20,6 @@ export const ReservationDialog: FC<ReservationDialogProps> = ({
handleClose
,
isOpen
,
}:
ReservationDialogProps
)
=>
{
const
classes
=
useStyles
();
const
{
control
,
handleSubmit
}
=
useForm
<
ReservationProps
>
();
const
reservation
=
useReservations
();
@@ -41,68 +33,53 @@ export const ReservationDialog: FC<ReservationDialogProps> = ({
return
(
<
div
data-testid
=
"ReservationDialog"
>
<
Grid
container
direction
=
"column"
className
=
{
classes
.
paddingBottom
}
>
<
div
className
=
{
classes
.
root
}
>
<
Grid
item
>
<
NavBar
/>
</
Grid
>
<
Dialog
open
=
{
isOpen
}
onClose
=
{
handleClose
}
aria-labelledby
=
"form-dialog-title"
>
<
form
onSubmit
=
{
handleSubmit
(
onSubmit
)
}
data-testid
=
"Form"
>
<
DialogTitle
id
=
"form-dialog-title"
>
Book New Reservation
</
DialogTitle
>
<
DialogContent
>
<
DialogContentText
>
Write here below the details of your next reservation
</
DialogContentText
>
<
Dialog
open
=
{
isOpen
}
onClose
=
{
handleClose
}
aria-labelledby
=
"form-dialog-title"
>
<
form
onSubmit
=
{
handleSubmit
(
onSubmit
)
}
data-testid
=
"Form"
>
<
DialogTitle
id
=
"form-dialog-title"
>
Book New Reservation
</
DialogTitle
>
<
DialogContent
>
<
DialogContentText
>
Write here below the details of your next reservation
</
DialogContentText
>
<
InputField
name
=
"name"
label
=
"Name Reservation"
type
=
"text"
control
=
{
control
}
/>
<
InputField
name
=
"date"
label
=
"Reservation date"
type
=
"date"
control
=
{
control
}
/>
<
InputField
name
=
"time"
label
=
"Department Time"
type
=
"time"
control
=
{
control
}
/>
<
InputField
name
=
"destination"
label
=
"Destination"
type
=
"text"
control
=
{
control
}
/>
</
DialogContent
>
<
DialogActions
>
<
Button
onClick
=
{
handleClose
}
color
=
"primary"
>
Cancel
</
Button
>
<
Button
type
=
"submit"
fullWidth
variant
=
"contained"
color
=
"primary"
>
Insert
</
Button
>
</
DialogActions
>
</
form
>
</
Dialog
>
</
div
>
</
Grid
>
<
InputField
name
=
"name"
label
=
"Name Reservation"
type
=
"text"
control
=
{
control
}
/>
<
InputField
name
=
"date"
label
=
"Reservation date"
type
=
"date"
control
=
{
control
}
/>
<
InputField
name
=
"time"
label
=
"Department Time"
type
=
"time"
control
=
{
control
}
/>
<
InputField
name
=
"destination"
label
=
"Destination"
type
=
"text"
control
=
{
control
}
/>
</
DialogContent
>
<
DialogActions
>
<
Button
onClick
=
{
handleClose
}
color
=
"primary"
>
Cancel
</
Button
>
<
Button
type
=
"submit"
fullWidth
variant
=
"contained"
color
=
"primary"
>
Insert
</
Button
>
</
DialogActions
>
</
form
>
</
Dialog
>
</
div
>
);
};
Loading