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

Fix all autoFixable problems inside app/common #6162

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
30 changes: 10 additions & 20 deletions apps/common-app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,14 @@ import {
GestureHandlerRootView,
RectButton,
} from 'react-native-gesture-handler';
import {
HeaderBackButton,
HeaderBackButtonProps,
} from '@react-navigation/elements';
import {
NativeStackNavigationProp,
createNativeStackNavigator,
} from '@react-navigation/native-stack';
import {
NavigationContainer,
NavigationProp,
PathConfigMap,
useNavigation,
} from '@react-navigation/native';
import {
StackNavigationProp,
createStackNavigator,
} from '@react-navigation/stack';
import type { HeaderBackButtonProps } from '@react-navigation/elements';
import { HeaderBackButton } from '@react-navigation/elements';
import type { NativeStackNavigationProp } from '@react-navigation/native-stack';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import type { NavigationProp, PathConfigMap } from '@react-navigation/native';
import { NavigationContainer, useNavigation } from '@react-navigation/native';
import type { StackNavigationProp } from '@react-navigation/stack';
import { createStackNavigator } from '@react-navigation/stack';

import AsyncStorage from '@react-native-async-storage/async-storage';
import { EXAMPLES } from './examples';
Expand All @@ -53,7 +43,7 @@ interface HomeScreenProps {
| NativeStackNavigationProp<RootStackParamList, 'Home'>;
}

const EXAMPLES_NAMES = Object.keys(EXAMPLES) as (keyof typeof EXAMPLES)[];
const EXAMPLES_NAMES = Object.keys(EXAMPLES);

function findExamples(search: string) {
if (search === '') {
Expand Down Expand Up @@ -181,7 +171,7 @@ function BackButton(props: HeaderBackButtonProps) {
const PERSISTENCE_KEY = 'NAVIGATION_STATE_V1';

export default function App() {
const [isReady, setIsReady] = React.useState(__DEV__ ? false : true);
const [isReady, setIsReady] = React.useState(!__DEV__);
const [initialState, setInitialState] = React.useState();

React.useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion apps/common-app/src/examples/AnimatedTabBarExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
} from '@fortawesome/free-solid-svg-icons';
import Svg, { Path } from 'react-native-svg';
import * as shape from 'd3-shape';
import { IconProp } from '@fortawesome/fontawesome-svg-core';
import type { IconProp } from '@fortawesome/fontawesome-svg-core';

const { width, height } = Dimensions.get('window');

Expand Down
6 changes: 2 additions & 4 deletions apps/common-app/src/examples/ChatHeadsExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ import Animated, {
withSpring,
clamp,
} from 'react-native-reanimated';
import {
PanGestureHandler,
PanGestureHandlerGestureEvent,
} from 'react-native-gesture-handler';
import type { PanGestureHandlerGestureEvent } from 'react-native-gesture-handler';
import { PanGestureHandler } from 'react-native-gesture-handler';

const { width: windowWidth, height: windowHeight } = Dimensions.get('window');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import { Text, View, StyleSheet } from 'react-native';
import type { NativeSyntheticEvent, NativeScrollEvent } from 'react-native';
import type { EventHandlerProcessed } from 'react-native-reanimated';
import Animated, {
EventHandlerProcessed,
interpolateColor,
useAnimatedScrollHandler,
useAnimatedStyle,
Expand Down
4 changes: 2 additions & 2 deletions apps/common-app/src/examples/CubesExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ function CubeWithEulerAngles() {
transformOrigin(matrix, origin);

return {
transform: [{ perspective: 1000 }, { matrix: matrix }],
transform: [{ perspective: 1000 }, { matrix }],
backgroundColor: sidesColors[i],
};
})
Expand Down Expand Up @@ -261,7 +261,7 @@ function CubeWithQuaternions() {
transformOrigin(matrix, origin);

return {
transform: [{ perspective: 1000 }, { matrix: matrix }],
transform: [{ perspective: 1000 }, { matrix }],
backgroundColor: sidesColors[i],
};
})
Expand Down
16 changes: 4 additions & 12 deletions apps/common-app/src/examples/CustomHandler/AnimatedText.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
import React from 'react';
import {
StyleProp,
StyleSheet,
TextInput,
TextInputProps,
TextStyle,
} from 'react-native';
import Animated, {
SharedValue,
useAnimatedProps,
} from 'react-native-reanimated';
import type { AnimatedStyle } from 'react-native-reanimated';
import type { StyleProp, TextInputProps, TextStyle } from 'react-native';
import { StyleSheet, TextInput } from 'react-native';
import Animated, { useAnimatedProps } from 'react-native-reanimated';
import type { AnimatedStyle, SharedValue } from 'react-native-reanimated';

Animated.addWhitelistedNativeProps({ text: true });

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import type { SharedValue } from 'react-native-reanimated';
import Animated, {
SharedValue,
useDerivedValue,
useSharedValue,
} from 'react-native-reanimated';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {
import type {
PageScrollStateChangedNativeEvent,
PagerViewOnPageScrollEvent,
PagerViewOnPageSelectedEvent,
Expand Down
6 changes: 2 additions & 4 deletions apps/common-app/src/examples/DragAndSnapExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ import Animated, {
interpolate,
Extrapolation,
} from 'react-native-reanimated';
import {
PanGestureHandler,
PanGestureHandlerGestureEvent,
} from 'react-native-gesture-handler';
import type { PanGestureHandlerGestureEvent } from 'react-native-gesture-handler';
import { PanGestureHandler } from 'react-native-gesture-handler';

export default function DragAndSnapExample() {
const translation = {
Expand Down
2 changes: 1 addition & 1 deletion apps/common-app/src/examples/EmojiWaterfallExample.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { SharedValue } from 'react-native-reanimated';
import Animated, {
Easing,
SharedValue,
interpolate,
useAnimatedStyle,
useSharedValue,
Expand Down
6 changes: 2 additions & 4 deletions apps/common-app/src/examples/ExtrapolationExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ import Animated, {
withTiming,
Extrapolation,
} from 'react-native-reanimated';
import {
PanGestureHandler,
PanGestureHandlerGestureEvent,
} from 'react-native-gesture-handler';
import type { PanGestureHandlerGestureEvent } from 'react-native-gesture-handler';
import { PanGestureHandler } from 'react-native-gesture-handler';

export default function ExtrapolationExample() {
const translation = {
Expand Down
2 changes: 1 addition & 1 deletion apps/common-app/src/examples/FrameCallbackExample.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { FrameInfo } from 'react-native-reanimated';
import Animated, {
FrameInfo,
useAnimatedStyle,
useFrameCallback,
useSharedValue,
Expand Down
3 changes: 2 additions & 1 deletion apps/common-app/src/examples/Game2048Example.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Text, StyleSheet, View, ColorValue, Alert } from 'react-native';
import type { ColorValue } from 'react-native';
import { Text, StyleSheet, View, Alert } from 'react-native';
import Animated, { LinearTransition, ZoomIn } from 'react-native-reanimated';

import React from 'react';
Expand Down
10 changes: 6 additions & 4 deletions apps/common-app/src/examples/GestureHandlerExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ import Animated, {
useSharedValue,
withSpring,
} from 'react-native-reanimated';
import {
Gesture,
GestureDetector,
GestureHandlerRootView,
import type {
GestureStateManager,
GestureTouchEvent,
GestureUpdateEvent,
PanGestureChangeEventPayload,
} from 'react-native-gesture-handler';
import {
Gesture,
GestureDetector,
GestureHandlerRootView,
} from 'react-native-gesture-handler';

import React from 'react';
import { StyleSheet } from 'react-native';
Expand Down
8 changes: 3 additions & 5 deletions apps/common-app/src/examples/IPodExample.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { View, StyleSheet, Dimensions, Text } from 'react-native';
import type { SharedValue } from 'react-native-reanimated';
import Animated, {
useSharedValue,
useAnimatedStyle,
Expand All @@ -9,12 +10,9 @@ import Animated, {
useAnimatedGestureHandler,
Extrapolation,
interpolate,
SharedValue,
} from 'react-native-reanimated';
import {
PanGestureHandler,
PanGestureHandlerGestureEvent,
} from 'react-native-gesture-handler';
import type { PanGestureHandlerGestureEvent } from 'react-native-gesture-handler';
import { PanGestureHandler } from 'react-native-gesture-handler';

const data = [
{ artist: 'Nirvana', song: 'Smells Like Teen Spirit' },
Expand Down
3 changes: 2 additions & 1 deletion apps/common-app/src/examples/JSPropsExample.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { TextInput, View, StyleSheet, ColorValue } from 'react-native';
import type { ColorValue } from 'react-native';
import { TextInput, View, StyleSheet } from 'react-native';
import React from 'react';
import Svg, { Path, Circle, G } from 'react-native-svg';
import Animated, {
Expand Down
10 changes: 2 additions & 8 deletions apps/common-app/src/examples/LayoutAnimations/Carousel.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import Animated, { SlideInLeft, SlideOutRight } from 'react-native-reanimated';
import {
Button,
Image,
ImageSourcePropType,
StyleSheet,
Text,
View,
} from 'react-native';
import type { ImageSourcePropType } from 'react-native';
import { Button, Image, StyleSheet, Text, View } from 'react-native';
import React, { useState } from 'react';

const AnimatedImage = Animated.createAnimatedComponent(Image);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { LayoutAnimationFunction } from 'react-native-reanimated';
import Animated, {
LayoutAnimationFunction,
makeMutable,
withDelay,
withSequence,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react';
import { Platform, Pressable, StyleSheet, View, Text } from 'react-native';
import type { AnimatedProps } from 'react-native-reanimated';
import Animated, {
FadeInLeft,
FadeInDown,
ZoomIn,
LightSpeedInLeft,
BounceIn,
AnimatedProps,
FadeOut,
} from 'react-native-reanimated';
import { FontAwesomeIcon } from '@fortawesome/react-native-fontawesome';
Expand Down
4 changes: 3 additions & 1 deletion apps/common-app/src/examples/LayoutAnimations/Modal.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import Animated, {
import type {
EntryAnimationsValues,
EntryExitAnimationFunction,
ExitAnimationsValues,
} from 'react-native-reanimated';
import Animated, {
useAnimatedStyle,
withTiming,
} from 'react-native-reanimated';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import Animated, {
import type {
EntryAnimationsValues,
EntryExitAnimationFunction,
ExitAnimationsValues,
} from 'react-native-reanimated';
import Animated, {
Layout,
withDelay,
withTiming,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { Alert, Modal, Pressable, StyleSheet, Text, View } from 'react-native';
import {
NativeStackNavigationProp,
createNativeStackNavigator,
} from '@react-navigation/native-stack';
import type { NativeStackNavigationProp } from '@react-navigation/native-stack';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import React, { useState } from 'react';

import { ParamListBase } from '@react-navigation/native';
import type { ParamListBase } from '@react-navigation/native';

// import { createStackNavigator } from "@react-navigation/stack";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import Animated, { SlideOutLeft, SlideOutRight } from 'react-native-reanimated';
import { Button, StyleSheet, View } from 'react-native';

import React from 'react';
import {
NativeStackScreenProps,
createNativeStackNavigator,
} from '@react-navigation/native-stack';
import type { NativeStackScreenProps } from '@react-navigation/native-stack';
import { createNativeStackNavigator } from '@react-navigation/native-stack';

type ParamList = {
First?: {};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import Animated, {
import type {
EntryAnimationsValues,
ExitAnimationsValues,
} from 'react-native-reanimated';
import Animated, {
useAnimatedStyle,
useSharedValue,
withDelay,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { BaseAnimationBuilder } from 'react-native-reanimated';
import Animated, {
BaseAnimationBuilder,
BounceOut,
CurvedTransition,
FadingTransition,
Expand All @@ -11,7 +11,8 @@ import Animated, {
SequencedTransition,
combineTransition,
} from 'react-native-reanimated';
import { Image, LayoutChangeEvent, Text, View, StyleSheet } from 'react-native';
import type { LayoutChangeEvent } from 'react-native';
import { Image, Text, View, StyleSheet } from 'react-native';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { ScrollView, TapGestureHandler } from 'react-native-gesture-handler';

Expand Down Expand Up @@ -120,7 +121,7 @@ export function WaterfallGrid({
key={pok.address}
style={[
{
width: width,
width,
height: pokHeight,
backgroundColor: pok.color,
left: cur * width + (cur + 1) * margin,
Expand All @@ -135,7 +136,7 @@ export function WaterfallGrid({
<AnimatedImage
layout={layoutTransition}
source={{ uri: pok.address }}
style={{ width: width, height: width }}
style={{ width, height: width }}
/>
</TapGestureHandler>
</Animated.View>
Expand All @@ -148,7 +149,7 @@ export function WaterfallGrid({
{cardsMemo.length === 0 && <Text> Loading </Text>}
{cardsMemo.length !== 0 && (
<ScrollView>
<View style={{ height: height }}>{cardsMemo}</View>
<View style={{ height }}>{cardsMemo}</View>
</ScrollView>
)}
</View>
Expand All @@ -167,7 +168,7 @@ export default function WaterfallGridExample() {
style={styles.picker}
itemStyle={{ height: 50 }}
onValueChange={(itemValue) => {
setSelectedTransition(itemValue as string);
setSelectedTransition(itemValue);
}}>
<Picker.Item label="LinearTransition" value="LinearTransition" />
<Picker.Item
Expand Down
3 changes: 2 additions & 1 deletion apps/common-app/src/examples/LightBoxExample.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useState, useRef, useEffect, Component } from 'react';
import type { Component } from 'react';
import React, { useState, useRef, useEffect } from 'react';
import Animated, {
useSharedValue,
useAnimatedStyle,
Expand Down
Loading
Loading