Skip to content

Commit

Permalink
fix: 지원서 다시보기 누를 시 alert 뜨는 거 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
eonseok-jeon committed Aug 17, 2024
1 parent b785abb commit ae791fb
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions src/views/MyPage/index.tsx
Original file line number Diff line number Diff line change
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 ae791fb

Please sign in to comment.