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"),
|
expansibleActions = window.app.settings.get("postCard_expansible_actions"),
|
||||||
autoCarrousel = window.app.settings.get("postCard_carrusel_auto"),
|
autoCarrousel = window.app.settings.get("postCard_carrusel_auto"),
|
||||||
data = {},
|
data = {},
|
||||||
events = {}
|
events = {},
|
||||||
|
fullmode
|
||||||
}) => {
|
}) => {
|
||||||
const [loading, setLoading] = React.useState(true)
|
const [loading, setLoading] = React.useState(true)
|
||||||
const [likes, setLikes] = React.useState(data.likes ?? [])
|
const [likes, setLikes] = React.useState(data.likes ?? [])
|
||||||
@ -307,6 +308,15 @@ export const PostCard = React.memo(({
|
|||||||
setComments(data.comments)
|
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(() => {
|
React.useEffect(() => {
|
||||||
// first listen to post changes
|
// first listen to post changes
|
||||||
window.app.api.namespaces["main"].listenEvent(`post.dataUpdate.${data._id}`, onDataUpdate)
|
window.app.api.namespaces["main"].listenEvent(`post.dataUpdate.${data._id}`, onDataUpdate)
|
||||||
@ -341,8 +351,10 @@ export const PostCard = React.memo(({
|
|||||||
className={classnames(
|
className={classnames(
|
||||||
"postCard",
|
"postCard",
|
||||||
{ ["liked"]: hasLiked },
|
{ ["liked"]: hasLiked },
|
||||||
{ ["noHide"]: !expansibleActions }
|
{ ["noHide"]: !expansibleActions },
|
||||||
|
{ ["fullmode"]: fullmode },
|
||||||
)}
|
)}
|
||||||
|
onDoubleClick={onDoubleClick}
|
||||||
>
|
>
|
||||||
<div className="wrapper">
|
<div className="wrapper">
|
||||||
<PostHeader
|
<PostHeader
|
||||||
|
@ -31,6 +31,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.fullmode {
|
||||||
|
max-width: none;
|
||||||
|
}
|
||||||
|
|
||||||
.wrapper {
|
.wrapper {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user