-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32942 from software-mansion-labs/ts-migration/gro…
…wl-notification [TS migration] Migrate 'GrowlNotification' component to TypeScript
- Loading branch information
Showing
18 changed files
with
72 additions
and
86 deletions.
There are no files selected for viewing
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
12 changes: 0 additions & 12 deletions
12
...nents/GrowlNotification/GrowlNotificationContainer/growlNotificationContainerPropTypes.js
This file was deleted.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
src/components/GrowlNotification/GrowlNotificationContainer/index.js
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
src/components/GrowlNotification/GrowlNotificationContainer/index.native.js
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
src/components/GrowlNotification/GrowlNotificationContainer/index.native.tsx
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,18 @@ | ||
import React from 'react'; | ||
import {Animated} from 'react-native'; | ||
import useSafeAreaInsets from '@hooks/useSafeAreaInsets'; | ||
import useStyleUtils from '@hooks/useStyleUtils'; | ||
import useThemeStyles from '@hooks/useThemeStyles'; | ||
import type GrowlNotificationContainerProps from './types'; | ||
|
||
function GrowlNotificationContainer({children, translateY}: GrowlNotificationContainerProps) { | ||
const styles = useThemeStyles(); | ||
const StyleUtils = useStyleUtils(); | ||
const insets = useSafeAreaInsets(); | ||
|
||
return <Animated.View style={[StyleUtils.getSafeAreaPadding(insets), styles.growlNotificationContainer, styles.growlNotificationTranslateY(translateY)]}>{children}</Animated.View>; | ||
} | ||
|
||
GrowlNotificationContainer.displayName = 'GrowlNotificationContainer'; | ||
|
||
export default GrowlNotificationContainer; |
22 changes: 22 additions & 0 deletions
22
src/components/GrowlNotification/GrowlNotificationContainer/index.tsx
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,22 @@ | ||
import React from 'react'; | ||
import {Animated} from 'react-native'; | ||
import useThemeStyles from '@hooks/useThemeStyles'; | ||
import useWindowDimensions from '@hooks/useWindowDimensions'; | ||
import type GrowlNotificationContainerProps from './types'; | ||
|
||
function GrowlNotificationContainer({children, translateY}: GrowlNotificationContainerProps) { | ||
const styles = useThemeStyles(); | ||
const {isSmallScreenWidth} = useWindowDimensions(); | ||
|
||
return ( | ||
<Animated.View | ||
style={[styles.growlNotificationContainer, styles.growlNotificationDesktopContainer, styles.growlNotificationTranslateY(translateY), isSmallScreenWidth && styles.mwn]} | ||
> | ||
{children} | ||
</Animated.View> | ||
); | ||
} | ||
|
||
GrowlNotificationContainer.displayName = 'GrowlNotificationContainer'; | ||
|
||
export default GrowlNotificationContainer; |
8 changes: 8 additions & 0 deletions
8
src/components/GrowlNotification/GrowlNotificationContainer/types.ts
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,8 @@ | ||
import type {Animated} from 'react-native'; | ||
import type ChildrenProps from '@src/types/utils/ChildrenProps'; | ||
|
||
type GrowlNotificationContainerProps = ChildrenProps & { | ||
translateY: Animated.Value; | ||
}; | ||
|
||
export default GrowlNotificationContainerProps; |
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 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 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 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 |
---|---|---|
|
@@ -50,4 +50,6 @@ export default { | |
success, | ||
}; | ||
|
||
export type {GrowlRef}; | ||
|
||
export {growlRef, setIsReady}; |
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 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