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

Toast 구현 with Jotai #166

Merged
merged 2 commits into from
May 30, 2023
Merged

Toast 구현 with Jotai #166

merged 2 commits into from
May 30, 2023

Conversation

sjoleee
Copy link
Member

@sjoleee sjoleee commented May 26, 2023

🤔 해결하려는 문제가 무엇인가요?

#91

🎉 변경 사항

Toast 컴포넌트를 Jotai로 구현했습니다.

🙏 여기는 꼭 봐주세요!

사용 방법

useToast의 fireToast로 toast를 띄울 수 있습니다.
아이콘과 문구가 동시에 들어가는 경우가 있는 것 같은데, 이때는 Toast.Text 컴포넌트를 사용해주세요~!
그리고 CTA와 같이 있는 화면에서는 highterThanCTA 를 true로 주시면 좀 더 높은 위치에 띄워집니다~!

  const { fireToast } = useToast();

  return (
    <div>
      // 예제 1
      <button type="button" onClick={() => fireToast({ content: '토스트 메세지 입니다' })}>
        토스트 발사
      </button>

      // 예제 2
      <button
        type="button"
        onClick={() =>
          fireToast({
            content: (
              <>
                <WarningIcon />
                <Toast.Text>토스트 메시지 with 아이콘</Toast.Text>
              </>
            ),
            higherThanCTA: true,
          })
        }
      >
        다른 토스트 발사
      </button>
    </div>
  );

🌄 스크린샷

📚 참고

@sjoleee sjoleee added the feat New feature or request label May 26, 2023
@sjoleee sjoleee requested a review from hyesungoh as a code owner May 26, 2023 15:34
@sjoleee sjoleee self-assigned this May 26, 2023
@github-actions
Copy link

Bundle Sizes

Compared against be296b6

Route Size (gzipped) Diff
/ 75.64 KB -4.42 KB
/_app 185.72 KB +6.09 KB
/review/[token] 76.47 KB -4.41 KB
/survey 78.97 KB -4.57 KB
/survey/create 82.68 KB -4.43 KB
/survey/intro 78.97 KB -4.57 KB

Dynamic import: No significant changes found

@cloudflare-workers-and-pages
Copy link

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: b9413d1
Status: ✅  Deploy successful!
Preview URL: https://6faf5a91.na-lab.pages.dev
Branch Preview URL: https://feat-toast-jotai.na-lab.pages.dev

View logs

@codecov-commenter
Copy link

Codecov Report

Patch and project coverage have no change.

Comparison is base (be296b6) 92.39% compared to head (b9413d1) 92.39%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #166   +/-   ##
=======================================
  Coverage   92.39%   92.39%           
=======================================
  Files          38       38           
  Lines         276      276           
  Branches       51       51           
=======================================
  Hits          255      255           
  Misses         21       21           

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@sumi-0011 sumi-0011 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다 👍🏻

전역상태 고려해주셔서 감사합니다 🙇

Copy link
Member

@hyesungoh hyesungoh left a comment

Choose a reason for hiding this comment

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

고생하셨습니다 👍 👍 👍 💯

Comment on lines +34 to +39
const Toast = {
Content,
Text,
};

export default Toast;
Copy link
Member

Choose a reason for hiding this comment

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

컴파운드 맛있다 !! 👍 👍

@sjoleee sjoleee merged commit c50af38 into main May 30, 2023
@sjoleee sjoleee deleted the feat/toast-jotai branch May 30, 2023 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants