add close button reader

This commit is contained in:
2026-04-08 16:26:37 -05:00
parent eb07af78b2
commit 501c195d79
2 changed files with 15 additions and 1 deletions

View File

@@ -4,6 +4,8 @@ import {useEffect} from "react";
import {AnimateFade, AnimateTemplate} from "../animations";
import "./reader.sass";
import {ExternalLink} from "../router/Link";
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
import {faClose} from "@fortawesome/free-solid-svg-icons/faClose";
const READER : AnimateTemplate = AnimateFade();
@@ -21,7 +23,7 @@ export function Reader() {
function handleClose() {
Promise.all([
animate(".reader", READER.initial),
animate(".reader", READER.initial)
]
).then(() => setPost(undefined));
}
@@ -34,6 +36,9 @@ export function Reader() {
onClick={handleClose}
className="reader link">
<article onClick={e => e.stopPropagation()}>
<button onClick={handleClose} className="link reader-close">
<FontAwesomeIcon icon={faClose} />
</button>
<post.article components={{
'a': ExternalLink
}}/>

View File

@@ -41,3 +41,12 @@
.row>*
width: 50%
.reader-close
position: absolute
align-self: flex-end
font-size: large
font-weight: bold
color: red !important
background: white
border-radius: 15px