improve fullmode post layout

This commit is contained in:
srgooglo 2022-09-16 15:02:40 +02:00
parent 5b8ca313fe
commit 6711a2c2c9
2 changed files with 78 additions and 16 deletions

View File

@ -349,6 +349,16 @@ export const PostCard = React.memo(({
return events.onDoubleClick(data)
}
React.useEffect(() => {
if (fullmode) {
app.eventBus.emit("style.compactMode", true)
}
return () => {
app.eventBus.emit("style.compactMode", false)
}
}, [])
React.useEffect(() => {
// first listen to post changes
window.app.api.namespaces["main"].listenEvent(`post.dataUpdate.${data._id}`, onDataUpdate)
@ -397,29 +407,36 @@ export const PostCard = React.memo(({
isLiked={hasLiked}
likes={likes.length}
comments={comments.length}
fullmode={fullmode}
/>
<PostContent
data={data}
autoCarrousel={autoCarrousel}
fullmode={fullmode}
/>
</div>
<div className="actionsIndicatorWrapper">
<div className="actionsIndicator">
<Icons.MoreHorizontal />
{!fullmode &&
<div className="actionsIndicatorWrapper">
<div className="actionsIndicator">
<Icons.MoreHorizontal />
</div>
</div>
</div>
<div className="actionsWrapper">
<PostActions
isSelf={selfId === data.user_id}
defaultLiked={hasLiked}
defaultSaved={hasSaved}
onClickLike={onClickLike}
onClickSave={onClickSave}
actions={{
delete: onClickDelete,
}}
/>
</div>
}
{!fullmode &&
<div className="actionsWrapper">
<PostActions
isSelf={selfId === data.user_id}
defaultLiked={hasLiked}
defaultSaved={hasSaved}
onClickLike={onClickLike}
onClickSave={onClickSave}
actions={{
delete: onClickDelete,
}}
fullmode={fullmode}
/>
</div>
}
</div>
})

View File

@ -33,6 +33,51 @@
&.fullmode {
max-width: none;
height: 100%;
background-color: transparent;
filter: none;
.actionsIndicatorWrapper {
opacity: 0;
}
.actionsWrapper {
opacity: 1;
}
.wrapper {
height: 100%;
.content {
height: 100%;
.additions {
height: fit-content;
max-height: 80vh;
.addition {
display: flex !important;
flex-direction: column;
align-items: center;
justify-content: center;
img,
video {
width: fit-content;
height: 100%;
align-self: center;
object-fit: contain;
border-radius: 8px;
}
}
}
}
}
}
.wrapper {