-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Snackbar 제거 및 TransitionMotion 컴포넌트 추가 (#106)
- Loading branch information
Showing
12 changed files
with
84 additions
and
566 deletions.
There are no files selected for viewing
Binary file modified
BIN
-20 Bytes
(100%)
.yarn/cache/react-spring-npm-8.0.27-e2e99c79a8-8f041fd303.zip
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import React, { CSSProperties, ElementType, PropsWithChildren } from 'react'; | ||
import { TransitionKeyProps, useTransition, animated } from 'react-spring'; | ||
import { OverridableProps } from 'src/types/OverridableProps'; | ||
|
||
type Props<E extends ElementType = 'div'> = OverridableProps< | ||
E, | ||
{ | ||
flag: boolean; | ||
keys?: TransitionKeyProps | TransitionKeyProps[] | null; | ||
from?: Partial<CSSProperties>; | ||
enter?: Partial<CSSProperties> | Partial<CSSProperties>[]; | ||
leave?: Partial<CSSProperties> | Partial<CSSProperties>[]; | ||
onStart?: () => void; | ||
onDestroyed?: () => void; | ||
} | ||
>; | ||
const TransitionMotion = ({ | ||
flag, | ||
keys = null, | ||
from, | ||
enter, | ||
leave, | ||
children, | ||
onStart, | ||
onDestroyed, | ||
as, | ||
style, | ||
...rest | ||
}: PropsWithChildren<Props>) => { | ||
const transitions = useTransition(flag, keys, { | ||
from, | ||
enter, | ||
leave, | ||
onStart, | ||
onDestroyed, | ||
}); | ||
const Component = animated[as ?? 'div']; | ||
|
||
return ( | ||
<> | ||
{transitions.map(({ item, key, props }) => { | ||
return item ? ( | ||
<Component key={key} {...rest} style={{ ...style, ...props }}> | ||
{children} | ||
</Component> | ||
) : null; | ||
})} | ||
</> | ||
); | ||
}; | ||
|
||
export default TransitionMotion; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.