Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions app/containers/UIKit/Section.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { StyleSheet, View } from 'react-native';
import { BlockContext } from '@rocket.chat/ui-kit';

import { themes } from '../../lib/constants/colors';
import { type IAccessoryComponent, type IFields, type ISection } from './interfaces';
import { useTheme } from '../../theme';

Expand All @@ -17,7 +16,6 @@ const styles = StyleSheet.create({
justifyContent: 'center'
},
text: {
flex: 1,
padding: 4
},
field: {
Expand All @@ -28,10 +26,12 @@ const styles = StyleSheet.create({
const Accessory = ({ element, parser }: IAccessoryComponent) =>
parser.renderAccessories({ ...element }, BlockContext.SECTION, parser);

const Fields = ({ fields, parser, theme }: IFields) => (
const Fields = ({ fields, parser }: IFields) => (
<>
{fields.map(field => (
<Text style={[styles.text, styles.field, { color: themes[theme].fontDefault }]}>{parser.text(field)}</Text>
{fields.map((field, index) => (
<View key={index} style={[styles.text, styles.field]}>
{parser.text(field)}
</View>
))}
</>
);
Expand Down
48 changes: 10 additions & 38 deletions app/containers/UIKit/__snapshots__/UiKitMessage.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -666,19 +666,15 @@ exports[`Story Snapshots: Fields should match snapshot 1`] = `
]
}
>
<Text
<View
style={
[
{
"flex": 1,
"padding": 4,
},
{
"marginVertical": 6,
},
{
"color": "#2F343D",
},
]
}
>
Expand All @@ -702,20 +698,16 @@ exports[`Story Snapshots: Fields should match snapshot 1`] = `
>
*this is plain_text text*
</Text>
</Text>
<Text
</View>
<View
style={
[
{
"flex": 1,
"padding": 4,
},
{
"marginVertical": 6,
},
{
"color": "#2F343D",
},
]
}
>
Expand All @@ -739,20 +731,16 @@ exports[`Story Snapshots: Fields should match snapshot 1`] = `
>
*this is plain_text text*
</Text>
</Text>
<Text
</View>
<View
style={
[
{
"flex": 1,
"padding": 4,
},
{
"marginVertical": 6,
},
{
"color": "#2F343D",
},
]
}
>
Expand All @@ -776,20 +764,16 @@ exports[`Story Snapshots: Fields should match snapshot 1`] = `
>
*this is plain_text text*
</Text>
</Text>
<Text
</View>
<View
style={
[
{
"flex": 1,
"padding": 4,
},
{
"marginVertical": 6,
},
{
"color": "#2F343D",
},
]
}
>
Expand All @@ -813,20 +797,16 @@ exports[`Story Snapshots: Fields should match snapshot 1`] = `
>
*this is plain_text text*
</Text>
</Text>
<Text
</View>
<View
style={
[
{
"flex": 1,
"padding": 4,
},
{
"marginVertical": 6,
},
{
"color": "#2F343D",
},
]
}
>
Expand All @@ -850,7 +830,7 @@ exports[`Story Snapshots: Fields should match snapshot 1`] = `
>
*this is plain_text text*
</Text>
</Text>
</View>
</View>
`;

Expand All @@ -870,7 +850,6 @@ exports[`Story Snapshots: Section should match snapshot 1`] = `
<View
style={
{
"flex": 1,
"padding": 4,
}
}
Expand Down Expand Up @@ -950,7 +929,6 @@ exports[`Story Snapshots: SectionButton should match snapshot 1`] = `
<View
style={
{
"flex": 1,
"padding": 4,
}
}
Expand Down Expand Up @@ -1092,7 +1070,6 @@ exports[`Story Snapshots: SectionDatePicker should match snapshot 1`] = `
<View
style={
{
"flex": 1,
"padding": 4,
}
}
Expand Down Expand Up @@ -1234,7 +1211,6 @@ exports[`Story Snapshots: SectionMarkdownList should match snapshot 1`] = `
<View
style={
{
"flex": 1,
"padding": 4,
}
}
Expand Down Expand Up @@ -1432,7 +1408,6 @@ exports[`Story Snapshots: SectionMultiSelect should match snapshot 1`] = `
<View
style={
{
"flex": 1,
"padding": 4,
}
}
Expand Down Expand Up @@ -1571,7 +1546,6 @@ exports[`Story Snapshots: SectionMultiSelect should match snapshot 1`] = `
<View
style={
{
"flex": 1,
"padding": 4,
}
}
Expand Down Expand Up @@ -1714,7 +1688,6 @@ exports[`Story Snapshots: SectionOverflow should match snapshot 1`] = `
<View
style={
{
"flex": 1,
"padding": 4,
}
}
Expand Down Expand Up @@ -1864,7 +1837,6 @@ exports[`Story Snapshots: SectionSelect should match snapshot 1`] = `
<View
style={
{
"flex": 1,
"padding": 4,
}
}
Expand Down
Loading