mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
added fullmode
This commit is contained in:
parent
adbb5fca95
commit
7b655a9a65
@ -277,7 +277,8 @@ export const PostCard = React.memo(({
|
||||
expansibleActions = window.app.settings.get("postCard_expansible_actions"),
|
||||
autoCarrousel = window.app.settings.get("postCard_carrusel_auto"),
|
||||
data = {},
|
||||
events = {}
|
||||
events = {},
|
||||
fullmode
|
||||
}) => {
|
||||
const [loading, setLoading] = React.useState(true)
|
||||
const [likes, setLikes] = React.useState(data.likes ?? [])
|
||||
@ -307,6 +308,15 @@ export const PostCard = React.memo(({
|
||||
setComments(data.comments)
|
||||
}
|
||||
|
||||
const onDoubleClick = () => {
|
||||
if (typeof events.onDoubleClick !== "function") {
|
||||
console.warn("onDoubleClick event is not a function")
|
||||
return
|
||||
}
|
||||
|
||||
return events.onDoubleClick(data)
|
||||
}
|
||||
|
||||
React.useEffect(() => {
|
||||
// first listen to post changes
|
||||
window.app.api.namespaces["main"].listenEvent(`post.dataUpdate.${data._id}`, onDataUpdate)
|
||||
@ -341,8 +351,10 @@ export const PostCard = React.memo(({
|
||||
className={classnames(
|
||||
"postCard",
|
||||
{ ["liked"]: hasLiked },
|
||||
{ ["noHide"]: !expansibleActions }
|
||||
{ ["noHide"]: !expansibleActions },
|
||||
{ ["fullmode"]: fullmode },
|
||||
)}
|
||||
onDoubleClick={onDoubleClick}
|
||||
>
|
||||
<div className="wrapper">
|
||||
<PostHeader
|
||||
|
@ -31,6 +31,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
&.fullmode {
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
|
Loading…
x
Reference in New Issue
Block a user