Skip to content

Commit

Permalink
Merge pull request #77 from makeen-project/bugs_v2_main
Browse files Browse the repository at this point in the history
bugs v2
  • Loading branch information
dochiana authored Oct 21, 2023
2 parents 1817148 + 686581f commit 4b614a2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 34 deletions.
36 changes: 11 additions & 25 deletions src/atomicui/molecules/Popup/Popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,21 @@ const Popup: React.FC<Props> = ({ active, info, select, onClosePopUp, setInfo })
const onClose = useCallback(
async (ui: ResponsiveUIEnum) => {
if (!isDesktop) {
setUI(ui);
setPOICard(undefined);
setInfo(undefined);
setUI(ui);
setBottomSheetMinHeight(window.innerHeight * 0.4 - 10);
setBottomSheetHeight(window.innerHeight * 0.4);
setTimeout(() => {
setBottomSheetMinHeight(BottomSheetHeights.explore.min);
setBottomSheetHeight(window.innerHeight);
}, 500);
}

await select(undefined);
onClosePopUp && onClosePopUp();
},
[isDesktop, select, onClosePopUp, setUI, setPOICard, setInfo]
[isDesktop, select, onClosePopUp, setPOICard, setInfo, setUI, setBottomSheetMinHeight, setBottomSheetHeight]
);

const onGetDirections = useCallback(() => {
Expand Down Expand Up @@ -256,18 +263,7 @@ const Popup: React.FC<Props> = ({ active, info, select, onClosePopUp, setInfo })
() => (
<Flex ref={POICardRef} className={!isDesktop ? "poi-only-container" : ""} direction="column">
<View className="popup-icon-close-container">
<IconClose
onClick={() => {
onClose(ResponsiveUIEnum.search);
setBottomSheetMinHeight(window.innerHeight * 0.4 - 10);
setBottomSheetHeight(window.innerHeight * 0.4);

setTimeout(() => {
setBottomSheetMinHeight(BottomSheetHeights.explore.min);
setBottomSheetHeight(window.innerHeight);
}, 500);
}}
/>
<IconClose onClick={() => onClose(ResponsiveUIEnum.search)} />
</View>
{isDesktop && (
<View className="triangle-container">
Expand Down Expand Up @@ -306,17 +302,7 @@ const Popup: React.FC<Props> = ({ active, info, select, onClosePopUp, setInfo })
</View>
</Flex>
),
[
address,
info.Place?.Label,
isDesktop,
onClose,
onGetDirections,
renderRouteInfo,
setBottomSheetHeight,
setBottomSheetMinHeight,
t
]
[address, info.Place?.Label, isDesktop, onClose, onGetDirections, renderRouteInfo, t]
);

useEffect(() => {
Expand Down
9 changes: 6 additions & 3 deletions src/atomicui/organisms/SearchBox/SearchBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,15 @@ const SearchBox: React.FC<SearchBoxProps> = ({
} else {
return Object.keys(clusters).reduce((acc, key) => {
const cluster = clusters[key];
const containsSelectedPoi = selectedMarker?.Hash?.includes(key);
const s = containsSelectedPoi ? cluster.find(i => i.Hash === selectedMarker?.Hash) || cluster[0] : cluster[0];
// const containsSelectedPoi = selectedMarker?.Hash?.includes(key);
// const s = containsSelectedPoi ? cluster.find(i => i.Hash === selectedMarker?.Hash) || cluster[0] : cluster[0];
const containsSelectedPoi = cluster.find(o => o.Id === selectedMarker?.Id) ? true : false;
const s = containsSelectedPoi ? cluster.find(o => o.Id === selectedMarker?.Id) || cluster[0] : cluster[0];

acc.push(
<SuggestionMarker
key={`${s.Hash}_${key}`}
// key={`${s.Hash}_${key}`}
key={s.Id}
active={s.Place?.Label === selectedMarker?.Place?.Label && s.Id === selectedMarker?.Id}
searchValue={value}
setSearchValue={setValue}
Expand Down
12 changes: 6 additions & 6 deletions src/atomicui/pages/DemoPage/DemoPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -378,18 +378,18 @@ const DemoPage: React.FC = () => {
padding: {
top: 100,
bottom: 100,
left: 390,
right: 50
left: 400,
right: 100
},
speed: 5,
linear: false
linear: true
}
: {
padding: {
top: 50,
top: 100,
bottom: 400,
left: 60,
right: 70
left: 100,
right: 100
},
speed: 5,
linear: true
Expand Down

0 comments on commit 4b614a2

Please sign in to comment.