Skip to content

Commit

Permalink
Merge branch 'dev' into stage
Browse files Browse the repository at this point in the history
  • Loading branch information
JavidHaji-zada committed Jan 10, 2024
2 parents 4705ad7 + e415311 commit 7adddd4
Show file tree
Hide file tree
Showing 15 changed files with 645 additions and 537 deletions.
184 changes: 94 additions & 90 deletions src/components/templates/BottomSheetCreateRenameGroup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { BottomSheetRef } from '@components/composite/BottomSheet/BottomSheet.ty
import { useForwardedRef } from '@hooks/useForwardedRef';
import { styles } from '@components/templates/BottomSheetCreateRenameGroup/styles';
import {
BottomSheetFloat,
PrimaryButton,
Toast,
ToastPosition,
Expand All @@ -25,6 +24,7 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { verticalScale } from '@utils/scaling';
import { StringUtils } from '@utils/string';
import { useTranslation } from 'react-i18next';
import { BottomSheet } from '@components/composite';

type Props = {
ref: RefObject<BottomSheetRef>;
Expand Down Expand Up @@ -112,102 +112,106 @@ export const BottomSheetCreateRenameGroup = forwardRef<BottomSheetRef, Props>(
}, []);

return (
<>
<BottomSheetFloat
height={
Platform.OS === 'ios'
? Math.min(verticalScale(365), 320)
: Math.min(verticalScale(380), 330)
}
ref={localRef}
containerStyle={
Platform.OS === 'android' && { marginBottom: bottomSafeArea }
}
onClose={handleDismiss}
testID="Create_Rename_Collection_BottomSheet"
swiperIconVisible
>
<View testID="BottomSheetCreateRename" style={styles.container}>
<View style={styles.content}>
<Spacer value={24} />
<Text
testID="BottomSheetCreateRename_Title"
style={styles.newListTitle}
fontFamily="Inter_600SemiBold"
fontSize={16}
color={COLORS.neutral900}
>
{type === 'create'
? t('collection.create')
: t('collection.rename')}
</Text>
<Spacer value={8} />
<OnboardingView
thisStep={8}
tooltipPlacement="bottom"
childrenAlwaysVisible
helpers={{ next: setDemoName, back: localRef.current?.dismiss }}
>
<Input
testID="BottomSheetCreateRename_Input"
ref={nameInput}
value={localGroupName}
onChangeValue={setLocalGroupName}
type="text"
placeholder={
emptyPlaceholder
? t('common.field.required')
: t('collection.name.input.placeholder')
}
placeholderTextColor={
emptyPlaceholder ? COLORS.error400 : COLORS.midnight
}
style={[styles.bottomSheetInput]}
/>
</OnboardingView>
<Spacer value={24} />
<OnboardingView
thisStep={9}
tooltipPlacement="bottom"
childrenAlwaysVisible
helpers={{ next: handleButtonPress }}
>
<PrimaryButton
testID="BottomSheetCreateRename_Button"
onPress={handleButtonPress}
>
<Text
fontFamily="Inter_600SemiBold"
fontSize={16}
color={COLORS.neutral0}
>
{type === 'create' ? t('button.create') : t('button.save')}
</Text>
</PrimaryButton>
</OnboardingView>
<Spacer value={24} />
<Button
testID="BottomSheetCreateRename_Cancel_Button"
type="base"
style={styles.bottomSheetCancelButton}
onPress={() => {
setTimeout(() => {
localRef.current?.dismiss();
}, 400);
}}
<BottomSheet
height={
Platform.OS === 'ios'
? Math.min(verticalScale(365), 320)
: Math.min(verticalScale(380), 330)
}
ref={localRef}
containerStyle={
Platform.OS === 'android' && { marginBottom: bottomSafeArea }
}
onClose={handleDismiss}
testID="Create_Rename_Collection_BottomSheet"
swiperIconVisible
>
<View testID="BottomSheetCreateRename" style={styles.container}>
<View style={styles.content}>
<Spacer value={24} />
<Text
testID="BottomSheetCreateRename_Title"
style={styles.newListTitle}
fontFamily="Inter_600SemiBold"
fontSize={16}
color={COLORS.neutral900}
>
{type === 'create'
? t('collection.create')
: t('collection.rename')}
</Text>
<Spacer value={8} />
<OnboardingView
thisStep={8}
tooltipPlacement="bottom"
childrenAlwaysVisible
helpers={{ next: setDemoName, back: localRef.current?.dismiss }}
>
<Input
testID="BottomSheetCreateRename_Input"
ref={nameInput}
value={localGroupName}
onChangeValue={setLocalGroupName}
type="text"
placeholder={
emptyPlaceholder
? t('common.field.required')
: t('collection.name.input.placeholder')
}
placeholderTextColor={
emptyPlaceholder ? COLORS.error400 : COLORS.alphaBlack60
}
style={[styles.bottomSheetInput]}
/>
</OnboardingView>
<Spacer value={24} />
<OnboardingView
thisStep={9}
tooltipPlacement="bottom"
childrenAlwaysVisible
helpers={{ next: handleButtonPress }}
>
<PrimaryButton
testID="BottomSheetCreateRename_Button"
onPress={handleButtonPress}
disabled={!Boolean(localGroupName)}
>
<Text
fontFamily="Inter_600SemiBold"
color={COLORS.neutral800}
fontSize={16}
color={
Boolean(localGroupName)
? COLORS.neutral0
: COLORS.alphaBlack30
}
>
{t('button.cancel')}
{type === 'create' ? t('button.create') : t('button.save')}
</Text>
</Button>
</View>
</PrimaryButton>
</OnboardingView>
<Spacer value={24} />
<Button
testID="BottomSheetCreateRename_Cancel_Button"
type="base"
style={styles.bottomSheetCancelButton}
onPress={() => {
setTimeout(() => {
localRef.current?.dismiss();
}, 400);
}}
>
<Text
fontFamily="Inter_600SemiBold"
fontWeight="600"
color={COLORS.neutral900}
fontSize={16}
>
{t('button.cancel')}
</Text>
</Button>
</View>
</BottomSheetFloat>
</>
</View>
</BottomSheet>
);
}
);
17 changes: 11 additions & 6 deletions src/components/templates/BottomSheetEditCollection/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import React, { ForwardedRef, forwardRef, useCallback, useRef } from 'react';
import { View } from 'react-native';
import { BottomSheetProps, BottomSheetRef } from '@components/composite';
import { BottomSheetFloat } from '@components/modular';
import { useTranslation } from 'react-i18next';
import {
BottomSheet,
BottomSheetProps,
BottomSheetRef
} from '@components/composite';
import { Button, Text } from '@components/base';
import { useForwardedRef } from '@hooks/useForwardedRef';
import { useLists } from '@contexts';
import { COLORS } from '@constants/colors';
import { AccountList } from '@models';
import { StringUtils } from '@utils/string';
import { verticalScale } from '@utils/scaling';
import { BottomSheetCreateRenameGroup } from '../BottomSheetCreateRenameGroup';
import { styles } from './styles';
import { StringUtils } from '@utils/string';
import { useTranslation } from 'react-i18next';

interface BottomSheetEditCollectionProps extends BottomSheetProps {
collection: AccountList;
Expand Down Expand Up @@ -58,10 +62,11 @@ export const BottomSheetEditCollection = forwardRef<
};

return (
<BottomSheetFloat
<BottomSheet
ref={localRef}
swiperIconVisible
avoidKeyboard={false}
containerStyle={{ minHeight: verticalScale(194) }}
{...bottomSheetProps}
>
<View style={styles.content} testID="bottom-sheet-edit-collection">
Expand Down Expand Up @@ -105,6 +110,6 @@ export const BottomSheetEditCollection = forwardRef<
handleOnRenameGroup={renameGroup}
ref={renameCollectionModalRef}
/>
</BottomSheetFloat>
</BottomSheet>
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,6 @@ const styles = StyleSheet.create({
list: {
flexGrow: 1,
paddingHorizontal: scale(16),
paddingBottom: verticalScale(96)
paddingBottom: '40%'
}
});
Loading

0 comments on commit 7adddd4

Please sign in to comment.