style : update style responsive
Deskripsi: - update api discussion - update calender - update dicussion No Issue
This commit is contained in:
@@ -4,13 +4,18 @@ import LayoutModal from "@/module/_global/layout/layout_modal";
|
||||
import { Avatar, Box, Button, Center, Grid, Group, rem, Text, Textarea } from "@mantine/core";
|
||||
import { useState } from "react";
|
||||
import toast from "react-hot-toast";
|
||||
import { funCreateDiscussion } from "../lib/api_discussion";
|
||||
import { funCreateDiscussion, funGetDiscussionById } from "../lib/api_discussion";
|
||||
import { useParams, useRouter } from "next/navigation";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import { funGetProfileByCookies } from "@/module/user/profile/lib/api_profile";
|
||||
|
||||
export default function FormCreateDiscussion({ id }: { id: string }) {
|
||||
const [isValModal, setValModal] = useState(false)
|
||||
const router = useRouter()
|
||||
const param = useParams<{ id: string }>()
|
||||
const [isImg, setImg] = useState("")
|
||||
const param = useParams<{ id: string, detail: string }>()
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [img, setIMG] = useState<any | null>()
|
||||
const [touched, setTouched] = useState({
|
||||
desc: false,
|
||||
});
|
||||
@@ -18,6 +23,22 @@ export default function FormCreateDiscussion({ id }: { id: string }) {
|
||||
desc: "",
|
||||
idDivision: id
|
||||
})
|
||||
async function getData() {
|
||||
try {
|
||||
setLoading(true)
|
||||
const res = await funGetProfileByCookies()
|
||||
setIMG(`/api/file/img?jenis=image&cat=user&file=${res.data.img}`)
|
||||
setLoading(false)
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
} finally {
|
||||
setLoading(false)
|
||||
}
|
||||
}
|
||||
|
||||
useShallowEffect(() => {
|
||||
getData()
|
||||
}, [])
|
||||
|
||||
async function createDiscussion(val: boolean) {
|
||||
try {
|
||||
@@ -45,13 +66,12 @@ export default function FormCreateDiscussion({ id }: { id: string }) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<Box >
|
||||
<Box p={20} >
|
||||
<Grid gutter={0} pt={10}>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Avatar src={'https://i.pravatar.cc/1000?img=32'} alt="it's me" size="lg" />
|
||||
<Grid.Col span={2}>
|
||||
<Avatar src={img} alt="it's me" size="lg" />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={10}>
|
||||
<Box>
|
||||
@@ -61,7 +81,7 @@ export default function FormCreateDiscussion({ id }: { id: string }) {
|
||||
input: {
|
||||
border: 'none',
|
||||
backgroundColor: 'transparent',
|
||||
height: "60vh"
|
||||
height: "70vh"
|
||||
}
|
||||
}}
|
||||
value={isData.desc}
|
||||
|
||||
Reference in New Issue
Block a user