Revert "[FIX] Attachment not rendering markdown (#2924)"
This reverts commit 2ea7e9d3f9
.
This commit is contained in:
parent
2ea7e9d3f9
commit
c49f837432
|
@ -39301,44 +39301,17 @@ exports[`Storyshots Message list message 1`] = `
|
||||||
Object {
|
Object {
|
||||||
"backgroundColor": "transparent",
|
"backgroundColor": "transparent",
|
||||||
"fontFamily": "System",
|
"fontFamily": "System",
|
||||||
"fontSize": 16,
|
"fontSize": 14,
|
||||||
"fontWeight": "400",
|
"fontWeight": "400",
|
||||||
"textAlign": "left",
|
"textAlign": "left",
|
||||||
},
|
},
|
||||||
undefined,
|
|
||||||
Object {
|
Object {
|
||||||
"color": "#2f343d",
|
"color": "#2f343d",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Text
|
Value 1
|
||||||
accessibilityLabel="Value 1"
|
|
||||||
style={
|
|
||||||
Array [
|
|
||||||
Object {
|
|
||||||
"backgroundColor": "transparent",
|
|
||||||
"fontFamily": "System",
|
|
||||||
"fontSize": 16,
|
|
||||||
"fontWeight": "400",
|
|
||||||
"textAlign": "left",
|
|
||||||
},
|
|
||||||
Array [
|
|
||||||
Object {},
|
|
||||||
Object {
|
|
||||||
"alignItems": "flex-start",
|
|
||||||
"flexDirection": "row",
|
|
||||||
"flexWrap": "wrap",
|
|
||||||
"justifyContent": "flex-start",
|
|
||||||
"marginBottom": 0,
|
|
||||||
"marginTop": 0,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
]
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Value 1
|
|
||||||
</Text>
|
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
<View
|
<View
|
||||||
|
@ -39378,44 +39351,17 @@ exports[`Storyshots Message list message 1`] = `
|
||||||
Object {
|
Object {
|
||||||
"backgroundColor": "transparent",
|
"backgroundColor": "transparent",
|
||||||
"fontFamily": "System",
|
"fontFamily": "System",
|
||||||
"fontSize": 16,
|
"fontSize": 14,
|
||||||
"fontWeight": "400",
|
"fontWeight": "400",
|
||||||
"textAlign": "left",
|
"textAlign": "left",
|
||||||
},
|
},
|
||||||
undefined,
|
|
||||||
Object {
|
Object {
|
||||||
"color": "#2f343d",
|
"color": "#2f343d",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Text
|
Value 2
|
||||||
accessibilityLabel="Value 2"
|
|
||||||
style={
|
|
||||||
Array [
|
|
||||||
Object {
|
|
||||||
"backgroundColor": "transparent",
|
|
||||||
"fontFamily": "System",
|
|
||||||
"fontSize": 16,
|
|
||||||
"fontWeight": "400",
|
|
||||||
"textAlign": "left",
|
|
||||||
},
|
|
||||||
Array [
|
|
||||||
Object {},
|
|
||||||
Object {
|
|
||||||
"alignItems": "flex-start",
|
|
||||||
"flexDirection": "row",
|
|
||||||
"flexWrap": "wrap",
|
|
||||||
"justifyContent": "flex-start",
|
|
||||||
"marginBottom": 0,
|
|
||||||
"marginTop": 0,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
]
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Value 2
|
|
||||||
</Text>
|
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
<View
|
<View
|
||||||
|
@ -39455,44 +39401,17 @@ exports[`Storyshots Message list message 1`] = `
|
||||||
Object {
|
Object {
|
||||||
"backgroundColor": "transparent",
|
"backgroundColor": "transparent",
|
||||||
"fontFamily": "System",
|
"fontFamily": "System",
|
||||||
"fontSize": 16,
|
"fontSize": 14,
|
||||||
"fontWeight": "400",
|
"fontWeight": "400",
|
||||||
"textAlign": "left",
|
"textAlign": "left",
|
||||||
},
|
},
|
||||||
undefined,
|
|
||||||
Object {
|
Object {
|
||||||
"color": "#2f343d",
|
"color": "#2f343d",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Text
|
Value 3
|
||||||
accessibilityLabel="Value 3"
|
|
||||||
style={
|
|
||||||
Array [
|
|
||||||
Object {
|
|
||||||
"backgroundColor": "transparent",
|
|
||||||
"fontFamily": "System",
|
|
||||||
"fontSize": 16,
|
|
||||||
"fontWeight": "400",
|
|
||||||
"textAlign": "left",
|
|
||||||
},
|
|
||||||
Array [
|
|
||||||
Object {},
|
|
||||||
Object {
|
|
||||||
"alignItems": "flex-start",
|
|
||||||
"flexDirection": "row",
|
|
||||||
"flexWrap": "wrap",
|
|
||||||
"justifyContent": "flex-start",
|
|
||||||
"marginBottom": 0,
|
|
||||||
"marginTop": 0,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
]
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Value 3
|
|
||||||
</Text>
|
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
<View
|
<View
|
||||||
|
@ -39532,44 +39451,17 @@ exports[`Storyshots Message list message 1`] = `
|
||||||
Object {
|
Object {
|
||||||
"backgroundColor": "transparent",
|
"backgroundColor": "transparent",
|
||||||
"fontFamily": "System",
|
"fontFamily": "System",
|
||||||
"fontSize": 16,
|
"fontSize": 14,
|
||||||
"fontWeight": "400",
|
"fontWeight": "400",
|
||||||
"textAlign": "left",
|
"textAlign": "left",
|
||||||
},
|
},
|
||||||
undefined,
|
|
||||||
Object {
|
Object {
|
||||||
"color": "#2f343d",
|
"color": "#2f343d",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Text
|
Value 4
|
||||||
accessibilityLabel="Value 4"
|
|
||||||
style={
|
|
||||||
Array [
|
|
||||||
Object {
|
|
||||||
"backgroundColor": "transparent",
|
|
||||||
"fontFamily": "System",
|
|
||||||
"fontSize": 16,
|
|
||||||
"fontWeight": "400",
|
|
||||||
"textAlign": "left",
|
|
||||||
},
|
|
||||||
Array [
|
|
||||||
Object {},
|
|
||||||
Object {
|
|
||||||
"alignItems": "flex-start",
|
|
||||||
"flexDirection": "row",
|
|
||||||
"flexWrap": "wrap",
|
|
||||||
"justifyContent": "flex-start",
|
|
||||||
"marginBottom": 0,
|
|
||||||
"marginTop": 0,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
]
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Value 4
|
|
||||||
</Text>
|
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
<View
|
<View
|
||||||
|
@ -39609,44 +39501,17 @@ exports[`Storyshots Message list message 1`] = `
|
||||||
Object {
|
Object {
|
||||||
"backgroundColor": "transparent",
|
"backgroundColor": "transparent",
|
||||||
"fontFamily": "System",
|
"fontFamily": "System",
|
||||||
"fontSize": 16,
|
"fontSize": 14,
|
||||||
"fontWeight": "400",
|
"fontWeight": "400",
|
||||||
"textAlign": "left",
|
"textAlign": "left",
|
||||||
},
|
},
|
||||||
undefined,
|
|
||||||
Object {
|
Object {
|
||||||
"color": "#2f343d",
|
"color": "#2f343d",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Text
|
Value 5
|
||||||
accessibilityLabel="Value 5"
|
|
||||||
style={
|
|
||||||
Array [
|
|
||||||
Object {
|
|
||||||
"backgroundColor": "transparent",
|
|
||||||
"fontFamily": "System",
|
|
||||||
"fontSize": 16,
|
|
||||||
"fontWeight": "400",
|
|
||||||
"textAlign": "left",
|
|
||||||
},
|
|
||||||
Array [
|
|
||||||
Object {},
|
|
||||||
Object {
|
|
||||||
"alignItems": "flex-start",
|
|
||||||
"flexDirection": "row",
|
|
||||||
"flexWrap": "wrap",
|
|
||||||
"justifyContent": "flex-start",
|
|
||||||
"marginBottom": 0,
|
|
||||||
"marginTop": 0,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
]
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Value 5
|
|
||||||
</Text>
|
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
@ -39676,7 +39541,7 @@ exports[`Storyshots Message list message 1`] = `
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
Two short custom fields with markdown
|
Two short custom fields
|
||||||
</Text>
|
</Text>
|
||||||
<View
|
<View
|
||||||
accessible={true}
|
accessible={true}
|
||||||
|
@ -40086,44 +39951,17 @@ exports[`Storyshots Message list message 1`] = `
|
||||||
Object {
|
Object {
|
||||||
"backgroundColor": "transparent",
|
"backgroundColor": "transparent",
|
||||||
"fontFamily": "System",
|
"fontFamily": "System",
|
||||||
"fontSize": 16,
|
"fontSize": 14,
|
||||||
"fontWeight": "400",
|
"fontWeight": "400",
|
||||||
"textAlign": "left",
|
"textAlign": "left",
|
||||||
},
|
},
|
||||||
undefined,
|
|
||||||
Object {
|
Object {
|
||||||
"color": "#2f343d",
|
"color": "#2f343d",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Text
|
Value 1
|
||||||
accessibilityLabel="Value 1"
|
|
||||||
style={
|
|
||||||
Array [
|
|
||||||
Object {
|
|
||||||
"backgroundColor": "transparent",
|
|
||||||
"fontFamily": "System",
|
|
||||||
"fontSize": 16,
|
|
||||||
"fontWeight": "400",
|
|
||||||
"textAlign": "left",
|
|
||||||
},
|
|
||||||
Array [
|
|
||||||
Object {},
|
|
||||||
Object {
|
|
||||||
"alignItems": "flex-start",
|
|
||||||
"flexDirection": "row",
|
|
||||||
"flexWrap": "wrap",
|
|
||||||
"justifyContent": "flex-start",
|
|
||||||
"marginBottom": 0,
|
|
||||||
"marginTop": 0,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
]
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Value 1
|
|
||||||
</Text>
|
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
<View
|
<View
|
||||||
|
@ -40163,66 +40001,17 @@ exports[`Storyshots Message list message 1`] = `
|
||||||
Object {
|
Object {
|
||||||
"backgroundColor": "transparent",
|
"backgroundColor": "transparent",
|
||||||
"fontFamily": "System",
|
"fontFamily": "System",
|
||||||
"fontSize": 16,
|
"fontSize": 14,
|
||||||
"fontWeight": "400",
|
"fontWeight": "400",
|
||||||
"textAlign": "left",
|
"textAlign": "left",
|
||||||
},
|
},
|
||||||
undefined,
|
|
||||||
Object {
|
Object {
|
||||||
"color": "#2f343d",
|
"color": "#2f343d",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Text
|
Value 2
|
||||||
onLongPress={[Function]}
|
|
||||||
onPress={[Function]}
|
|
||||||
style={
|
|
||||||
Object {
|
|
||||||
"backgroundColor": "transparent",
|
|
||||||
"color": "#1d74f5",
|
|
||||||
"fontFamily": "System",
|
|
||||||
"fontSize": 16,
|
|
||||||
"fontWeight": "400",
|
|
||||||
"textAlign": "left",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<Text
|
|
||||||
accessibilityLabel="Value 2"
|
|
||||||
style={
|
|
||||||
Array [
|
|
||||||
Object {
|
|
||||||
"backgroundColor": "transparent",
|
|
||||||
"fontFamily": "System",
|
|
||||||
"fontSize": 16,
|
|
||||||
"fontWeight": "400",
|
|
||||||
"textAlign": "left",
|
|
||||||
},
|
|
||||||
Array [
|
|
||||||
Object {},
|
|
||||||
Object {
|
|
||||||
"alignItems": "flex-start",
|
|
||||||
"flexDirection": "row",
|
|
||||||
"flexWrap": "wrap",
|
|
||||||
"justifyContent": "flex-start",
|
|
||||||
"marginBottom": 0,
|
|
||||||
"marginTop": 0,
|
|
||||||
},
|
|
||||||
Object {
|
|
||||||
"backgroundColor": "transparent",
|
|
||||||
"fontFamily": "System",
|
|
||||||
"fontSize": 16,
|
|
||||||
"fontWeight": "400",
|
|
||||||
"textAlign": "left",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
]
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Value 2
|
|
||||||
</Text>
|
|
||||||
</Text>
|
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
@ -40402,44 +40191,17 @@ exports[`Storyshots Message list message 1`] = `
|
||||||
Object {
|
Object {
|
||||||
"backgroundColor": "transparent",
|
"backgroundColor": "transparent",
|
||||||
"fontFamily": "System",
|
"fontFamily": "System",
|
||||||
"fontSize": 16,
|
"fontSize": 14,
|
||||||
"fontWeight": "400",
|
"fontWeight": "400",
|
||||||
"textAlign": "left",
|
"textAlign": "left",
|
||||||
},
|
},
|
||||||
undefined,
|
|
||||||
Object {
|
Object {
|
||||||
"color": "#2f343d",
|
"color": "#2f343d",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Text
|
Value 1
|
||||||
accessibilityLabel="Value 1"
|
|
||||||
style={
|
|
||||||
Array [
|
|
||||||
Object {
|
|
||||||
"backgroundColor": "transparent",
|
|
||||||
"fontFamily": "System",
|
|
||||||
"fontSize": 16,
|
|
||||||
"fontWeight": "400",
|
|
||||||
"textAlign": "left",
|
|
||||||
},
|
|
||||||
Array [
|
|
||||||
Object {},
|
|
||||||
Object {
|
|
||||||
"alignItems": "flex-start",
|
|
||||||
"flexDirection": "row",
|
|
||||||
"flexWrap": "wrap",
|
|
||||||
"justifyContent": "flex-start",
|
|
||||||
"marginBottom": 0,
|
|
||||||
"marginTop": 0,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
]
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Value 1
|
|
||||||
</Text>
|
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
<View
|
<View
|
||||||
|
@ -40479,47 +40241,17 @@ exports[`Storyshots Message list message 1`] = `
|
||||||
Object {
|
Object {
|
||||||
"backgroundColor": "transparent",
|
"backgroundColor": "transparent",
|
||||||
"fontFamily": "System",
|
"fontFamily": "System",
|
||||||
"fontSize": 16,
|
"fontSize": 14,
|
||||||
"fontWeight": "400",
|
"fontWeight": "400",
|
||||||
"textAlign": "left",
|
"textAlign": "left",
|
||||||
},
|
},
|
||||||
undefined,
|
|
||||||
Object {
|
Object {
|
||||||
"color": "#2f343d",
|
"color": "#2f343d",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Text
|
Value 2
|
||||||
accessibilityLabel="Value 2"
|
|
||||||
style={
|
|
||||||
Array [
|
|
||||||
Object {
|
|
||||||
"backgroundColor": "transparent",
|
|
||||||
"fontFamily": "System",
|
|
||||||
"fontSize": 16,
|
|
||||||
"fontWeight": "400",
|
|
||||||
"textAlign": "left",
|
|
||||||
},
|
|
||||||
Array [
|
|
||||||
Object {},
|
|
||||||
Object {
|
|
||||||
"alignItems": "flex-start",
|
|
||||||
"flexDirection": "row",
|
|
||||||
"flexWrap": "wrap",
|
|
||||||
"justifyContent": "flex-start",
|
|
||||||
"marginBottom": 0,
|
|
||||||
"marginTop": 0,
|
|
||||||
},
|
|
||||||
Object {
|
|
||||||
"fontWeight": "bold",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
]
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Value 2
|
|
||||||
</Text>
|
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
|
@ -112,24 +112,16 @@ const Description = React.memo(({
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
const Fields = React.memo(({ attachment, theme, getCustomEmoji }) => {
|
const Fields = React.memo(({ attachment, theme }) => {
|
||||||
if (!attachment.fields) {
|
if (!attachment.fields) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { baseUrl, user } = useContext(MessageContext);
|
|
||||||
return (
|
return (
|
||||||
<View style={styles.fieldsContainer}>
|
<View style={styles.fieldsContainer}>
|
||||||
{attachment.fields.map(field => (
|
{attachment.fields.map(field => (
|
||||||
<View key={field.title} style={[styles.fieldContainer, { width: field.short ? '50%' : '100%' }]}>
|
<View key={field.title} style={[styles.fieldContainer, { width: field.short ? '50%' : '100%' }]}>
|
||||||
<Text style={[styles.fieldTitle, { color: themes[theme].bodyText }]}>{field.title}</Text>
|
<Text style={[styles.fieldTitle, { color: themes[theme].bodyText }]}>{field.title}</Text>
|
||||||
<Markdown
|
<Text style={[styles.fieldValue, { color: themes[theme].bodyText }]}>{field.value}</Text>
|
||||||
msg={field.value}
|
|
||||||
baseUrl={baseUrl}
|
|
||||||
username={user.username}
|
|
||||||
getCustomEmoji={getCustomEmoji}
|
|
||||||
theme={theme}
|
|
||||||
/>
|
|
||||||
</View>
|
</View>
|
||||||
))}
|
))}
|
||||||
</View>
|
</View>
|
||||||
|
@ -184,11 +176,7 @@ const Reply = React.memo(({
|
||||||
getCustomEmoji={getCustomEmoji}
|
getCustomEmoji={getCustomEmoji}
|
||||||
theme={theme}
|
theme={theme}
|
||||||
/>
|
/>
|
||||||
<Fields
|
<Fields attachment={attachment} theme={theme} />
|
||||||
attachment={attachment}
|
|
||||||
getCustomEmoji={getCustomEmoji}
|
|
||||||
theme={theme}
|
|
||||||
/>
|
|
||||||
</View>
|
</View>
|
||||||
</Touchable>
|
</Touchable>
|
||||||
<Markdown
|
<Markdown
|
||||||
|
@ -227,8 +215,7 @@ Description.displayName = 'MessageReplyDescription';
|
||||||
|
|
||||||
Fields.propTypes = {
|
Fields.propTypes = {
|
||||||
attachment: PropTypes.object,
|
attachment: PropTypes.object,
|
||||||
theme: PropTypes.string,
|
theme: PropTypes.string
|
||||||
getCustomEmoji: PropTypes.func
|
|
||||||
};
|
};
|
||||||
Fields.displayName = 'MessageReplyFields';
|
Fields.displayName = 'MessageReplyFields';
|
||||||
|
|
||||||
|
|
|
@ -706,7 +706,7 @@ export default ({ theme }) => {
|
||||||
}]}
|
}]}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Separator title='Two short custom fields with markdown' theme={theme} />
|
<Separator title='Two short custom fields' theme={theme} />
|
||||||
<Message
|
<Message
|
||||||
msg='Message'
|
msg='Message'
|
||||||
attachments={[{
|
attachments={[{
|
||||||
|
@ -720,7 +720,7 @@ export default ({ theme }) => {
|
||||||
short: true
|
short: true
|
||||||
}, {
|
}, {
|
||||||
title: 'Field 2',
|
title: 'Field 2',
|
||||||
value: '[Value 2](https://google.com/)',
|
value: 'Value 2',
|
||||||
short: true
|
short: true
|
||||||
}]
|
}]
|
||||||
}, {
|
}, {
|
||||||
|
@ -734,7 +734,7 @@ export default ({ theme }) => {
|
||||||
short: true
|
short: true
|
||||||
}, {
|
}, {
|
||||||
title: 'Field 2',
|
title: 'Field 2',
|
||||||
value: '**Value 2**',
|
value: 'Value 2',
|
||||||
short: true
|
short: true
|
||||||
}]
|
}]
|
||||||
}]}
|
}]}
|
||||||
|
|
Loading…
Reference in New Issue