mirror of
https://github.com/wgh136/nysoure.git
synced 2025-12-16 15:51:14 +00:00
nsfw images
This commit is contained in:
@@ -28,6 +28,7 @@ export default function PublishPage() {
|
||||
const [images, setImages] = useState<number[]>([]);
|
||||
const [links, setLinks] = useState<{ label: string; url: string }[]>([]);
|
||||
const [galleryImages, setGalleryImages] = useState<number[]>([]);
|
||||
const [galleryNsfw, setGalleryNsfw] = useState<number[]>([]);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [isSubmitting, setSubmitting] = useState(false);
|
||||
|
||||
@@ -108,6 +109,7 @@ export default function PublishPage() {
|
||||
images: images,
|
||||
links: links,
|
||||
gallery: galleryImages,
|
||||
gallery_nsfw: galleryNsfw,
|
||||
});
|
||||
if (res.success) {
|
||||
localStorage.removeItem("publish_data");
|
||||
@@ -332,6 +334,7 @@ export default function PublishPage() {
|
||||
<td>{t("Preview")}</td>
|
||||
<td>{"Markdown"}</td>
|
||||
<td>{"Gallery"}</td>
|
||||
<td>{"Nsfw"}</td>
|
||||
<td>{t("Action")}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -375,6 +378,22 @@ export default function PublishPage() {
|
||||
}}
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<input
|
||||
type="checkbox"
|
||||
className="checkbox checkbox-accent"
|
||||
checked={galleryNsfw.includes(image)}
|
||||
onChange={(e) => {
|
||||
if (e.target.checked) {
|
||||
setGalleryNsfw((prev) => [...prev, image]);
|
||||
} else {
|
||||
setGalleryNsfw((prev) =>
|
||||
prev.filter((id) => id !== image),
|
||||
);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<button
|
||||
className={"btn btn-square"}
|
||||
|
||||
Reference in New Issue
Block a user