-
Notifications
You must be signed in to change notification settings - Fork 376
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: refacto & style modification in CreateGroupFinalize, add testID …
…for test purposes Signed-off-by: Lucas De Curtis <lucas.de-curtis@epitech.eu>
- Loading branch information
Showing
23 changed files
with
371 additions
and
323 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 0 additions & 21 deletions
21
js/packages/components/create-group/CreateGroupFooter.priv.tsx
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 20 additions & 60 deletions
80
js/packages/components/create-group/CreateGroupHeader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,41 @@ | ||
import { Icon } from '@ui-kitten/components' | ||
import React from 'react' | ||
import { StyleProp, TouchableWithoutFeedback, View, ViewStyle } from 'react-native' | ||
import { StyleProp, View, ViewStyle } from 'react-native' | ||
|
||
import { useAppDimensions } from '@berty/contexts/app-dimensions.context' | ||
import { useStyles } from '@berty/contexts/styles' | ||
import { useThemeColor } from '@berty/hooks' | ||
|
||
import { UnifiedText } from '../shared-components/UnifiedText' | ||
|
||
export const CreateGroupHeader: React.FC<{ | ||
title: string | ||
icon?: string | ||
iconPack?: string | ||
first?: boolean | ||
disabled?: boolean | ||
onPress?: () => void | ||
style?: StyleProp<ViewStyle> | ||
}> = ({ | ||
children, | ||
title, | ||
icon, | ||
iconPack, | ||
first = false, | ||
disabled = false, | ||
onPress = null, | ||
style = null, | ||
}) => { | ||
const { height, border, margin, row, padding, text, column, opacity } = useStyles() | ||
const { scaleHeight } = useAppDimensions() | ||
}> = ({ title, style = null }) => { | ||
const { height, border, margin, row, padding, text, column } = useStyles() | ||
const colors = useThemeColor() | ||
|
||
return ( | ||
<View style={[!first && { backgroundColor: '#F2F2F2' }]}> | ||
<TouchableWithoutFeedback onPress={() => onPress?.()}> | ||
<View style={[border.radius.top.scale(30), { backgroundColor: '#F2F2F2' }, style]}> | ||
<View style={[height(90)]}> | ||
<View | ||
style={[ | ||
border.radius.top.scale(30), | ||
!first && border.shadow.big, | ||
!first && { shadowColor: colors.shadow }, | ||
disabled && opacity(0.5), | ||
{ backgroundColor: '#F2F2F2' }, | ||
style, | ||
margin.top.medium, | ||
row.item.justify, | ||
border.radius.scale(4), | ||
{ | ||
backgroundColor: `${colors['secondary-text']}70`, | ||
height: 5, | ||
width: 60, | ||
}, | ||
]} | ||
> | ||
<View style={[height(90)]}> | ||
<View | ||
style={[ | ||
margin.top.medium, | ||
row.item.justify, | ||
border.radius.scale(4), | ||
{ | ||
backgroundColor: `${colors['secondary-text']}70`, | ||
height: 5 * scaleHeight, | ||
width: 60 * scaleHeight, | ||
}, | ||
]} | ||
/> | ||
<View style={[margin.top.small]}> | ||
<View style={[row.fill, padding.horizontal.medium, padding.top.small]}> | ||
<UnifiedText style={[text.bold, text.size.scale(25), column.item.center]}> | ||
{title} | ||
</UnifiedText> | ||
{icon && ( | ||
<Icon | ||
name={icon} | ||
pack={iconPack} | ||
width={30} | ||
height={30} | ||
fill={colors['main-text']} | ||
/> | ||
)} | ||
</View> | ||
</View> | ||
/> | ||
<View style={[margin.top.small]}> | ||
<View style={[row.fill, padding.horizontal.medium, padding.top.small]}> | ||
<UnifiedText style={[text.bold, text.size.scale(25), column.item.center]}> | ||
{title} | ||
</UnifiedText> | ||
</View> | ||
{children && <View>{children}</View>} | ||
</View> | ||
</TouchableWithoutFeedback> | ||
</View> | ||
</View> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
export { CreateGroupFooter } from './CreateGroupFooter' | ||
export { CreateGroupFooterWithIcon } from './CreateGroupFooterWithIcon' | ||
export { CreateGroupHeader } from './CreateGroupHeader' | ||
export { CreateGroupMemberList } from './CreateGroupMemberList' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.