Skip to content

Commit

Permalink
fix prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
walmat committed Feb 5, 2024
1 parent f00741c commit 0ead5a0
Show file tree
Hide file tree
Showing 284 changed files with 5,005 additions and 5,225 deletions.
4 changes: 2 additions & 2 deletions audit-ci.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"GHSA-cchq-frgv-rjh5", // https://github.com/advisories/GHSA-cchq-frgv-rjh5
"GHSA-g644-9gfx-q4q4", // https://github.com/advisories/GHSA-g644-9gfx-q4q4
"GHSA-m95q-7qp3-xv42", // https://github.com/advisories/GHSA-m95q-7qp3-xv42
"GHSA-gxpj-cx7g-858c" // https://github.com/advisories/GHSA-gxpj-cx7g-858c
]
"GHSA-gxpj-cx7g-858c", // https://github.com/advisories/GHSA-gxpj-cx7g-858c
],
}
12 changes: 4 additions & 8 deletions e2e/registerENSFlow.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,10 @@ const resolveName = async ensName => {
};

const validatePrimaryName = async name => {
const {
address: rainbowAddress,
primaryName: rainbowPrimaryName,
} = await resolveName(RAINBOW_TEST_WALLET_NAME);
const {
address: randomAddress,
primaryName: randomPrimaryName,
} = await resolveName(RANDOM_NAME_ETH);
const { address: rainbowAddress, primaryName: rainbowPrimaryName } =
await resolveName(RAINBOW_TEST_WALLET_NAME);
const { address: randomAddress, primaryName: randomPrimaryName } =
await resolveName(RANDOM_NAME_ETH);

if (
rainbowAddress !== randomAddress ||
Expand Down
3 changes: 3 additions & 0 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
'*.{js,jsx,ts,tsx,graphql}': ['prettier --write', 'eslint --cache'],
};
3 changes: 2 additions & 1 deletion metro.transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ module.exports.transform = function applyRainbowTransform({
const opts = merge(options, {
customTransformOptions: {
'metro-plugin-anisotropic-transform': {
cyclicDependents: /.+\/node_modules\/react-native\/Libraries\/BatchedBridge\/NativeModules\.js$/,
cyclicDependents:
/.+\/node_modules\/react-native\/Libraries\/BatchedBridge\/NativeModules\.js$/,
globalScopeFilter: {
'@react-native-community/clipboard': {},
'react-native-keychain': {},
Expand Down
10 changes: 2 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@
"viem": "1.6.0",
"vm-browserify": "0.0.4",
"w2t": "3.0.2",
"zustand": "4.1.5"
"zustand": "4.3.1"
},
"devDependencies": {
"@babel/core": "7.22.0",
Expand Down Expand Up @@ -361,7 +361,7 @@
"metro-plugin-anisotropic-transform": "https://github.com/rainbow-me/metro-plugin-anisotropic-transform#eaf2a2db95eeedd2f63ce8032c102a12c5a88802",
"metro-react-native-babel-preset": "0.76.7",
"node-vibrant": "3.2.1-alpha.1",
"prettier": "2.2.1",
"prettier": "3.2.5",
"react-test-renderer": "18.1.0",
"resolve": "1.22.8",
"rn-nodeify": "10.2.0",
Expand Down Expand Up @@ -531,11 +531,5 @@
"react-native-storage": false,
"react-native-storage>opencollective>babel-polyfill>core-js": false
}
},
"lint-staged": {
"*.{js,jsx,ts,tsx,graphql}": [
"prettier --write",
"eslint --cache"
]
}
}
28 changes: 2 additions & 26 deletions src/components/EdgeFade.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,7 @@ const LeftFade = styled(LinearGradient).attrs(({ theme: { colors } }) => ({
],
end: { x: 1, y: 0.5 },
locations: [
0,
0.19,
0.34,
0.47,
0.565,
0.65,
0.73,
0.802,
0.861,
0.91,
0.952,
0.982,
1,
0, 0.19, 0.34, 0.47, 0.565, 0.65, 0.73, 0.802, 0.861, 0.91, 0.952, 0.982, 1,
],
pointerEvents: 'none',
start: { x: 0, y: 0.5 },
Expand Down Expand Up @@ -61,19 +49,7 @@ const RightFade = styled(LinearGradient).attrs(({ theme: { colors } }) => ({
],
end: { x: 0, y: 0.5 },
locations: [
0,
0.19,
0.34,
0.47,
0.565,
0.65,
0.73,
0.802,
0.861,
0.91,
0.952,
0.982,
1,
0, 0.19, 0.34, 0.47, 0.565, 0.65, 0.73, 0.802, 0.861, 0.91, 0.952, 0.982, 1,
],
pointerEvents: 'none',
start: { x: 1, y: 0.5 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ const ScaleButton = ({
onPress,
});

const gestureHandler = useAnimatedGestureHandler<NativeViewGestureHandlerGestureEvent>(
{
const gestureHandler =
useAnimatedGestureHandler<NativeViewGestureHandlerGestureEvent>({
onActive: () => {
runOnJS(handleStartPress)();
if (hasScaledDown.value === 0) {
Expand All @@ -148,8 +148,7 @@ const ScaleButton = ({
onFail: () => {
runOnJS(handleCancel)();
},
}
);
});
return (
<View style={[sx.overflow, wrapperStyle]} testID={testID}>
<View style={{ margin: -overflowMargin }}>
Expand Down
45 changes: 23 additions & 22 deletions src/components/animations/ButtonPressAnimation/NativeButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,32 @@ interface SpecificRawNativeButtonProps extends Props {
transformOrigin?: TransformOrigin;
}

const RawNativeButton = requireNativeComponent<SpecificRawNativeButtonProps>(
'Button'
);

const ButtonWithTransformOrigin = styled(RawNativeButton)(
({ transformOrigin }: { transformOrigin: TransformOrigin }) => {
if (!transformOrigin) return {};
const [x, y] = transformOrigin;
// 👇️ Here we want to set the button's top / left
// properties (relative to the parent wrapper view) to
// values opposite of the provided transformOrigin.
// This is necessary to do in order for the `transformOrigin` prop to
// work with NativeButton without effecting NativeButton's layout.
const styles: ViewStyle = {};
const RawNativeButton =
requireNativeComponent<SpecificRawNativeButtonProps>('Button');

if (x !== 0.5) {
styles.left = `${x + 0.5 * (x > 0.5 ? 100 : -100)}%`;
}
if (y !== 0.5) {
styles.top = `${y + 0.5 * (y > 0.5 ? 100 : -100)}%`;
}
const ButtonWithTransformOrigin = styled(RawNativeButton)(({
transformOrigin,
}: {
transformOrigin: TransformOrigin;
}) => {
if (!transformOrigin) return {};
const [x, y] = transformOrigin;
// 👇️ Here we want to set the button's top / left
// properties (relative to the parent wrapper view) to
// values opposite of the provided transformOrigin.
// This is necessary to do in order for the `transformOrigin` prop to
// work with NativeButton without effecting NativeButton's layout.
const styles: ViewStyle = {};

return styles;
if (x !== 0.5) {
styles.left = `${x + 0.5 * (x > 0.5 ? 100 : -100)}%`;
}
);
if (y !== 0.5) {
styles.top = `${y + 0.5 * (y > 0.5 ? 100 : -100)}%`;
}

return styles;
});

export function normalizeTransformOrigin(
transformOrigin: TransformOrigin | string | undefined
Expand Down
3 changes: 2 additions & 1 deletion src/components/animations/ButtonPressAnimation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {

export type TransformOrigin = [number, number];
export type Direction = 'bottom' | 'left' | 'right' | 'top';
export type ButtonPressAnimationTouchEvent = NativeSyntheticEvent<NativeTouchEvent>;
export type ButtonPressAnimationTouchEvent =
NativeSyntheticEvent<NativeTouchEvent>;

export interface BaseButtonAnimationProps
extends Pick<ViewProps, 'onLayout' | 'style' | 'testID'>,
Expand Down
19 changes: 9 additions & 10 deletions src/components/asset-list/RecyclerAssetList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,8 @@ function RecyclerAssetList({
const { openFamilies: openFamilyTabs } = useOpenFamilies();
const { ref, handleRef } = useRecyclerListViewRef();
const stickyCoinDividerRef = React.useRef<View>() as React.RefObject<View>;
const [globalDeviceDimensions, setGlobalDeviceDimensions] = useState<number>(
0
);
const [globalDeviceDimensions, setGlobalDeviceDimensions] =
useState<number>(0);
const {
areSmallCollectibles,
items,
Expand Down Expand Up @@ -353,9 +352,8 @@ function RecyclerAssetList({
}

if (type.index === ViewTypes.HEADER.index) {
return (showcase
? ViewTypes.SHOWCASE_HEADER
: ViewTypes.HEADER
return (
showcase ? ViewTypes.SHOWCASE_HEADER : ViewTypes.HEADER
).renderComponent({
data,
isCoinListEdited,
Expand Down Expand Up @@ -524,7 +522,7 @@ function RecyclerAssetList({
};
},
(type, dim) => {
const element = (type as unknown) as {
const element = type as unknown as {
readonly height: number;
readonly visibleDuringCoinEdit: boolean;
};
Expand Down Expand Up @@ -583,7 +581,8 @@ function RecyclerAssetList({

useEffect(() => {
let collectibles: RecyclerAssetListSection = {} as RecyclerAssetListSection;
let prevCollectibles: RecyclerAssetListSection = {} as RecyclerAssetListSection;
let prevCollectibles: RecyclerAssetListSection =
{} as RecyclerAssetListSection;
let balances: RecyclerAssetListSection = {} as RecyclerAssetListSection;
let smallBalances: any = {};

Expand Down Expand Up @@ -687,8 +686,8 @@ function RecyclerAssetList({
disableStickyHeaders
? []
: isCoinListEdited
? defaultIndices
: stickyComponentsIndices
? defaultIndices
: stickyComponentsIndices
}
>
{/* @ts-ignore */}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import { useAccountAsset } from '@/hooks';
import { colors, fonts, fontWithWidth, getFontSize } from '@/styles';
import { deviceUtils } from '@/utils';

const SafeRadialGradient = (IS_TESTING === 'true'
? View
: RadialGradient) as typeof RadialGradient;
const SafeRadialGradient = (
IS_TESTING === 'true' ? View : RadialGradient
) as typeof RadialGradient;

interface FastCurrencySelectionRowProps {
item: any;
Expand Down Expand Up @@ -261,8 +261,7 @@ export default React.memo(function FastCurrencySelectionRow({
)}
</View>
);
},
isEqual);
}, isEqual);

const sx = StyleSheet.create({
addGradient: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ const TokenFamilyHeaderHeight = 48;

const PositionListHeader = ({ total, ...props }: { total: string }) => {
const { colors } = useTheme();
const {
isPositionCardsOpen,
toggleOpenPositionCards,
} = useOpenPositionCards();
const { isPositionCardsOpen, toggleOpenPositionCards } =
useOpenPositionCards();

const toValue = Number(!!isPositionCardsOpen);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,10 @@ const ExternalENSProfileScrollViewWithRefFactory = (type: string) =>
);
});

const ExternalENSProfileScrollViewWithRef = ExternalENSProfileScrollViewWithRefFactory(
'ens-profile'
);
const ExternalSelectNFTScrollViewWithRef = ExternalENSProfileScrollViewWithRefFactory(
'select-nft'
);
const ExternalENSProfileScrollViewWithRef =
ExternalENSProfileScrollViewWithRefFactory('ens-profile');
const ExternalSelectNFTScrollViewWithRef =
ExternalENSProfileScrollViewWithRefFactory('select-nft');
export {
ExternalSelectNFTScrollViewWithRef,
ExternalENSProfileScrollViewWithRef,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ const RawMemoRecyclerAssetList = React.memo(function RawRecyclerAssetList({
const { getCardsForPlacement } = useRemoteCardContext();
const { isReadOnlyWallet } = useWallets();

const cards = useMemo(() => getCardsForPlacement(name as string), [
getCardsForPlacement,
name,
]);
const cards = useMemo(
() => getCardsForPlacement(name as string),
[getCardsForPlacement, name]
);

const layoutProvider = useMemo(
() =>
Expand Down Expand Up @@ -134,9 +134,10 @@ const RawMemoRecyclerAssetList = React.memo(function RawRecyclerAssetList({
}, [ref, setScrollToTopRef]);

const onLayout = useCallback(
() => ({ nativeEvent }: LayoutChangeEvent) => {
topMarginRef.current = nativeEvent.layout.y;
},
() =>
({ nativeEvent }: LayoutChangeEvent) => {
topMarginRef.current = nativeEvent.layout.y;
},
[]
);

Expand Down Expand Up @@ -188,8 +189,8 @@ const RawMemoRecyclerAssetList = React.memo(function RawRecyclerAssetList({
type === 'ens-profile'
? ExternalENSProfileScrollViewWithRef
: type === 'select-nft'
? ExternalSelectNFTScrollViewWithRef
: ExternalScrollViewWithRef
? ExternalSelectNFTScrollViewWithRef
: ExternalScrollViewWithRef
}
itemAnimator={layoutItemAnimator}
layoutProvider={layoutProvider}
Expand Down
14 changes: 6 additions & 8 deletions src/components/asset-list/RecyclerAssetList2/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,12 @@ function RecyclerAssetList({
type?: AssetListType;
walletBriefSectionsData: any[];
}) {
const {
memoizedResult: briefSectionsData,
additionalData,
} = useMemoBriefSectionData({
briefSectionsData: walletBriefSectionsData,
externalAddress,
type,
});
const { memoizedResult: briefSectionsData, additionalData } =
useMemoBriefSectionData({
briefSectionsData: walletBriefSectionsData,
externalAddress,
type,
});

const insets = useSafeAreaInsets();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ export function ProfileActionButtonsRow() {
],
}));

const {
f2c_enabled: addCashEnabled,
swagg_enabled: swapEnabled,
} = useRemoteConfig();
const { f2c_enabled: addCashEnabled, swagg_enabled: swapEnabled } =
useRemoteConfig();

if (!accentColorLoaded) return null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,8 @@ export function ProfileAvatarRow({

const { accountSymbol, accountColor, accountImage } = useAccountProfile();

const {
avatarContextMenuConfig,
onAvatarPressProfile,
onSelectionCallback,
} = useOnAvatarPress({ screenType: 'wallet' });
const { avatarContextMenuConfig, onAvatarPressProfile, onSelectionCallback } =
useOnAvatarPress({ screenType: 'wallet' });

const dominantColor = usePersistentDominantColorFromImage(accountImage);

Expand Down

0 comments on commit 0ead5a0

Please sign in to comment.