feat: fixes and formatter
This commit is contained in:
@@ -1,24 +1,21 @@
|
||||
import { useContext } from "reactn";
|
||||
import { Pressable, View, Image, Text } from "react-native";
|
||||
import { Video, ResizeMode } from "expo-video";
|
||||
import { Fonts, gutters, Palette } from "../styles";
|
||||
import Style, { mainBorderRadius } from "../styles/Style";
|
||||
import { icons } from "../assets";
|
||||
import { substringTextLength } from "../helpers";
|
||||
import { WebViewContext } from "../providers/WebViewProvider.js";
|
||||
import { useContext } from 'reactn'
|
||||
import { Pressable, View, Image, Text } from 'react-native'
|
||||
import { Video, ResizeMode } from 'expo-video'
|
||||
import { Fonts, gutters, Palette } from '../styles'
|
||||
import Style, { mainBorderRadius } from '../styles/Style'
|
||||
import { icons } from '../assets'
|
||||
import { substringTextLength } from '../helpers'
|
||||
import { WebViewContext } from '../providers/WebViewProvider.js'
|
||||
|
||||
const thumbnailStyle = {
|
||||
width: 200,
|
||||
height: 200,
|
||||
borderRadius: mainBorderRadius / 2,
|
||||
overflow: "hidden",
|
||||
};
|
||||
overflow: 'hidden',
|
||||
}
|
||||
|
||||
const RenderChatFile = (
|
||||
{ uri, type = "image", name = "", containerStyle = {} },
|
||||
index,
|
||||
) => {
|
||||
const { setWebViewUrl } = useContext(WebViewContext);
|
||||
const RenderChatFile = ({ uri, type = 'image', name = '', containerStyle = {} }, index) => {
|
||||
const { setWebViewUrl } = useContext(WebViewContext)
|
||||
|
||||
return (
|
||||
<View
|
||||
@@ -28,7 +25,7 @@ const RenderChatFile = (
|
||||
...containerStyle,
|
||||
}}
|
||||
>
|
||||
{type === "IMAGE" ? (
|
||||
{type === 'IMAGE' ? (
|
||||
<Pressable>
|
||||
<Image
|
||||
alt={name}
|
||||
@@ -38,10 +35,10 @@ const RenderChatFile = (
|
||||
style={thumbnailStyle}
|
||||
/>
|
||||
</Pressable>
|
||||
) : type === "FILE" ? (
|
||||
) : type === 'FILE' ? (
|
||||
<Pressable
|
||||
onPress={() => {
|
||||
setWebViewUrl(uri);
|
||||
setWebViewUrl(uri)
|
||||
}}
|
||||
style={{
|
||||
...Style.containerRow,
|
||||
@@ -61,17 +58,17 @@ const RenderChatFile = (
|
||||
/>
|
||||
<Text
|
||||
style={Fonts({
|
||||
type: "default",
|
||||
type: 'default',
|
||||
style: {
|
||||
color: Palette.white,
|
||||
textDecorationLine: "underline",
|
||||
textDecorationLine: 'underline',
|
||||
},
|
||||
})}
|
||||
>
|
||||
{substringTextLength({ text: name, maxLength: 40 })}
|
||||
</Text>
|
||||
</Pressable>
|
||||
) : type === "VIDEO" ? (
|
||||
) : type === 'VIDEO' ? (
|
||||
<Video
|
||||
style={{ ...thumbnailStyle }}
|
||||
source={{
|
||||
@@ -88,7 +85,7 @@ const RenderChatFile = (
|
||||
/>
|
||||
) : null}
|
||||
</View>
|
||||
);
|
||||
};
|
||||
)
|
||||
}
|
||||
|
||||
export default RenderChatFile;
|
||||
export default RenderChatFile
|
||||
|
||||
Reference in New Issue
Block a user