mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 09:25:27 +00:00
Add spoilers back.
This commit is contained in:
33
src/components/common/messaging/attachments/Spoiler.tsx
Normal file
33
src/components/common/messaging/attachments/Spoiler.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import { Text } from "preact-i18n";
|
||||
import styled from "styled-components"
|
||||
|
||||
const Base = styled.div`
|
||||
display: grid;
|
||||
place-items: center;
|
||||
|
||||
z-index: 1;
|
||||
grid-area: 1 / 1;
|
||||
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
text-transform: uppercase;
|
||||
|
||||
span {
|
||||
padding: 8px;
|
||||
color: var(--foreground);
|
||||
background: var(--primary-background);
|
||||
border-radius: calc(var(--border-radius) * 4);
|
||||
}
|
||||
`;
|
||||
|
||||
interface Props {
|
||||
set: (v: boolean) => void
|
||||
}
|
||||
|
||||
export default function Spoiler({ set }: Props) {
|
||||
return (
|
||||
<Base onClick={() => set(false)}>
|
||||
<span><Text id="app.main.channel.misc.spoiler_attachment" /></span>
|
||||
</Base>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user