Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
256f8cef
Unverified
Commit
256f8cef
authored
5 years ago
by
Kyle Doherty
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Improve month picker legibility (#11973)
* switch to 3up grid * cleanup
parent
987db8a4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/src/metabase/parameters/components/widgets/DateMonthYearWidget.jsx
+20
-26
20 additions, 26 deletions
...ase/parameters/components/widgets/DateMonthYearWidget.jsx
with
20 additions
and
26 deletions
frontend/src/metabase/parameters/components/widgets/DateMonthYearWidget.jsx
+
20
−
26
View file @
256f8cef
import
React
,
{
Component
}
from
"
react
"
;
import
React
from
"
react
"
;
import
YearPicker
from
"
./YearPicker
"
;
import
{
Flex
}
from
"
grid-styled
"
;
import
moment
from
"
moment
"
;
import
_
from
"
underscore
"
;
import
cx
from
"
classnames
"
;
export
default
class
DateMonthYearWidget
extends
Component
{
export
default
class
DateMonthYearWidget
extends
React
.
Component
{
constructor
(
props
,
context
)
{
super
(
props
,
context
);
...
...
@@ -49,49 +49,43 @@ export default class DateMonthYearWidget extends Component {
const
{
onClose
}
=
this
.
props
;
const
{
month
,
year
}
=
this
.
state
;
return
(
<
div
className
=
"py2"
>
<
div
className
=
"
flex flex-column align
-center p
x
1"
>
<
div
style
=
{
{
maxWidth
:
320
}
}
>
<
div
className
=
"
border-bottom flex justify
-center p
y
1"
>
<
YearPicker
value
=
{
year
}
onChange
=
{
year
=>
this
.
setState
({
year
:
year
})
}
/>
</
div
>
<
div
className
=
"flex"
>
<
ol
className
=
"flex flex-column"
>
{
_
.
range
(
0
,
6
).
map
(
m
=>
(
<
Month
key
=
{
m
}
month
=
{
m
}
selected
=
{
m
===
month
}
onClick
=
{
()
=>
this
.
setState
({
month
:
m
},
onClose
)
}
/>
))
}
</
ol
>
<
ol
className
=
"flex flex-column"
>
{
_
.
range
(
6
,
12
).
map
(
m
=>
(
<
Flex
flexWrap
=
"wrap"
w
=
"100%"
p
=
{
1
}
>
{
_
.
range
(
0
,
12
).
map
(
m
=>
(
<
Flex
w
=
{
1
/
3
}
align
=
"center"
justifyContent
=
"center"
>
<
Month
key
=
{
m
}
month
=
{
m
}
selected
=
{
m
===
month
}
onClick
=
{
()
=>
this
.
setState
({
month
:
m
},
onClose
)
}
/>
))
}
</
ol
>
</
div
>
</
Flex
>
))
}
</
Flex
>
</
div
>
);
}
}
const
Month
=
({
month
,
selected
,
onClick
})
=>
(
<
li
className
=
{
cx
(
"
cursor-pointer px3 py1 text-bold text-brand-hover
"
,
{
"
text-brand
"
:
selected
,
})
}
<
div
className
=
{
cx
(
"
cursor-pointer text-bold full text-centered py1 px2 circular my1
"
,
{
"
bg-light-hover
"
:
!
selected
,
"
text-white bg-brand
"
:
selected
,
},
)
}
onClick
=
{
onClick
}
>
{
moment
()
.
month
(
month
)
.
format
(
"
MMMM
"
)
}
</
li
>
</
div
>
);
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