Skip to content

Commit

Permalink
[Fix] 전체화면 권장 제거 (#409)
Browse files Browse the repository at this point in the history
* fix: 지원서 다시보기 누를 시 alert 뜨는 거 제거

* chore: 안 쓰는 코드 제거
  • Loading branch information
eonseok-jeon authored Aug 17, 2024
1 parent b785abb commit dbd0713
Showing 1 changed file with 7 additions and 18 deletions.
25 changes: 7 additions & 18 deletions src/views/MyPage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { track } from '@amplitude/analytics-browser';
import { MouseEvent, useContext } from 'react';
import { useContext } from 'react';

import Button from '@components/Button';
import Callout from '@components/Callout';
Expand Down Expand Up @@ -35,26 +35,15 @@ const MyInfoItem = ({ label, value }: { label: string; value?: string | number |
const StatusButton = ({ label, to, trackingEvent }: { label: string; to: string; trackingEvent: string }) => {
const deviceType = useDevice();

const handlePreventMobile = (e: MouseEvent<HTMLButtonElement>) => {
track(trackingEvent);
if (label === '지원상태') return;

const isMobile = /Mobi/i.test(window.navigator.userAgent);
if (isMobile) {
alert('PC로 이용해주세요.');
e.preventDefault();
return;
}
if (deviceType !== 'DESK') {
alert('전체화면 이용을 권장드려요.');
return;
}
};

return (
<li className={buttonValue}>
<span className={infoLabelVar[deviceType]}>{label}</span>
<Button isLink to={to} className={buttonWidthVar[deviceType]} onClick={handlePreventMobile} padding="15x25">
<Button
isLink
to={to}
className={buttonWidthVar[deviceType]}
onClick={() => track(trackingEvent)}
padding="15x25">
{label === '지원서' ? '지원서 확인' : '결과 확인'}
</Button>
</li>
Expand Down

0 comments on commit dbd0713

Please sign in to comment.