diff --git a/components/common/DialogContent/index.module.scss b/components/common/DialogContent/index.module.scss index 9d5e4882..767dccd8 100644 --- a/components/common/DialogContent/index.module.scss +++ b/components/common/DialogContent/index.module.scss @@ -16,8 +16,8 @@ .dialogContent { $multiplier: 4; - // animation: $duration-modal-open cubic-bezier(0.16, 1, 0.3, 1) 0s 1 normal - // none running openModalDesktop; + animation: $duration-modal-open cubic-bezier(0.16, 1, 0.3, 1) 0s 1 normal + none running openModalDesktop; background: var(--dialog-bg); border-radius: $card-corner; box-sizing: border-box; @@ -31,7 +31,7 @@ // min-height: $unit-12x; overflow-y: auto; // height: 80vh; - max-height: 80vh; + // max-height: 80vh; // Having a max-height interferes with SearchModal scrolling min-width: 580px; max-width: 42vw; // padding: $unit * $multiplier; @@ -42,11 +42,11 @@ } @include breakpoint(phone) { - // animation: slideUp; - // animation-duration: 3s; - // animation-fill-mode: forwards; - // animation-play-state: running; - // animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); + animation: slideUp; + animation-duration: 1s; + animation-fill-mode: forwards; + animation-play-state: running; + animation-timing-function: ease-out; border-bottom-left-radius: 0; border-bottom-right-radius: 0; min-width: inherit; @@ -59,6 +59,25 @@ width: 100%; } + &.search { + box-sizing: border-box; + display: flex; + flex-direction: column; + min-height: 430px; + padding: 0; + + @include breakpoint(phone) { + // animation: none; + min-width: inherit; + height: 90vh; + + .container { + display: flex; + flex-direction: column; + } + } + } + .container { overflow-y: hidden; @@ -187,4 +206,26 @@ } } } + + @keyframes openModalDesktop { + 0% { + opacity: 0; + transform: scale(0.96); + } + + 100% { + // opacity: 1; + transform: scale(1); + } + } + + @keyframes slideUp { + 0% { + transform: translate(0%, 100%); + } + + 100% { + transform: translate(0, 0%); + } + } } diff --git a/components/common/DialogContent/index.tsx b/components/common/DialogContent/index.tsx index 63a4fcc5..e5842950 100644 --- a/components/common/DialogContent/index.tsx +++ b/components/common/DialogContent/index.tsx @@ -23,9 +23,12 @@ const DialogContent = React.forwardRef(function Dialog( forwardedRef ) { // Classes - const classes = classNames(props.className, { - [styles.dialogContent]: true, - }) + const classes = classNames( + { + [styles.dialogContent]: true, + }, + props.className?.split(' ').map((className) => styles[className]) + ) // Handlers function handleScroll(event: React.UIEvent) { diff --git a/components/common/DialogFooter/index.module.scss b/components/common/DialogFooter/index.module.scss index 3f468f92..1470f420 100644 --- a/components/common/DialogFooter/index.module.scss +++ b/components/common/DialogFooter/index.module.scss @@ -3,7 +3,7 @@ align-items: flex-end; background: var(--dialog-bg); - bottom: 0; + bottom: -1px; // hack to fix content being visible 1px below box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.16); border-top: 1px solid rgba(0, 0, 0, 0.24); display: flex; diff --git a/components/search/SearchModal/index.module.scss b/components/search/SearchModal/index.module.scss index 37c517f3..751a6e6f 100644 --- a/components/search/SearchModal/index.module.scss +++ b/components/search/SearchModal/index.module.scss @@ -1,96 +1,101 @@ -.Search.DialogContent { - box-sizing: border-box; +.header { + align-items: inherit; display: flex; flex-direction: column; - min-height: 430px; + gap: $unit; padding: 0; + padding-bottom: $unit; + position: sticky; + top: 0; + left: 0; - @include breakpoint(phone) { - animation: none; - border-radius: 0; - min-width: inherit; - min-height: 100vh; + .close { + background: transparent; + border: none; + + &:hover { + cursor: pointer; + + svg { + fill: $error; + } + } + + svg { + fill: $grey-50; + float: right; + height: 24px; + width: 24px; + } } - .DialogHeader.Search { - align-items: inherit; + .searchBar { + align-items: center; + border-top-left-radius: $unit; + border-top-right-radius: $unit; display: flex; - flex-direction: column; - gap: $unit; - padding: 0; - padding-bottom: $unit-2x; + gap: $unit * 2.5; + margin: 0; + padding: ($unit * 3) ($unit * 3) 0 ($unit * 3); position: sticky; top: 0; - left: 0; - #Bar { - align-items: center; - border-top-left-radius: $unit; - border-top-right-radius: $unit; - display: flex; - gap: $unit * 2.5; - margin: 0; - padding: ($unit * 3) ($unit * 3) 0 ($unit * 3); - position: sticky; - top: 0; + button { + background: transparent; + border: none; + height: 42px; + padding: 0; + } - button { - background: transparent; - border: none; - height: 42px; - padding: 0; - } + label { + width: 100%; - label { - width: 100%; - - // .Input { - // background: $grey-90; - // border: none; - // border-radius: calc($unit / 2); - // box-sizing: border-box; - // font-size: $font-regular; - // padding: $unit * 1.5; - // text-align: left; - // width: 100%; - // } - } + // .Input { + // background: $grey-90; + // border: none; + // border-radius: calc($unit / 2); + // box-sizing: border-box; + // font-size: $font-regular; + // padding: $unit * 1.5; + // text-align: left; + // width: 100%; + // } } } +} - #Results { - margin: 0; - padding: 0 ($unit * 1.5); - padding-bottom: $unit * 1.5; +.results { + margin: 0; + padding: 0 ($unit * 1.5); + padding-bottom: $unit * 1.5; - // Infinite scroll - overflow-y: auto; - max-height: 500px; + // Infinite scroll + overflow-y: auto; + max-height: 500px; - @include breakpoint(phone) { - max-height: inherit; - } + @include breakpoint(phone) { + max-height: initial; + } - h5.total { - font-size: $font-regular; - font-weight: $normal; - color: var(--text-tertiary); - padding: $unit-half ($unit * 1.5); - } + h5.total { + font-size: $font-regular; + font-weight: $normal; + color: var(--text-tertiary); + padding: $unit-half ($unit * 1.5); + } - .footer { - align-items: center; - display: flex; - color: var(--text-tertiary); - font-size: $font-regular; - font-weight: $normal; - height: $unit-10x; - justify-content: center; - } + .footer { + align-items: center; + display: flex; + color: var(--text-tertiary); + font-size: $font-regular; + font-weight: $normal; + height: $unit-10x; + justify-content: center; + } - .WeaponResult:last-child { - margin-bottom: $unit * 1.5; - } + .WeaponResult:last-child { + margin-bottom: $unit * 1.5; } } diff --git a/components/search/SearchModal/index.tsx b/components/search/SearchModal/index.tsx index dee34ff6..b152445e 100644 --- a/components/search/SearchModal/index.tsx +++ b/components/search/SearchModal/index.tsx @@ -9,7 +9,7 @@ import api from '~utils/api' import { Dialog, DialogTrigger, DialogClose } from '~components/common/Dialog' import DialogContent from '~components/common/DialogContent' -import Input from '~components/common/LabelledInput' +import Input from '~components/common/Input' import CharacterSearchFilterBar from '~components/character/CharacterSearchFilterBar' import WeaponSearchFilterBar from '~components/weapon/WeaponSearchFilterBar' import SummonSearchFilterBar from '~components/summon/SummonSearchFilterBar' @@ -395,55 +395,49 @@ const SearchModal = (props: Props) => { if (searchInput.current) searchInput.current.focus() } + const filterBar = () => { + if (props.object === 'characters') { + return + } else if (props.object === 'weapons') { + return + } else if (props.object === 'summons') { + return + } else if (props.object === 'job_skills') { + return + } + } + return ( {props.children} -
-
+
+
- +
- {props.object === 'characters' ? ( - - ) : ( - '' - )} - {props.object === 'weapons' ? ( - - ) : ( - '' - )} - {props.object === 'summons' ? ( - - ) : ( - '' - )} - {props.object === 'job_skills' ? ( - - ) : ( - '' - )} -
+ {filterBar()} + -
-
+
+
{t('search.result_count', { record_count: recordCount })}
{open ? renderResults() : ''}