mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-25 08:30:58 -05:00
Update EmbedSpoiler.tsx
This commit is contained in:
parent
7221f233b1
commit
e48bc58a8d
1 changed files with 7 additions and 2 deletions
|
@ -1,11 +1,16 @@
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
|
import { useState } from "preact/hooks";
|
||||||
import { API } from "revolt.js";
|
import { API } from "revolt.js";
|
||||||
import styles from "./Embed.module.scss";
|
import styles from "./Embed.module.scss";
|
||||||
|
|
||||||
|
|
||||||
export default function EmbedSpoiler(){
|
export default function EmbedSpoiler(){
|
||||||
|
|
||||||
|
const [visible, setVisible] = useState(true);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames(styles.spoiler_container)}>
|
<div className={classNames(styles.spoiler_container, visible ? null : styles.hidden)} onClick={() => setVisible(!visible)}>
|
||||||
<h1 className={classNames(styles.spoiler_title)}>SPOILER</h1>
|
<h1 className={classNames(styles.spoiler_title)}>SPOILER</h1>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue