feat: add support for tasks and unordered list markdown (#5057)
* merged conflicts * test cases fixed * test case fixed * comments addressed * test update * checkbox package removed * test case fixed * podfile updated * podlock file fixed * fix test * comments addressed --------- Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com>
This commit is contained in:
parent
b81e22c934
commit
c8e1f20d1e
File diff suppressed because one or more lines are too long
|
@ -5,6 +5,7 @@ import { Tasks as TasksProps } from '@rocket.chat/message-parser';
|
|||
import Inline from './Inline';
|
||||
import styles from '../styles';
|
||||
import { useTheme } from '../../../theme';
|
||||
import { CustomIcon } from '../../CustomIcon';
|
||||
|
||||
interface ITasksProps {
|
||||
value: TasksProps['value'];
|
||||
|
@ -16,7 +17,14 @@ const TaskList = ({ value = [] }: ITasksProps) => {
|
|||
<View>
|
||||
{value.map(item => (
|
||||
<View style={styles.row}>
|
||||
<Text style={[styles.text, { color: colors.bodyText }]}>{item.status ? '- [x] ' : '- [ ] '}</Text>
|
||||
<Text style={[styles.text, { color: colors.bodyText }]}>
|
||||
<CustomIcon
|
||||
testID={item.status ? 'task-list-checked' : 'task-list-unchecked'}
|
||||
name={item.status ? 'checkbox-checked' : 'checkbox-unchecked'}
|
||||
size={24}
|
||||
color={colors.taskBoxColor}
|
||||
/>
|
||||
</Text>
|
||||
<Text style={[styles.inline, { color: colors.bodyText }]}>
|
||||
<Inline value={item.value} />
|
||||
</Text>
|
||||
|
|
|
@ -17,8 +17,8 @@ const UnorderedList = ({ value }: IUnorderedListProps) => {
|
|||
<View>
|
||||
{value.map(item => (
|
||||
<View style={styles.row}>
|
||||
<Text style={[styles.text, styles.listPrefix, { color: themes[theme].bodyText }]}>- </Text>
|
||||
<Text style={[styles.text, styles.inline, { color: themes[theme].bodyText }]}>
|
||||
<Text style={[styles.text, { color: themes[theme].bodyText }]}>{'\u2022'}</Text>
|
||||
<Text style={[styles.inline, { color: themes[theme].bodyText }]}>
|
||||
<Inline value={item.value} />
|
||||
</Text>
|
||||
</View>
|
||||
|
|
|
@ -289,6 +289,7 @@ export const colors = {
|
|||
statusBackgroundWarning: '#FFECAD',
|
||||
statusFontOnWarning: '#B88D00',
|
||||
overlayColor: '#1F2329CC',
|
||||
taskBoxColor: '#9297a2',
|
||||
...mentions,
|
||||
...callButtons
|
||||
},
|
||||
|
@ -370,6 +371,7 @@ export const colors = {
|
|||
statusBackgroundWarning: '#FFECAD',
|
||||
statusFontOnWarning: '#B88D00',
|
||||
overlayColor: '#1F2329CC',
|
||||
taskBoxColor: '#9297a2',
|
||||
...mentions,
|
||||
...callButtons
|
||||
},
|
||||
|
@ -451,6 +453,7 @@ export const colors = {
|
|||
statusBackgroundWarning: '#FFECAD',
|
||||
statusFontOnWarning: '#B88D00',
|
||||
overlayColor: '#1F2329CC',
|
||||
taskBoxColor: '#9297a2',
|
||||
...mentions,
|
||||
...callButtons
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue