@@ -19,6 +19,7 @@ import { detectLinksInEditor } from "@/lib/utils/link";
19
19
import LinkCardPrompt from "./LinkCardPrompt" ;
20
20
import LinkCard from "./LinkCard" ;
21
21
import usePublishPost from "@/lib/hooks/bsky/feed/usePublishPost" ;
22
+ import { ThreadgateSetting } from "../../../../types/feed" ;
22
23
23
24
interface Props {
24
25
onCancel : ( ) => void ;
@@ -28,12 +29,13 @@ interface Props {
28
29
29
30
export default function Editor ( props : Props ) {
30
31
const { onCancel, options, author } = props ;
31
- const { replyTo, onPost , quote, mention } = options ?? { } ;
32
+ const { replyTo, quote, mention } = options ?? { } ;
32
33
const [ label , setLabel ] = useState ( "" ) ;
34
+ const [ threadGate , setThreadGate ] = useState < ThreadgateSetting [ ] > ( [ ] ) ;
33
35
const [ languages , setLanguages ] = useState < Language [ ] > ( [ ] ) ;
34
36
const [ images , setImages ] = useState < UploadImage [ ] > ( ) ;
35
37
const [ embedSuggestions , setEmbedSuggestions ] = useState < Set < string > > (
36
- new Set ( "" )
38
+ new Set ( "" ) ,
37
39
) ;
38
40
const [ linkEmbed , setLinkEmbed ] = useState ( "" ) ;
39
41
const [ linkCard , setLinkCard ] = useState < LinkMeta | null > ( null ) ;
@@ -42,7 +44,7 @@ export default function Editor(props: Props) {
42
44
const quoteAuthor = quote ?. author . displayName ?? quote ?. author . handle ;
43
45
const placeholderText = getComposerPlaceholder (
44
46
replyTo ? "reply" : quote ? "quote" : "post" ,
45
- replyAuthor ?? quoteAuthor
47
+ replyAuthor ?? quoteAuthor ,
46
48
) ;
47
49
48
50
const editor = useEditor ( {
@@ -112,12 +114,13 @@ export default function Editor(props: Props) {
112
114
languages : languages . map ( ( lang ) => lang . code ) ,
113
115
images,
114
116
label,
117
+ threadGate,
115
118
} ) ;
116
119
117
120
if ( ! editor ) return null ;
118
121
119
122
return (
120
- < section className = "bg-white p-3 bottom-0 z-50 fixed w-full h-full md:max-h-[80svh] md:h-fit md:border-t shadow-2xl rounded-t-3xl overflow-auto animate-fade-up animate-duration-200 " >
123
+ < section className = "animate-fade-up animate-duration-200 fixed bottom-0 z-50 h-full w-full overflow-auto rounded-t-3xl bg-white p-3 shadow-2xl md:h-fit md:max-h-[80svh] md:border-t " >
121
124
< div className = "mx-auto max-w-2xl" >
122
125
< TopEditorBar
123
126
onClose = { onCancel }
@@ -135,7 +138,7 @@ export default function Editor(props: Props) {
135
138
< div className = "mb-3" >
136
139
{ quote && < QuoteToPreview post = { quote } /> }
137
140
{ embedSuggestions . size > 0 && (
138
- < div className = "flex flex-col gap-y-3 mb -3" >
141
+ < div className = "mb-3 flex flex-col gap-y-3" >
139
142
{ Array . from ( embedSuggestions ) . map ( ( link ) => (
140
143
< LinkCardPrompt
141
144
key = { link }
@@ -166,6 +169,8 @@ export default function Editor(props: Props) {
166
169
text = { editor . getJSON ( ) }
167
170
languages = { languages }
168
171
onSelectLanguages = { setLanguages }
172
+ threadGate = { threadGate }
173
+ onUpdateThreadGate = { setThreadGate }
169
174
images = { images }
170
175
onUpdateImages = { setImages }
171
176
/>
0 commit comments