File tree Expand file tree Collapse file tree 4 files changed +42
-13
lines changed Expand file tree Collapse file tree 4 files changed +42
-13
lines changed Original file line number Diff line number Diff line change 2
2
/// <reference types="next/image-types/global" />
3
3
4
4
// NOTE: This file should not be edited
5
- // see https://nextjs.org/docs/app/building-your-application/configuring /typescript for more information.
5
+ // see https://nextjs.org/docs/basic-features /typescript for more information.
Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ export const InputWrapper = styled.div`
23
23
justify-content: center;
24
24
gap: 0rem;
25
25
width: 100%;
26
- // height: 2rem;
27
26
` ;
28
27
29
28
export const InputContainer = styled . div `
@@ -86,14 +85,39 @@ export const DateContainer = styled.div`
86
85
display: flex;
87
86
justify-content: space-between;
88
87
align-items: end;
89
- height: 1.5rem;
88
+ /* height: 1.5rem; */
90
89
91
90
position: relative;
92
91
opacity: 0.7;
93
92
` ;
94
93
95
- export const DateSpan = styled . span < { year : string } > `
94
+ export const Divider = styled . hr `
95
+ border-bottom: 1px solid #000;
96
+ transition: 300ms width ease-in-out;
97
+ opacity: 0;
98
+ width: 0px;
99
+ margin: 0;
100
+ ` ;
101
+
102
+ export const DateSpan = styled . p < { isCurrent : string ; active : string } > `
96
103
font-size: 12px;
104
+ margin: 0;
97
105
color: ${ ( { theme } ) => theme . colors . black } ;
98
106
cursor: pointer;
107
+ margin-top: 0.25rem;
108
+ pointer-events: ${ ( { active } ) => ( active !== "true" ? "all" : "none" ) } ;
109
+
110
+ &:hover {
111
+ font-weight: bold;
112
+ }
113
+
114
+ & + ${ Divider } {
115
+ width: ${ ( { isCurrent } ) => isCurrent === "true" && "100%" } ;
116
+ opacity: ${ ( { isCurrent } ) => isCurrent === "true" && "1" } ;
117
+ }
118
+
119
+ &:hover + ${ Divider } {
120
+ width: 100%;
121
+ opacity: 1;
122
+ }
99
123
` ;
Original file line number Diff line number Diff line change 8
8
InputWrapper ,
9
9
DateContainer ,
10
10
DateSpan ,
11
+ Divider ,
11
12
} from "./DateInput.styles" ;
12
13
13
14
const DateInput = ( {
@@ -61,14 +62,19 @@ const DateInput = ({
61
62
onChange = { handleRangeChange }
62
63
/>
63
64
< DateContainer >
64
- { Object . keys ( dates ) . map ( ( date ) => (
65
- < DateSpan
66
- key = { date }
67
- year = { date }
68
- onClick = { ( ) => updateFields ( date ) }
69
- >
70
- { date }
71
- </ DateSpan >
65
+ { Object . keys ( dates ) . map ( ( date , index ) => (
66
+ < div key = { date } >
67
+ < DateSpan
68
+ isCurrent = { (
69
+ ( index + 1 ) . toString ( ) === inputRef ?. current ?. value || false
70
+ ) . toString ( ) }
71
+ active = { isLoading . toString ( ) }
72
+ onClick = { ( ) => updateFields ( date ) }
73
+ >
74
+ { date }
75
+ </ DateSpan >
76
+ < Divider />
77
+ </ div >
72
78
) ) }
73
79
</ DateContainer >
74
80
</ InputWrapper >
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ export const Form = styled.form`
12
12
flex-flow: column;
13
13
box-sizing: border-box;
14
14
width: 20rem;
15
- height: 100vh;
16
15
padding-right: 0.3rem;
17
16
18
17
max-height: 24rem;
You can’t perform that action at this time.
0 commit comments