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

Migrate Toast component with scss #1950

Merged
merged 25 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
30dc59c
feat(toast): add scss module
sungik-choi Jan 24, 2024
0ea75bc
feat(toast): apply scss module to ToastElement
sungik-choi Jan 24, 2024
8a94c61
refactor(toast): rm useMemo, etc
sungik-choi Jan 24, 2024
429ce62
feat(toast): apply scss module to conatiner
sungik-choi Jan 24, 2024
d3f6545
refactor(toast): inline toast container
sungik-choi Jan 24, 2024
8ded4ee
feat(toast): inline toast element & refactor dismiss logic to use css…
sungik-choi Jan 25, 2024
223c931
refactor: inline ToastController to ToastProvider and rename to Toast
sungik-choi Jan 25, 2024
82e5f36
refactor: inline ToastContext
sungik-choi Jan 25, 2024
9280753
refactor: merge files and rm unused code
sungik-choi Jan 25, 2024
13612dd
refactor: refine types
sungik-choi Jan 25, 2024
daa2221
refactor: rename dir (ToastProvider to Toast)
sungik-choi Jan 25, 2024
bdc44b2
test: cleanup story
sungik-choi Jan 25, 2024
3b4d152
feat: deprecate actionContent, onClick prop
sungik-choi Jan 25, 2024
4d3f22f
feat: export ToastProviderProps
sungik-choi Jan 25, 2024
477861c
feat: apply inverted theme
sungik-choi Jan 25, 2024
bb4c8eb
refactor: changing from renaming a class to changing a boolean variable
sungik-choi Jan 25, 2024
eb9c270
refactor: rm unnecessary transform style
sungik-choi Jan 29, 2024
d5133ed
feat: add status role
sungik-choi Jan 29, 2024
30c69a6
feat: rm unused version prop
sungik-choi Jan 29, 2024
dc892b1
feat: add missed default prop and conditional logic
sungik-choi Jan 29, 2024
039681a
test: update test cases
sungik-choi Jan 29, 2024
be23254
revert: reverts removing version prop
sungik-choi Jan 29, 2024
906656e
refactor: change order
sungik-choi Jan 29, 2024
4fe83c7
test: add long text cases
sungik-choi Jan 29, 2024
f5ba805
chore(changeset): add changeset
sungik-choi Jan 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/bezier-react/src/components/Toast/Toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export function Toast({
zIndex = 'toast',
autoDismiss = true,
autoDismissTimeout,
version = 0,
Copy link
Collaborator

Choose a reason for hiding this comment

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

version 속성은 언제 필요한 것인가요?

Copy link
Contributor Author

@sungik-choi sungik-choi Jan 30, 2024

Choose a reason for hiding this comment

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

ToastService 에서 update 시 version이 변하는데, timer를 set하는 effect에서 version을 deps로 가집니다. 즉, 업데이트가 되는 토스트를 계속 보여지는 상태로 두기 위해 타이머를 초기화하는 부분으로 보여요 (#909)

onDismiss,
}: ToastProps) {
const { window } = useWindow()
Expand Down Expand Up @@ -125,6 +126,7 @@ export function Toast({
autoDismissTimeout,
runSlideOutAnimation,
window,
version,
])

const {
Expand Down
10 changes: 10 additions & 0 deletions packages/bezier-react/src/components/Toast/Toast.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ interface ToastOwnProps {
zIndex?: ZIndex
autoDismiss?: boolean
autoDismissTimeout?: number
/**
* Updated toast version
* @default 0
*/
version?: number
onDismiss?: () => void
}

Expand Down Expand Up @@ -81,6 +86,11 @@ export type ToastOptions =
export type ToastType = ToastOptions & {
id: ToastId
content: ToastContent
/**
* Updated version
* @default 0
*/
version?: number
}

export interface ToastContextValue {
Expand Down