2
2
3
3
import { useEffect , useState } from 'react' ;
4
4
import usePostBoard from '@/hooks/mutations/usePostBoard' ;
5
- import useImageUpload from '@/hooks/common/useImageUpload' ;
6
- import Image from 'next/image' ;
5
+ // import useImageUpload from '@/hooks/common/useImageUpload';
6
+ // import Image from 'next/image';
7
+ // import usePostImageBoard from '@/hooks/mutations/usePostImageBoard';
7
8
import Avatar from '../../../../ui/Avatar' ;
8
9
import Button from '../../../../ui/Button' ;
9
10
import FlexBox from '../../../../ui/FlexBox' ;
@@ -17,7 +18,7 @@ export default function Upload({
17
18
} ) {
18
19
const [ postText , setPostText ] = useState ( '' ) ;
19
20
const { mutate : postBoard , isLoading, isSuccess } = usePostBoard ( postText ) ;
20
- const { handleImageUpload, imageFile, imagePreview } = useImageUpload ( ) ;
21
+ // const { handleImageUpload, imageFile, imagePreview } = useImageUpload();
21
22
22
23
const maxCharacters = 100 ;
23
24
const isOverMaxChar = postText . length > maxCharacters ;
@@ -26,7 +27,12 @@ export default function Upload({
26
27
setPostText ( event . target . value ) ;
27
28
} ;
28
29
useEffect ( ( ) => {
29
- if ( isSuccess ) setPostText ( '' ) ;
30
+ if ( isSuccess ) {
31
+ setPostText ( '' ) ;
32
+ }
33
+ // if (isSuccess && imageFile) {
34
+ // const { mutate: postImage, isLoading } = usePostImageBoard();
35
+ // }
30
36
} , [ isSuccess ] ) ;
31
37
32
38
return (
@@ -53,7 +59,7 @@ export default function Upload({
53
59
) : null }
54
60
</ div >
55
61
</ FlexBox >
56
- { imagePreview && (
62
+ { /* { imagePreview && (
57
63
<div className="relative w-full m-5 h-60 ">
58
64
<Image
59
65
fill
@@ -63,9 +69,9 @@ export default function Upload({
63
69
className="rounded-[10px] object-contain"
64
70
/>
65
71
</div>
66
- ) }
72
+ )} */ }
67
73
< FlexBox justify = "end" className = "gap-[10px] w-full" >
68
- < label
74
+ { /* <label
69
75
htmlFor="image"
70
76
className="rounded-[10px] h-[54px] w-40 p-2.5 bg-white border border-primary-200 text-primary-200 hover:border-primary-300 hover:text-primary-300 cursor-pointer text-center"
71
77
>
@@ -79,7 +85,7 @@ export default function Upload({
79
85
className="hidden"
80
86
accept="image/*"
81
87
/>
82
- </ label >
88
+ </label> */ }
83
89
< Button
84
90
size = "lg"
85
91
disabled = { postText . length === 0 || isOverMaxChar || isLoading }
0 commit comments