upd: announcement dan upload gambar
Deskripsi - fix html tag pada pengumuman - testing upload gambar = blm selesai No Issues
This commit is contained in:
@@ -6,7 +6,8 @@ import { useAuthSession } from "@/providers/AuthProvider";
|
||||
import { AntDesign, Entypo, MaterialIcons } from "@expo/vector-icons";
|
||||
import { router, Stack, useLocalSearchParams } from "expo-router";
|
||||
import { useEffect, useState } from "react";
|
||||
import { SafeAreaView, ScrollView, Text, View } from "react-native";
|
||||
import { Dimensions, SafeAreaView, ScrollView, Text, View } from "react-native";
|
||||
import RenderHTML from 'react-native-render-html';
|
||||
import { useSelector } from "react-redux";
|
||||
|
||||
type Props = {
|
||||
@@ -18,10 +19,11 @@ type Props = {
|
||||
export default function DetailAnnouncement() {
|
||||
const { id } = useLocalSearchParams<{ id: string }>();
|
||||
const { token, decryptToken } = useAuthSession()
|
||||
const [data, setData] = useState<Props>()
|
||||
const [data, setData] = useState<Props>({ id: '', title: '', desc: '' })
|
||||
const [dataMember, setDataMember] = useState<any>({})
|
||||
const update = useSelector((state: any) => state.announcementUpdate)
|
||||
const entityUser = useSelector((state: any) => state.user)
|
||||
const contentWidth = Dimensions.get('window').width
|
||||
|
||||
async function handleLoad() {
|
||||
try {
|
||||
@@ -55,9 +57,11 @@ export default function DetailAnnouncement() {
|
||||
<MaterialIcons name="campaign" size={30} color="black" style={Styles.mr05} />
|
||||
<Text style={[Styles.textDefaultSemiBold]}>{data?.title}</Text>
|
||||
</View>
|
||||
<View style={[Styles.rowItemsCenter, Styles.mt10]}>
|
||||
<AntDesign name="profile" size={30} color="black" style={Styles.mr05} />
|
||||
<Text style={[Styles.textDefault]}>{data?.desc}</Text>
|
||||
<View style={[Styles.mt10]}>
|
||||
<RenderHTML
|
||||
contentWidth={contentWidth}
|
||||
source={{ html: data?.desc }}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
<View style={[Styles.wrapPaper, Styles.mv15]}>
|
||||
@@ -71,7 +75,7 @@ export default function DetailAnnouncement() {
|
||||
return (
|
||||
<View key={x} style={[Styles.rowItemsCenter]}>
|
||||
<Entypo name="dot-single" size={24} color="black" />
|
||||
<Text style={[Styles.textDefault]}>{item.division}</Text>
|
||||
<Text style={[Styles.textDefault]} numberOfLines={1} ellipsizeMode='tail'>{item.division}</Text>
|
||||
</View>
|
||||
)
|
||||
})
|
||||
|
||||
@@ -70,7 +70,7 @@ export default function Announcement() {
|
||||
</View>
|
||||
}
|
||||
title={item.title}
|
||||
desc={item.desc}
|
||||
desc={item.desc.replace(/<[^>]*>?/gm, '')}
|
||||
rightTopInfo={item.createdAt}
|
||||
/>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user