1
0
mirror of https://github.com/tooot-app/app synced 2024-12-27 01:42:32 +01:00

Use system separator color in Separator component (#757)

* border color is too distracting and does not look "native". Now we using system separator color to provide "native" experience :-)
This commit is contained in:
vitalyster 2023-08-24 23:21:31 +03:00 committed by GitHub
parent f64135a6df
commit c3aba848a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 1 deletions

View File

@ -22,7 +22,7 @@ const ComponentSeparator: React.FC<Props> = ({
style, style,
{ {
backgroundColor: colors.backgroundDefault, backgroundColor: colors.backgroundDefault,
borderTopColor: colors.border, borderTopColor: colors.separator,
borderTopWidth: 1, borderTopWidth: 1,
marginLeft: StyleConstants.Spacing.Global.PagePadding + extraMarginLeft, marginLeft: StyleConstants.Spacing.Global.PagePadding + extraMarginLeft,
marginRight: StyleConstants.Spacing.Global.PagePadding + extraMarginRight marginRight: StyleConstants.Spacing.Global.PagePadding + extraMarginRight

View File

@ -1,4 +1,5 @@
import { DarkTheme, DefaultTheme } from '@react-navigation/native' import { DarkTheme, DefaultTheme } from '@react-navigation/native'
import { Platform, PlatformColor } from 'react-native'
export type Theme = 'light' | 'dark_lighter' | 'dark_darker' export type Theme = 'light' | 'dark_lighter' | 'dark_darker'
@ -16,6 +17,7 @@ export type ColorDefinitions =
| 'backgroundOverlayDefault' | 'backgroundOverlayDefault'
| 'backgroundOverlayInvert' | 'backgroundOverlayInvert'
| 'border' | 'border'
| 'separator'
| 'shimmerDefault' | 'shimmerDefault'
| 'shimmerHighlight' | 'shimmerHighlight'
@ -94,6 +96,33 @@ const themeColors: {
dark_darker: 'rgb(90, 90, 90)' dark_darker: 'rgb(90, 90, 90)'
}, },
separator: {
light: PlatformColor(
Platform.select({
ios: 'separator',
android: '?android:attr/dividerVertical',
default: 'rgb(180, 180, 180)'
}),
'rgb(180, 180, 180)'
) as unknown as string,
dark_lighter: PlatformColor(
Platform.select({
ios: 'separator',
android: '?android:attr/dividerVertical',
default: 'rgb(90, 90, 90)'
}),
'rgb(90, 90, 90)'
) as unknown as string,
dark_darker: PlatformColor(
Platform.select({
ios: 'separator',
android: '?android:attr/dividerVertical',
default: 'rgb(90, 90, 90)'
}),
'rgb(90, 90, 90)'
) as unknown as string
},
shimmerDefault: { shimmerDefault: {
light: 'rgba(25, 25, 25, 0.05)', light: 'rgba(25, 25, 25, 0.05)',
dark_lighter: 'rgba(250, 250, 250, 0.05)', dark_lighter: 'rgba(250, 250, 250, 0.05)',