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
Commits
946f5bb4
You need to sign in or sign up before continuing.
Verified
Commit
946f5bb4
authored
3 years ago
by
Defendi Alberto
Browse files
Options
Downloads
Patches
Plain Diff
Attach form. Prepare onSubmit. Replace TextFields.
parent
9c822c57
No related branches found
No related tags found
2 merge requests
!56
Refined auth flow and new website pages.
,
!55
Refactoring to reservation page.
Pipeline
#12492
passed
3 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/Dashboard/ReservationPage/ReservationPage.tsx
+58
-50
58 additions, 50 deletions
src/components/Dashboard/ReservationPage/ReservationPage.tsx
with
58 additions
and
50 deletions
src/components/Dashboard/ReservationPage/ReservationPage.tsx
+
58
−
50
View file @
946f5bb4
...
@@ -22,6 +22,9 @@ import Fab from '@material-ui/core/Fab';
...
@@ -22,6 +22,9 @@ import Fab from '@material-ui/core/Fab';
import
{
NavBar
}
from
'
components/Dashboard/HomePage/NavBar
'
;
import
{
NavBar
}
from
'
components/Dashboard/HomePage/NavBar
'
;
import
{
Reservation
}
from
'
components/Dashboard/ReservationPage/Reservation/Reservation
'
;
import
{
Reservation
}
from
'
components/Dashboard/ReservationPage/Reservation/Reservation
'
;
import
{
useReservations
}
from
'
hooks/useReservations
'
;
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
'
;
let
themeResp
=
createMuiTheme
();
let
themeResp
=
createMuiTheme
();
themeResp
=
responsiveFontSizes
(
themeResp
);
themeResp
=
responsiveFontSizes
(
themeResp
);
...
@@ -78,6 +81,7 @@ const useStyles = makeStyles(() => ({
...
@@ -78,6 +81,7 @@ const useStyles = makeStyles(() => ({
export
const
ReservationPage
:
FC
=
()
=>
{
export
const
ReservationPage
:
FC
=
()
=>
{
const
classes
=
useStyles
();
const
classes
=
useStyles
();
const
{
control
,
handleSubmit
}
=
useForm
<
ReservationProps
>
();
const
[
open
,
setOpen
]
=
React
.
useState
(
false
);
const
[
open
,
setOpen
]
=
React
.
useState
(
false
);
...
@@ -91,6 +95,12 @@ export const ReservationPage: FC = () => {
...
@@ -91,6 +95,12 @@ export const ReservationPage: FC = () => {
setOpen
(
false
);
setOpen
(
false
);
};
};
const
onSubmit
:
SubmitHandler
<
ReservationProps
>
=
(
data
:
ReservationProps
,
)
=>
{
console
.
log
(
data
);
};
return
(
return
(
<
div
data-testid
=
"Reservation"
>
<
div
data-testid
=
"Reservation"
>
<
Grid
container
direction
=
"column"
className
=
{
classes
.
paddingBottom
}
>
<
Grid
container
direction
=
"column"
className
=
{
classes
.
paddingBottom
}
>
...
@@ -106,56 +116,54 @@ export const ReservationPage: FC = () => {
...
@@ -106,56 +116,54 @@ export const ReservationPage: FC = () => {
onClose
=
{
handleOpen
}
onClose
=
{
handleOpen
}
aria-labelledby
=
"form-dialog-title"
aria-labelledby
=
"form-dialog-title"
>
>
<
DialogTitle
id
=
"form-dialog-title"
>
<
form
onSubmit
=
{
handleSubmit
(
onSubmit
)
}
data-testid
=
"Form"
>
Book New Reservation
<
DialogTitle
id
=
"form-dialog-title"
>
</
DialogTitle
>
Book New Reservation
<
DialogContent
>
</
DialogTitle
>
<
DialogContentText
>
<
DialogContent
>
Write here below the details of your next reservation
<
DialogContentText
>
</
DialogContentText
>
Write here below the details of your next reservation
<
TextField
</
DialogContentText
>
autoFocus
margin
=
"dense"
<
InputField
id
=
"name"
name
=
"name"
label
=
"Name Reservation"
label
=
"Name Reservation"
type
=
"text"
type
=
"text"
fullWidth
control
=
{
control
}
/>
/>
<
TextField
<
InputField
autoFocus
name
=
"date"
margin
=
"dense"
label
=
"Reservation date"
id
=
"name"
type
=
"date"
label
=
"Date"
control
=
{
control
}
type
=
"date"
/>
fullWidth
<
InputField
InputLabelProps
=
{
{
shrink
:
true
}
}
name
=
"time"
/>
label
=
"Department Time"
<
TextField
type
=
"time"
autoFocus
control
=
{
control
}
margin
=
"dense"
/>
id
=
"name"
<
InputField
label
=
"Department Time"
name
=
"destination"
type
=
"time"
label
=
"Destination"
fullWidth
type
=
"text"
InputLabelProps
=
{
{
shrink
:
true
}
}
control
=
{
control
}
/>
/>
<
TextField
</
DialogContent
>
autoFocus
<
DialogActions
>
margin
=
"dense"
<
Button
onClick
=
{
handleClose
}
color
=
"primary"
>
id
=
"name"
Cancel
label
=
"Destination"
</
Button
>
type
=
"text"
<
Button
fullWidth
type
=
"submit"
/>
fullWidth
</
DialogContent
>
variant
=
"contained"
<
DialogActions
>
color
=
"primary"
<
Button
onClick
=
{
handleClose
}
color
=
"primary"
>
>
Cancel
Insert
</
Button
>
</
Button
>
<
Button
onClick
=
{
handleClose
}
color
=
"primary"
variant
=
"contained"
>
</
DialogActions
>
Subscribe
</
form
>
</
Button
>
</
DialogActions
>
</
Dialog
>
</
Dialog
>
<
MuiThemeProvider
theme
=
{
themeResp
}
>
<
MuiThemeProvider
theme
=
{
themeResp
}
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment