[FIX] Markdown's ListItem not using the entered index (#4388)
* fix ordered list number * update snapshot
This commit is contained in:
parent
7e9d528904
commit
e1e4305cbc
|
@ -142,7 +142,8 @@ const ActionSheet = React.memo(
|
||||||
onChange={index => index === -1 && onClose()}
|
onChange={index => index === -1 && onClose()}
|
||||||
// We need this to allow horizontal swipe gestures inside bottom sheet like in reaction picker
|
// We need this to allow horizontal swipe gestures inside bottom sheet like in reaction picker
|
||||||
enableContentPanningGesture={data?.enableContentPanningGesture ?? true}
|
enableContentPanningGesture={data?.enableContentPanningGesture ?? true}
|
||||||
{...androidTablet}>
|
{...androidTablet}
|
||||||
|
>
|
||||||
<BottomSheetContent options={data?.options} hide={hide} children={data?.children} hasCancel={data?.hasCancel} />
|
<BottomSheetContent options={data?.options} hide={hide} children={data?.children} hasCancel={data?.hasCancel} />
|
||||||
</BottomSheet>
|
</BottomSheet>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -62,7 +62,8 @@ const TabBarItem = ({ tab, index, goToPage, baseUrl, getCustomEmoji }: ITabBarIt
|
||||||
}}
|
}}
|
||||||
style={({ pressed }: { pressed: boolean }) => ({
|
style={({ pressed }: { pressed: boolean }) => ({
|
||||||
opacity: pressed ? 0.7 : 1
|
opacity: pressed ? 0.7 : 1
|
||||||
})}>
|
})}
|
||||||
|
>
|
||||||
<View style={styles.tabBarItem}>
|
<View style={styles.tabBarItem}>
|
||||||
<Emoji
|
<Emoji
|
||||||
content={tab.emoji}
|
content={tab.emoji}
|
||||||
|
@ -91,7 +92,8 @@ const ReactionsTabBar = ({ tabs, activeTab, goToPage, baseUrl, getCustomEmoji, w
|
||||||
width: tabWidth,
|
width: tabWidth,
|
||||||
borderBottomWidth: isActiveTab ? 2 : 1,
|
borderBottomWidth: isActiveTab ? 2 : 1,
|
||||||
borderColor: isActiveTab ? colors.tintActive : colors.separatorColor
|
borderColor: isActiveTab ? colors.tintActive : colors.separatorColor
|
||||||
}}>
|
}}
|
||||||
|
>
|
||||||
<TabBarItem tab={tab} index={index} goToPage={goToPage} baseUrl={baseUrl} getCustomEmoji={getCustomEmoji} />
|
<TabBarItem tab={tab} index={index} goToPage={goToPage} baseUrl={baseUrl} getCustomEmoji={getCustomEmoji} />
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|
|
@ -4,20 +4,19 @@ import { OrderedList as OrderedListProps } from '@rocket.chat/message-parser';
|
||||||
|
|
||||||
import Inline from './Inline';
|
import Inline from './Inline';
|
||||||
import styles from '../styles';
|
import styles from '../styles';
|
||||||
import { themes } from '../../../lib/constants';
|
|
||||||
import { useTheme } from '../../../theme';
|
import { useTheme } from '../../../theme';
|
||||||
|
|
||||||
interface IOrderedListProps {
|
interface IOrderedListProps {
|
||||||
value: OrderedListProps['value'];
|
value: OrderedListProps['value'];
|
||||||
}
|
}
|
||||||
|
|
||||||
const OrderedList = ({ value }: IOrderedListProps) => {
|
const OrderedList = ({ value }: IOrderedListProps): React.ReactElement => {
|
||||||
const { theme } = useTheme();
|
const { colors } = useTheme();
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
{value.map((item, index) => (
|
{value.map(item => (
|
||||||
<View style={styles.row}>
|
<View style={styles.row} key={item.number?.toString()}>
|
||||||
<Text style={[styles.text, { color: themes[theme].bodyText }]}>{index + 1}. </Text>
|
<Text style={[styles.text, { color: colors.bodyText }]}>{item.number}. </Text>
|
||||||
<Inline value={item.value} />
|
<Inline value={item.value} />
|
||||||
</View>
|
</View>
|
||||||
))}
|
))}
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue