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
3ec9582b
Verified
Commit
3ec9582b
authored
3 years ago
by
Defendi Alberto
Browse files
Options
Downloads
Patches
Plain Diff
Style reservation using timeline.
parent
db09a3f1
No related branches found
Branches containing commit
No related tags found
2 merge requests
!85
Implement the remaining api calls to make possible to link a driver shift with a reservation.
,
!78
Resolve "Driver shift page where driver inserts shift."
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/Dashboard/ReservationPage/Reservation/Reservation.tsx
+46
-21
46 additions, 21 deletions
...nts/Dashboard/ReservationPage/Reservation/Reservation.tsx
with
46 additions
and
21 deletions
src/components/Dashboard/ReservationPage/Reservation/Reservation.tsx
+
46
−
21
View file @
3ec9582b
...
...
@@ -4,43 +4,68 @@ import {
Grid
,
Paper
,
Table
,
TableBody
,
TableCell
,
TableContainer
,
TableHead
,
TableRow
,
Typography
,
}
from
'
@material-ui/core
'
;
import
{
ReservationType
}
from
'
types/ReservationType
'
;
const
useStyles
=
makeStyles
(()
=>
({
noShadow
:
{
border
:
'
none
'
,
boxShadow
:
'
none
'
,
backgroundColor
:
'
transparent
'
,
},
}));
import
{
Timeline
,
TimelineConnector
,
TimelineContent
,
TimelineDot
,
TimelineItem
,
TimelineOppositeContent
,
TimelineSeparator
,
}
from
'
@material-ui/lab
'
;
type
PropsType
=
{
reservation
:
ReservationType
;
};
const
useStyles
=
makeStyles
((
theme
)
=>
({
root
:
{
width
:
'
100%
'
,
margin
:
'
1em 0
'
,
},
button
:
{
marginTop
:
theme
.
spacing
(
1
),
marginRight
:
theme
.
spacing
(
1
),
},
actionsContainer
:
{
marginBottom
:
theme
.
spacing
(
2
),
},
resetContainer
:
{
padding
:
theme
.
spacing
(
3
),
},
}));
export
const
Reservation
:
FC
<
PropsType
>
=
({
reservation
}:
PropsType
)
=>
{
const
classes
=
useStyles
();
return
(
<
Grid
item
container
style
=
{
{
paddingTop
:
'
20px
'
}
}
>
<
Grid
item
container
className
=
{
classes
.
root
}
>
<
TableContainer
component
=
{
Paper
}
>
<
Table
aria-label
=
"simple table"
>
<
T
ableHead
>
<
T
imeline
>
{
reservation
.
tripStages
.
map
((
stage
,
key
)
=>
(
<
TableRow
>
<
TableCell
key
=
{
stage
.
number
}
>
{
stage
.
location
.
address
}
</
TableCell
>
<
TableCell
key
=
{
stage
.
number
}
>
{
stage
.
estimatedBeAt
}
</
TableCell
>
</
TableRow
>
<
TimelineItem
key
=
{
stage
.
number
}
>
<
TimelineOppositeContent
>
<
Typography
>
{
new
Date
(
stage
.
estimatedBeAt
).
toLocaleDateString
()
}
</
Typography
>
</
TimelineOppositeContent
>
<
TimelineSeparator
>
<
TimelineDot
/>
<
TimelineConnector
/>
</
TimelineSeparator
>
<
TimelineContent
>
<
Typography
>
{
stage
.
location
.
address
}
</
Typography
>
</
TimelineContent
>
</
TimelineItem
>
))
}
</
T
ableHead
>
</
T
imeline
>
</
Table
>
</
TableContainer
>
</
Grid
>
...
...
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