Add permission check to key-in payment page
- Add grant check (56, 'D') to key-in payment download button - Move onClick from img to button element for better accessibility Changes: - key-in-payment-page: Add permission check for download 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -25,6 +25,8 @@ import { EmailBottomSheet } from '@/entities/common/ui/email-bottom-sheet';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useExtensionAccessCheck } from '@/shared/lib/hooks/use-extension-access-check';
|
import { useExtensionAccessCheck } from '@/shared/lib/hooks/use-extension-access-check';
|
||||||
import useIntersectionObserver from '@/widgets/intersection-observer';
|
import useIntersectionObserver from '@/widgets/intersection-observer';
|
||||||
|
import { checkGrant } from '@/shared/lib/check-grant';
|
||||||
|
import { showAlert } from '@/widgets/show-alert';
|
||||||
|
|
||||||
export const KeyInPaymentPage = () => {
|
export const KeyInPaymentPage = () => {
|
||||||
const { navigate } = useNavigate();
|
const { navigate } = useNavigate();
|
||||||
@@ -133,6 +135,10 @@ export const KeyInPaymentPage = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onClickToOpenEmailBottomSheet = () => {
|
const onClickToOpenEmailBottomSheet = () => {
|
||||||
|
if (!checkGrant(56, 'D')) {
|
||||||
|
showAlert(t('common.nopermission'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
setEmailBottomSheetOn(true);
|
setEmailBottomSheetOn(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -207,11 +213,11 @@ export const KeyInPaymentPage = () => {
|
|||||||
<button
|
<button
|
||||||
className="download-btn"
|
className="download-btn"
|
||||||
aria-label="다운로드"
|
aria-label="다운로드"
|
||||||
|
onClick={onClickToOpenEmailBottomSheet}
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
src={IMAGE_ROOT + '/ico_download.svg'}
|
src={IMAGE_ROOT + '/ico_download.svg'}
|
||||||
alt="다운로드"
|
alt="다운로드"
|
||||||
onClick={() => onClickToOpenEmailBottomSheet()}
|
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user