Skip to content

Commit

Permalink
Merge pull request #36 from 4bujak-4bujak/feature/meetingroomQA
Browse files Browse the repository at this point in the history
fix: 사파리, 크롬 설치앱 구분
  • Loading branch information
jiohjung98 authored Jun 9, 2024
2 parents b7ecdfc + bf314b2 commit 194578d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/components/map/UseMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ const UseMap: React.FC = () => {
const [branchCount, SetBranchCount] = useState(0);
const [canBranchCount, SetCanBranchCount] = useState(0);
const [isIOS, setIsIOS] = useState(false);
const [isStandalone, setIsStandalone] = useState(false);

useEffect(() => {
const userAgent = window.navigator.userAgent;
if (/iPad|iPhone|iPod/.test(userAgent) && !(window as any).MSStream) {
setIsIOS(true);
}
setIsIOS(/iPad|iPhone|iPod/.test(userAgent) && !(window as any).MSStream);
setIsStandalone(window.matchMedia('(display-mode: standalone)').matches);
}, []);

useEffect(() => {
Expand Down Expand Up @@ -285,14 +285,13 @@ const UseMap: React.FC = () => {
/>
<button
id="current-location-button"
className={`absolute ${isModalOpen ? 'bottom-[300px]' : 'bottom-[105px]'} left-4 p-2 flex items-center justify-center ${isIOS ? 'mb-16' : ''}`}
className={`absolute ${isModalOpen ? 'bottom-[300px]' : 'bottom-[105px]'} left-4 p-2 flex items-center justify-center ${isIOS && !isStandalone ? 'mb-16' : ''}`}
onMouseEnter={() => setImageSrc('/map/MapLocationActive.png')}
onMouseLeave={() => setImageSrc('/map/MapLocation.png')}
onClick={handleCurrentLocationClick}
>
<Image src={imageSrc} alt="Current Location" width={48} height={48} />
</button>

{loading && (
<div className="absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center">
<div className="loader"></div>
Expand Down

0 comments on commit 194578d

Please sign in to comment.