Skip to content

Commit

Permalink
Merge pull request #119 from nada-deriv/nada/FEQ-1712/date-filter
Browse files Browse the repository at this point in the history
Nada/feq 1712/date filter
  • Loading branch information
farrah-deriv authored Jun 12, 2024
2 parents 0daa7a0 + be57cd0 commit e8eb9db
Show file tree
Hide file tree
Showing 28 changed files with 871 additions and 20 deletions.
94 changes: 90 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@babel/preset-env": "^7.24.5",
"@deriv-com/api-hooks": "^1.1.1",
"@deriv-com/translations": "^1.2.4",
"@deriv-com/ui": "^1.27.9",
"@deriv-com/ui": "^1.28.0",
"@deriv-com/utils": "^0.0.25",
"@deriv/deriv-api": "^1.0.15",
"@deriv/quill-design": "^1.2.24",
Expand All @@ -36,6 +36,7 @@
"moment": "^2.30.1",
"qrcode.react": "^3.1.0",
"react": "^18.2.0",
"react-calendar": "^5.0.0",
"react-dom": "^18.2.0",
"react-dropzone": "^14.2.3",
"react-hook-form": "^7.51.1",
Expand Down
147 changes: 147 additions & 0 deletions src/components/DatePicker/DatePicker.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
.datepicker {
display: flex;
flex-direction: column;
position: relative;
caret-color: transparent;

&__button {
all: unset;
cursor: pointer;

&:disabled {
filter: invert(92%) sepia(0%) saturate(112%) hue-rotate(253deg) brightness(106%) contrast(89%);
}
}

&__container {
position: absolute;
display: inline-block;
width: 28rem;
z-index: 1;

&--right {
right: 0;
}

top: 4rem;

@include mobile {
align-self: center;
top: 5rem;
left: 0;
}

.react-calendar {
border-radius: 0.5rem;

button {
border-radius: 0.5rem;
}

&__navigation {
border-bottom: 0.1rem solid #d6dadb;
height: 5rem;
padding: 1.6rem;
margin-bottom: 0;

&__arrow {
font-size: 2.4rem;
justify-content: center;
align-items: center;
}

&__label {
font-weight: bold;
font-size: 1.4rem;
margin-top: 0.5rem;
display: flex;
justify-content: center;
}

button {
min-width: 2.4rem;
padding: 0 0.6rem;
border-radius: 0.5rem;

&:enabled:hover,
&:enabled:focus,
&:disabled {
background-color: unset;
}
}
}

&__viewContainer {
padding: 0.8rem 2rem;
}

&__month-view {
&__days,
&__weekdays {
/* stylelint-disable-next-line declaration-no-important */
display: grid !important; // to overwrite flex property of calendar
grid-template-columns: repeat(7, 2.4rem);
grid-auto-rows: 2.4rem;
grid-gap: 1.2rem;
align-items: center;
justify-content: center;

&__day--neighboringMonth {
color: #757575;
}

&__day--weekend {
color: revert;
}

&__weekday {
font-size: 1.2rem;
}
abbr {
text-decoration: none;
}
}

&__weekdays {
margin-bottom: 1.2rem;
}

button {
min-width: 2.4rem;
padding: 0.6rem;
border-radius: 0.5rem;
}
}

&__tile {
font-size: 1.2rem;

&--active,
&--hasActive {
border-radius: 0.5rem;
background: #d6dadb;
color: unset;

&:enabled:hover,
&:enabled:focus {
background-color: #d6dadb;
}
}

&--active {
font-weight: bold;
}

&--now,
&:disabled {
background-color: unset;
}
}
}

/* stylelint-disable-next-line selector-class-pattern */
.react-calendar__month-view__days__day--weekend.react-calendar__month-view__days__day--neighboringMonth {
color: #757575;
}
}
}
Loading

0 comments on commit e8eb9db

Please sign in to comment.