[FIX] Text color and fit content of TaskList (#4906)

* fix regression on plain text

* update stories

* fix where to add the color

* fit content taskList

---------

Co-authored-by: Reinaldo Neto <reinaldonetof@hotmail.com>
This commit is contained in:
Gleidson Daniel Silva 2023-02-16 10:07:19 -03:00 committed by Diego Mello
parent 69062ffe22
commit 26ca0d043f
3 changed files with 7 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,7 @@ interface IPlainProps {
value: PlainProps['value'];
}
const Plain = ({ value }: IPlainProps) => (
const Plain = ({ value }: IPlainProps): React.ReactElement => (
<Text accessibilityLabel={value} style={styles.plainText}>
{value}
</Text>

View File

@ -4,7 +4,6 @@ import { Tasks as TasksProps } from '@rocket.chat/message-parser';
import Inline from './Inline';
import styles from '../styles';
import { themes } from '../../../lib/constants';
import { useTheme } from '../../../theme';
interface ITasksProps {
@ -12,13 +11,15 @@ interface ITasksProps {
}
const TaskList = ({ value = [] }: ITasksProps) => {
const { theme } = useTheme();
const { colors } = useTheme();
return (
<View>
{value.map(item => (
<View style={styles.row}>
<Text style={[styles.text, { color: themes[theme].bodyText }]}>{item.status ? '- [x] ' : '- [ ] '}</Text>
<Inline value={item.value} />
<Text style={[styles.text, { color: colors.bodyText }]}>{item.status ? '- [x] ' : '- [ ] '}</Text>
<Text style={[styles.inline, { color: colors.bodyText }]}>
<Inline value={item.value} />
</Text>
</View>
))}
</View>