Skip to content

Commit

Permalink
Merge pull request #216 from ambrosus/revert-215-stage
Browse files Browse the repository at this point in the history
Revert "Stage"
  • Loading branch information
ilyaAir authored Aug 17, 2023
2 parents 77356b7 + 58c491b commit 52ee80d
Show file tree
Hide file tree
Showing 56 changed files with 219 additions and 790 deletions.
16 changes: 3 additions & 13 deletions Providers.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import React from 'react';
import { combineComponents } from '@helpers/combineComponents';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import React from 'react';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { ListsContextProvider } from '@contexts/ListsContext';
import {
AllAddressesProvider,
OnboardingContextProvider,
LocalizationProvider
} from '@contexts';
import { AllAddressesProvider, OnboardingContextProvider } from '@contexts';

const queryClient = new QueryClient();

Expand All @@ -19,14 +15,9 @@ const WrappedSafeAreaProvider: React.FC = ({ children }: any) => (
<SafeAreaProvider style={{ flex: 1 }}>{children}</SafeAreaProvider>
);

const WrappedLocalizationProvider: React.FC = ({ children }: any) => (
<LocalizationProvider>{children}</LocalizationProvider>
);

const independentProviders = [
WrappedQueryClientProvider,
WrappedSafeAreaProvider,
WrappedLocalizationProvider
WrappedSafeAreaProvider
];
/**
* The order of the providers matters
Expand All @@ -35,7 +26,6 @@ const providers = [
...independentProviders,
AllAddressesProvider,
ListsContextProvider,
WrappedLocalizationProvider,
OnboardingContextProvider
];

Expand Down
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,12 @@
"expo-store-review": "~6.2.1",
"expo-system-ui": "~2.2.1",
"expo-updates": "~0.16.4",
"i18n-js": "^4.3.0",
"i18next": "^23.4.4",
"jest": "^29.2.1",
"jest-expo": "^48.0.2",
"moment": "^2.29.4",
"patch-package": "^7.0.0",
"postinstall-postinstall": "^2.1.0",
"react": "18.2.0",
"react-i18next": "^13.1.0",
"react-native": "0.71.8",
"react-native-calendar-picker": "^7.1.4",
"react-native-gesture-handler": "~2.9.0",
Expand Down
7 changes: 1 addition & 6 deletions src/components/composite/Button/CopyToClipboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { ClipboardFilledIcon } from '@components/svg/icons';
import { scale } from '@utils/scaling';
import { Toast, ToastPosition } from '@components/modular/Toast';
import { BaseButtonProps } from '@components/base/Button';
import { useTranslation } from 'react-i18next';

export interface CopyToClipboardButtonProps
extends Omit<BaseButtonProps, 'onPress'> {
Expand All @@ -19,13 +18,9 @@ export const CopyToClipboardButton = (
props: CopyToClipboardButtonProps
): JSX.Element => {
const { textToDisplay, textToCopy, textProps, ...buttonProps } = props;
const { t } = useTranslation();

const onPress = async () => {
Toast.show({
message: t('copied.to.clipboard'),
type: ToastPosition.Bottom
});
Toast.show({ message: 'Copied to Clipboard', type: ToastPosition.Bottom });
await Clipboard.setStringAsync(textToCopy || textToDisplay);
};

Expand Down
4 changes: 1 addition & 3 deletions src/components/modular/CollectionItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { COLORS } from '@constants/colors';
import { useAMBPrice } from '@hooks';
import { AccountList } from '@models';
import { NumberUtils } from '@utils/number';
import { useTranslation } from 'react-i18next';

interface CollectionItemProps {
collection: AccountList;
Expand All @@ -16,7 +15,6 @@ interface CollectionItemProps {
export function CollectionItem(props: CollectionItemProps) {
const { collection, style } = props;
const { data: ambPriceData } = useAMBPrice();
const { t } = useTranslation();

const tokensFormatted = useMemo(() => {
const formattedNumber = NumberUtils.formatNumber(
Expand Down Expand Up @@ -55,7 +53,7 @@ export function CollectionItem(props: CollectionItemProps) {
color={COLORS.smokyBlack50}
fontSize={12}
>
{collection.accountCount + ` ${t('addresses.text')}`}
{collection.accountCount + ' addresses'}
</Text>
{collection.accountCount > 0 && (
<Row alignItems="center">
Expand Down
12 changes: 5 additions & 7 deletions src/components/templates/AMBPriceHistory/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import React, { useEffect, useMemo, useRef, useState } from 'react';
import { View } from 'react-native';
import { useTranslation } from 'react-i18next';
import Animated, {
useAnimatedProps,
useAnimatedStyle,
Expand All @@ -18,8 +16,9 @@ import { scale, verticalScale } from '@utils/scaling';
import { Badge } from '@components/base/Badge';
import { PercentChange } from '@components/composite';
import { BezierChart } from '../BezierChart';
import { MONTH_NAMES } from '@constants/variables';
import { styles } from './styles';
import { MONTH_NAMES } from '@constants/variables';
import { View } from 'react-native';

interface AMBPriceHistoryProps {
badgeType: 'view' | 'button';
Expand All @@ -45,7 +44,6 @@ export const AMBPriceHistory = (props: AMBPriceHistoryProps) => {
const ambPrice = useSharedValue(ambPriceNow?.priceUSD || 0);
const selectedPointDate = useSharedValue(-1);
const didSetAMBPriceFromAPI = useRef(false);
const { t } = useTranslation();

useEffect(() => {
if (ambPriceNow) {
Expand Down Expand Up @@ -206,15 +204,15 @@ export const AMBPriceHistory = (props: AMBPriceHistoryProps) => {
// value: '1h'
// },
{
text: t('chart.timeframe.daily'),
text: '1D',
value: '1d'
},
{
text: t('chart.timeframe.weekly'),
text: '1W',
value: 'weekly'
},
{
text: t('chart.timeframe.monthly'),
text: '1M',
value: 'monthly'
}
]}
Expand Down
6 changes: 2 additions & 4 deletions src/components/templates/AddWalletToList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { COLORS } from '@constants/colors';
import { SearchIcon } from '@components/svg/icons';
import { NumberUtils } from '@utils/number';
import { useLists } from '@contexts/ListsContext';
import { useTranslation } from 'react-i18next';

export interface AddWalletToListProps {
wallet: ExplorerAccount;
Expand All @@ -21,7 +20,6 @@ export interface AddWalletToListProps {
export const AddWalletToList = (props: AddWalletToListProps): JSX.Element => {
const { wallet, lists, onWalletMove } = props;
const { toggleAddressesInList } = useLists((v) => v);
const { t } = useTranslation();
const [searchText, setSearchText] = useState('');
const filteredLists = useMemo(
() =>
Expand Down Expand Up @@ -78,7 +76,7 @@ export const AddWalletToList = (props: AddWalletToListProps): JSX.Element => {
fontFamily="Inter_500Medium"
color={COLORS.smokyBlack50}
>
{list.accountCount} {t('addresses')}
{list.accountCount} Addresses
</Text>
</View>
</Row>
Expand All @@ -97,7 +95,7 @@ export const AddWalletToList = (props: AddWalletToListProps): JSX.Element => {
<InputWithIcon
value={searchText}
onChangeValue={setSearchText}
placeholder={t('search.groups.input')}
placeholder="Search groups"
iconLeft={<SearchIcon color={COLORS.midnight} />}
/>
</View>
Expand Down
24 changes: 0 additions & 24 deletions src/components/templates/BottomSheetAddWalletToList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ import { useFullscreenModalHeight } from '@hooks';
import { COLORS } from '@constants/colors';
import { AddWalletToList, AddWalletToListProps } from '../AddWalletToList';
import { verticalScale } from '@utils/scaling';
import { PrimaryButton } from '@components/modular';
import { BottomSheetCreateRenameGroup } from '@components/templates';
import { useLists } from '@contexts';

interface BottomSheetAddWalletToListProps extends AddWalletToListProps {
title: string;
Expand All @@ -19,11 +16,6 @@ export const BottomSheetAddWalletToList = forwardRef<
>((props, ref) => {
const { title, ...addWalletToListProps } = props;
const fullscreenHeight = useFullscreenModalHeight();
const { handleOnCreate, createGroupRef } = useLists((v) => v);

const showCreateNewListModal = () => {
createGroupRef.current?.show();
};

return (
<BottomSheet
Expand All @@ -43,22 +35,6 @@ export const BottomSheetAddWalletToList = forwardRef<
</Text>
<Spacer value={verticalScale(24)} />
<AddWalletToList {...addWalletToListProps} />
<PrimaryButton
onPress={() => {
showCreateNewListModal();
}}
style={{ width: '90%', alignSelf: 'center' }}
>
<Text fontFamily="Inter_600SemiBold" color={COLORS.white} fontSize={16}>
Create new group
</Text>
</PrimaryButton>
<Spacer value={verticalScale(48)} />
<BottomSheetCreateRenameGroup
ref={createGroupRef}
type="create"
handleOnCreateGroup={handleOnCreate}
/>
</BottomSheet>
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { COLORS } from '@constants/colors';
import { ExplorerAccount } from '@models';
import { BottomSheetFloat } from '@components/modular';
import { verticalScale } from '@utils/scaling';
import { useTranslation } from 'react-i18next';

type Props = {
ref: RefObject<BottomSheetRef>;
Expand All @@ -21,7 +20,6 @@ export const BottomSheetRemoveAddressFromWatchlists = forwardRef<
>(({ item }, ref) => {
const localRef: ForwardedRef<BottomSheetRef> = useForwardedRef(ref);
const { removeFromWatchlist } = useWatchlist();
const { t } = useTranslation();

const handleRemoveAddressFromWatchlist = useCallback(() => {
removeFromWatchlist(item);
Expand All @@ -44,7 +42,7 @@ export const BottomSheetRemoveAddressFromWatchlists = forwardRef<
fontSize={14}
color={COLORS.smokyBlack}
>
{t('confirm.remove.address.from.watchlist')}
Remove this address from watchlist?
</Text>
<Spacer value={24} />
<Button
Expand All @@ -57,7 +55,7 @@ export const BottomSheetRemoveAddressFromWatchlists = forwardRef<
fontSize={16}
color={COLORS.crimsonRed}
>
{t('remove.btn')}
Remove
</Text>
</Button>
<Spacer value={24} />
Expand All @@ -72,7 +70,7 @@ export const BottomSheetRemoveAddressFromWatchlists = forwardRef<
color={COLORS.smokyBlack}
fontSize={16}
>
{t('cancel.btn')}
Cancel
</Text>
</Button>
</View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { BottomSheetFloat, PrimaryButton } from '@components/modular';
import { useForwardedRef } from '@hooks';
import { scale, verticalScale } from '@utils/scaling';
import { COLORS } from '@constants/colors';
import { useTranslation } from 'react-i18next';

type Props = {
ref: RefObject<BottomSheetRef>;
Expand All @@ -19,7 +18,6 @@ export const BottomSheetCreateCollectionOrAddAddress = forwardRef<
Props
>(({ handleCreateCollectionPress, handleOnAddNewAddress }, ref) => {
const localRef: ForwardedRef<BottomSheetRef> = useForwardedRef(ref);
const { t } = useTranslation();

return (
<BottomSheetFloat
Expand All @@ -44,7 +42,7 @@ export const BottomSheetCreateCollectionOrAddAddress = forwardRef<
fontSize={16}
color={COLORS.white}
>
{t('add.address.btn')}
Add address
</Text>
</PrimaryButton>
<Spacer value={scale(24)} />
Expand All @@ -62,7 +60,7 @@ export const BottomSheetCreateCollectionOrAddAddress = forwardRef<
fontSize={16}
color={COLORS.smokyBlack}
>
{t('create.group')}
Create group
</Text>
</Button>
</View>
Expand Down
Loading

0 comments on commit 52ee80d

Please sign in to comment.