mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
fixed images to be under node
This commit is contained in:
parent
335c9b6523
commit
650e62cfa1
4 changed files with 106 additions and 84 deletions
|
@ -165,7 +165,8 @@ const NodeImageSlideBlock: FC<IProps> = ({
|
|||
const updateMaxHeight = useCallback(() => {
|
||||
if (!wrap.current) return;
|
||||
const { width } = wrap.current.getBoundingClientRect();
|
||||
setMaxHeight(width * NODE_SETTINGS.MAX_IMAGE_ASPECT);
|
||||
// setMaxHeight(width * NODE_SETTINGS.MAX_IMAGE_ASPECT);
|
||||
setMaxHeight(window.innerHeight - 175);
|
||||
normalizeOffset();
|
||||
}, [wrap, setMaxHeight, normalizeOffset]);
|
||||
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
min-width: 0;
|
||||
width: 100%;
|
||||
transition: height 0.25s;
|
||||
border-radius: $radius $radius 0 0;
|
||||
border-radius: $radius;
|
||||
margin-bottom: 20px;
|
||||
|
||||
.is_loading {
|
||||
.placeholder {
|
||||
|
@ -24,17 +25,21 @@
|
|||
user-select: none;
|
||||
will-change: transform, height;
|
||||
transition: height 500ms, transform 500ms;
|
||||
padding: 10px 0;
|
||||
|
||||
&:active {
|
||||
transition: none;
|
||||
}
|
||||
|
||||
.image {
|
||||
// that was for containered image:
|
||||
// max-height: 960px;
|
||||
max-height: 120vh !important;
|
||||
max-width: 100%;
|
||||
// max-height: 120vh !important;
|
||||
// max-width: 100%;
|
||||
opacity: 1;
|
||||
border-radius: $radius $radius 0 0;
|
||||
border-radius: $radius;
|
||||
box-shadow: transparentize($color: white, $amount: 0.95) 0 -1px,
|
||||
transparentize($color: #000000, $amount: 0.5) 0 4px 10px;
|
||||
}
|
||||
|
||||
&.is_dragging {
|
||||
|
|
|
@ -112,91 +112,107 @@ const NodeLayoutUnconnected: FC<IProps> = memo(
|
|||
}, [nodeSetCoverImage, node.cover]);
|
||||
|
||||
return (
|
||||
<Card className={styles.node} seamless>
|
||||
<div className={styles.node}>
|
||||
{block &&
|
||||
createElement(block, { node, is_loading, updateLayout, layout, modalShowPhotoswipe })}
|
||||
|
||||
<NodePanel
|
||||
node={pick(['title', 'user', 'is_liked', 'is_heroic', 'deleted_at', 'created_at'], node)}
|
||||
layout={layout}
|
||||
can_edit={can_edit}
|
||||
can_like={can_like}
|
||||
can_star={can_star}
|
||||
onEdit={onEdit}
|
||||
onLike={onLike}
|
||||
onStar={onStar}
|
||||
onLock={onLock}
|
||||
is_loading={is_loading}
|
||||
/>
|
||||
<Card seamless>
|
||||
<NodePanel
|
||||
node={pick(
|
||||
['title', 'user', 'is_liked', 'is_heroic', 'deleted_at', 'created_at'],
|
||||
node
|
||||
)}
|
||||
layout={layout}
|
||||
can_edit={can_edit}
|
||||
can_like={can_like}
|
||||
can_star={can_star}
|
||||
onEdit={onEdit}
|
||||
onLike={onLike}
|
||||
onStar={onStar}
|
||||
onLock={onLock}
|
||||
is_loading={is_loading}
|
||||
/>
|
||||
|
||||
{node.deleted_at ? (
|
||||
<NodeDeletedBadge />
|
||||
) : (
|
||||
<Group>
|
||||
<Padder>
|
||||
<Group horizontal className={styles.content}>
|
||||
<Group className={styles.comments}>
|
||||
{inline_block && (
|
||||
<div className={styles.inline_block}>
|
||||
{createElement(inline_block, {
|
||||
node,
|
||||
is_loading,
|
||||
updateLayout,
|
||||
layout,
|
||||
modalShowPhotoswipe,
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
{node.deleted_at ? (
|
||||
<NodeDeletedBadge />
|
||||
) : (
|
||||
<Group>
|
||||
<Padder>
|
||||
<Group horizontal className={styles.content}>
|
||||
<Group className={styles.comments}>
|
||||
{inline_block && (
|
||||
<div className={styles.inline_block}>
|
||||
{createElement(inline_block, {
|
||||
node,
|
||||
is_loading,
|
||||
updateLayout,
|
||||
layout,
|
||||
modalShowPhotoswipe,
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{is_loading || is_loading_comments || (!comments.length && !inline_block) ? (
|
||||
<NodeNoComments is_loading={is_loading_comments || is_loading} />
|
||||
) : (
|
||||
<NodeComments
|
||||
comments={comments}
|
||||
comment_data={comment_data}
|
||||
comment_count={comment_count}
|
||||
user={user}
|
||||
onDelete={nodeLockComment}
|
||||
onEdit={nodeEditComment}
|
||||
onLoadMore={nodeLoadMoreComments}
|
||||
order="DESC"
|
||||
/>
|
||||
)}
|
||||
{is_loading || is_loading_comments || (!comments.length && !inline_block) ? (
|
||||
<NodeNoComments is_loading={is_loading_comments || is_loading} />
|
||||
) : (
|
||||
<NodeComments
|
||||
comments={comments}
|
||||
comment_data={comment_data}
|
||||
comment_count={comment_count}
|
||||
user={user}
|
||||
onDelete={nodeLockComment}
|
||||
onEdit={nodeEditComment}
|
||||
onLoadMore={nodeLoadMoreComments}
|
||||
order="DESC"
|
||||
/>
|
||||
)}
|
||||
|
||||
{is_user && !is_loading && <NodeCommentForm />}
|
||||
{is_user && !is_loading && <NodeCommentForm />}
|
||||
</Group>
|
||||
|
||||
<div className={styles.panel}>
|
||||
<Sticky>
|
||||
<Group style={{ flex: 1, minWidth: 0 }}>
|
||||
{!is_loading && (
|
||||
<NodeTags
|
||||
is_editable={is_user}
|
||||
tags={node.tags}
|
||||
onChange={onTagsChange}
|
||||
/>
|
||||
)}
|
||||
|
||||
{is_loading && <NodeRelatedPlaceholder />}
|
||||
|
||||
{!is_loading &&
|
||||
related &&
|
||||
related.albums &&
|
||||
Object.keys(related.albums)
|
||||
.filter(album => related.albums[album].length > 0)
|
||||
.map(album => (
|
||||
<NodeRelated
|
||||
title={album}
|
||||
items={related.albums[album]}
|
||||
key={album}
|
||||
/>
|
||||
))}
|
||||
|
||||
{!is_loading &&
|
||||
related &&
|
||||
related.similar &&
|
||||
related.similar.length > 0 && (
|
||||
<NodeRelated title="ПОХОЖИЕ" items={related.similar} />
|
||||
)}
|
||||
</Group>
|
||||
</Sticky>
|
||||
</div>
|
||||
</Group>
|
||||
</Padder>
|
||||
</Group>
|
||||
)}
|
||||
|
||||
<div className={styles.panel}>
|
||||
<Sticky>
|
||||
<Group style={{ flex: 1, minWidth: 0 }}>
|
||||
{!is_loading && (
|
||||
<NodeTags is_editable={is_user} tags={node.tags} onChange={onTagsChange} />
|
||||
)}
|
||||
|
||||
{is_loading && <NodeRelatedPlaceholder />}
|
||||
|
||||
{!is_loading &&
|
||||
related &&
|
||||
related.albums &&
|
||||
Object.keys(related.albums)
|
||||
.filter(album => related.albums[album].length > 0)
|
||||
.map(album => (
|
||||
<NodeRelated title={album} items={related.albums[album]} key={album} />
|
||||
))}
|
||||
|
||||
{!is_loading && related && related.similar && related.similar.length > 0 && (
|
||||
<NodeRelated title="ПОХОЖИЕ" items={related.similar} />
|
||||
)}
|
||||
</Group>
|
||||
</Sticky>
|
||||
</div>
|
||||
</Group>
|
||||
</Padder>
|
||||
</Group>
|
||||
)}
|
||||
|
||||
<Footer />
|
||||
</Card>
|
||||
<Footer />
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
);
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
}
|
||||
|
||||
.node {
|
||||
background: $node_bg;
|
||||
box-shadow: $node_shadow;
|
||||
// background: $node_bg;
|
||||
// box-shadow: $node_shadow;
|
||||
}
|
||||
|
||||
.buttons {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue