Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/uchida/832 modal tap off screen #834

Closed
wants to merge 3 commits into from

Conversation

uchida189
Copy link
Collaborator

協賛企業のモーダルをクリックで閉じるようにする #832

resolve #832

概要

ページでモーダルを閉じるときに✖︎ボタンを押さないと閉じれないから、モーダル外を押すと閉じるようにする

画面スクリーンショット等

  • URL
    スクリーンショット

テスト項目

  • 企業スタイルと企業活動のページで、modalが画面外のクリックで閉じるようになっているか

備考

@uchida189 uchida189 requested a review from Kubosaka July 7, 2024 13:32
@uchida189 uchida189 self-assigned this Jul 7, 2024
Copy link
Collaborator

@Kubosaka Kubosaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

動作は問題なさそうです!
いくつかコメントしました
/next-project/src/components/sponsoractivities/DetailModal.tsxでも閉じるようにしてください

Comment on lines +354 to +357
const closeModal = () => {
props.setIsOpen(false);
};

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

関数が広い行数にかかって書いてあるととっ散らかって可読性が下がるので、
213行目とかに移動してもらっていいですか
(このコンポーネント自体のコード自体すごく汚くて申し訳ありません)

Comment on lines +428 to +430
const closeModal = () => {
props.setIsOpen(false);
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こっちも同じ理由で201行とかに移動お願いします

@@ -24,7 +24,7 @@ const SponsorDeleteModal: FC<ModalProps> = (props) => {
};

return (
<Modal className='md:w-1/2'>
<Modal className='md:w-1/2' onClick={() => props.setShowModal(false)}>
<div className='w-full'>
<div className='ml-auto w-fit'>
<CloseButton onClick={() => props.setShowModal(false)} />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここも同じ処理をしているので関数にまとめてもらっていいですか?

const closeModal = () => {
    props.setIsOpen(false);
  };

return (
<Modal className='md:w-1/2'>
<Modal className='md:w-1/2' onClick={closeModal}>
<div className='w-full'>
<div className='ml-auto mr-5 w-fit'>
<CloseButton onClick={() => props.setIsOpen(false)} />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

46行目も処理同じなのでonClick={closeModal}にしてください!

return (
<Modal className='md:w-1/2'>
<Modal className='md:w-1/2' onClick={closeModal}>
<div className='w-full'>
<div className='ml-auto mr-5 w-fit'>
<CloseButton onClick={() => props.setIsOpen(false)} />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<CloseButton onClick={() => props.setIsOpen(false)} />
<CloseButton onClick={closeModal}>

Comment on lines +27 to 30
<Modal className='md:w-1/2' onClick={() => props.setShowModal(false)}>
<div className='w-full'>
<div className='ml-auto w-fit'>
<CloseButton onClick={() => props.setShowModal(false)} />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここもどこかでcloseModal関数を定義して、まとめてもらっていいですか?

const closeModal = () => {
    props.setIsOpen(false);
  };

@uchida189 uchida189 closed this Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

協賛企業のモーダルをクリックで閉じるようにする
2 participants