Skip to content

Commit

Permalink
fix: position drawer rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
nzambello committed Apr 17, 2024
1 parent a535462 commit 02766ac
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/components/MemoriWidget/MemoriWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
Invitation,
GamificationLevel,
Tenant,
Asset,
MemoriSession,
User,
ExpertReference,
Expand Down
1 change: 1 addition & 0 deletions src/components/PositionDrawer/PositionDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const PositionDrawer = ({ open, onClose, venue, setVenue }: Props) => {
open={open}
onClose={() => onClose(venue)}
title={t('widget.position') || 'Position'}
animated={false}
>
<VenueWidget venue={venue} setVenue={setVenue} showUncertainty={false} />
</Drawer>
Expand Down
6 changes: 4 additions & 2 deletions src/components/VenueWidget/VenueWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ const VenueWidget = ({
<div className="memori--venue-widget-search">
<Combobox
value={
(venue
(venue?.latitude && venue?.longitude
? {
place_id: 0,
lat: venue?.latitude,
Expand All @@ -266,7 +266,9 @@ const VenueWidget = ({
>
<Combobox.Input
className="memori--venue-widget-search--input"
displayValue={(i: NominatimItem) => getPlaceName(i)}
displayValue={(i: NominatimItem) =>
i ? getPlaceName(i) : ''
}
placeholder={t('searchVenue')}
onChange={e => onQueryChange(e.target.value)}
/>
Expand Down
7 changes: 5 additions & 2 deletions src/components/ui/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface Props {
children: JSX.Element | React.ReactNode;
footer?: JSX.Element | React.ReactNode;
loading?: boolean;
animated?: boolean;
closable?: boolean;
side?: 'left' | 'right';
width?: string;
Expand All @@ -30,6 +31,7 @@ const Drawer: FC<Props> = ({
children,
footer,
loading = false,
animated = true,
side = 'right',
closable = true,
width = '100%',
Expand All @@ -56,13 +58,14 @@ const Drawer: FC<Props> = ({
<div className="memori-drawer--container">
<div className="memori-drawer--container-scrollable">
<Transition.Child
static
as={React.Fragment}
enter="ease-out duration-300"
enterFrom="max-w-0 opacity-0"
enterFrom={animated ? 'max-w-0 opacity-0' : 'opacity-0'}
enterTo="max-w-80 opacity-100"
leave="ease-in duration-200"
leaveFrom="max-w-80 opacity-100"
leaveTo="max-w-0 opacity-0"
leaveTo={animated ? 'max-w-0 opacity-0' : 'opacity-0'}
>
<Dialog.Panel
className={cx('memori-drawer--panel', {
Expand Down

0 comments on commit 02766ac

Please sign in to comment.