Skip to content

Commit

Permalink
add review nitpicks and changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cdOut committed Dec 13, 2023
1 parent 236b050 commit f6828ab
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react';
import {Animated} from 'react-native';
import withWindowDimensions from '@components/withWindowDimensions';
import {WindowDimensionsProps} from '@components/withWindowDimensions/types';
import useWindowDimensions from '@hooks/useWindowDimensions';
import useThemeStyles from '@styles/useThemeStyles';
import GrowlNotificationContainerProps from './types';

function GrowlNotificationContainer({children, translateY, isSmallScreenWidth}: GrowlNotificationContainerProps & WindowDimensionsProps) {
function GrowlNotificationContainer({children, translateY}: GrowlNotificationContainerProps) {
const styles = useThemeStyles();
const {isSmallScreenWidth} = useWindowDimensions();

return (
<Animated.View
Expand All @@ -19,4 +19,4 @@ function GrowlNotificationContainer({children, translateY, isSmallScreenWidth}:

GrowlNotificationContainer.displayName = 'GrowlNotificationContainer';

export default withWindowDimensions(GrowlNotificationContainer);
export default GrowlNotificationContainer;
3 changes: 2 additions & 1 deletion src/components/GrowlNotification/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const INACTIVE_POSITION_Y = -255;

const PressableWithoutFeedback = Pressables.PressableWithoutFeedback;

function GrowlNotification({ref}: GrowlNotificationProps) {
// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unused-vars
function GrowlNotification({_, ref}: GrowlNotificationProps) {
const translateY = useRef(new Animated.Value(INACTIVE_POSITION_Y)).current;
const [bodyText, setBodyText] = useState('');
const [type, setType] = useState('success');
Expand Down
7 changes: 6 additions & 1 deletion src/components/GrowlNotification/types.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import {ForwardedRef} from 'react';

type GrowlRef = {
show?: (bodyText: string, type: string, duration: number) => void;
};

type GrowlNotificationProps = {
ref: React.RefObject<GrowlRef>;
// eslint-disable-next-line @typescript-eslint/naming-convention
_: unknown;

ref: ForwardedRef<GrowlRef>;
};

export type {GrowlRef, GrowlNotificationProps};

0 comments on commit f6828ab

Please sign in to comment.