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: Confirm 컴포넌트 구현 #22

Merged
merged 2 commits into from
Jan 29, 2024
Merged

feat: Confirm 컴포넌트 구현 #22

merged 2 commits into from
Jan 29, 2024

Conversation

Puterism
Copy link
Member

  • Confirm 컴포넌트 구현

    • 스크린샷 2024-01-28 오후 10 08 42
  • 사용 예시는 HomePage.tsx를 참고해주세요.

@Puterism Puterism self-assigned this Jan 28, 2024
Copy link

netlify bot commented Jan 28, 2024

Deploy Preview for boolti-admin ready!

Name Link
🔨 Latest commit 436448e
🔍 Latest deploy log https://app.netlify.com/sites/boolti-admin/deploys/65b796ce76e3610008108c74
😎 Deploy Preview https://deploy-preview-22--boolti-admin.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 28, 2024

Deploy Preview for boolti-super-admin ready!

Name Link
🔨 Latest commit 436448e
🔍 Latest deploy log https://app.netlify.com/sites/boolti-super-admin/deploys/65b796ce2875390008e00e91
😎 Deploy Preview https://deploy-preview-22--boolti-super-admin.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 28, 2024

Deploy Preview for boolti-preview ready!

Name Link
🔨 Latest commit 436448e
🔍 Latest deploy log https://app.netlify.com/sites/boolti-preview/deploys/65b796ce3cf759000800dc66
😎 Deploy Preview https://deploy-preview-22--boolti-preview.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

packages/ui/src/components/Confirm/index.tsx Outdated Show resolved Hide resolved

return useCallback(
(message: React.ReactNode, buttonText?: ConfirmButtonText) => {
return new Promise<boolean>((resolve) => {
Copy link
Member

Choose a reason for hiding this comment

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

Promise로 만든 이유가 따로 있을까?

Copy link
Member Author

@Puterism Puterism Jan 29, 2024

Choose a reason for hiding this comment

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

const result = confirm()의 형태로 Confirm 컴포넌트를 사용하려면, 컴포넌트가 띄워지고, 확인/취소 버튼 중 어떤 것이 눌렸는지 결과가 바로 반환되는 것이 아니기 때문에 Promise로 resolve해야 한다고 생각했어. 다른 방법이 있을까?

Copy link
Member

Choose a reason for hiding this comment

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

이해했다! 굿굿 나중 생각해서 훨씬 좋을 것 같네!

@Puterism Puterism merged commit 05706a0 into main Jan 29, 2024
13 checks passed
@Puterism Puterism deleted the feature/confirm branch January 29, 2024 12:27
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