1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

fixed images to be under node

This commit is contained in:
Fedor Katurov 2020-04-21 16:35:14 +07:00
parent 335c9b6523
commit 650e62cfa1
4 changed files with 106 additions and 84 deletions

View file

@ -165,7 +165,8 @@ const NodeImageSlideBlock: FC<IProps> = ({
const updateMaxHeight = useCallback(() => { const updateMaxHeight = useCallback(() => {
if (!wrap.current) return; if (!wrap.current) return;
const { width } = wrap.current.getBoundingClientRect(); const { width } = wrap.current.getBoundingClientRect();
setMaxHeight(width * NODE_SETTINGS.MAX_IMAGE_ASPECT); // setMaxHeight(width * NODE_SETTINGS.MAX_IMAGE_ASPECT);
setMaxHeight(window.innerHeight - 175);
normalizeOffset(); normalizeOffset();
}, [wrap, setMaxHeight, normalizeOffset]); }, [wrap, setMaxHeight, normalizeOffset]);

View file

@ -4,7 +4,8 @@
min-width: 0; min-width: 0;
width: 100%; width: 100%;
transition: height 0.25s; transition: height 0.25s;
border-radius: $radius $radius 0 0; border-radius: $radius;
margin-bottom: 20px;
.is_loading { .is_loading {
.placeholder { .placeholder {
@ -24,17 +25,21 @@
user-select: none; user-select: none;
will-change: transform, height; will-change: transform, height;
transition: height 500ms, transform 500ms; transition: height 500ms, transform 500ms;
padding: 10px 0;
&:active { &:active {
transition: none; transition: none;
} }
.image { .image {
// that was for containered image:
// max-height: 960px; // max-height: 960px;
max-height: 120vh !important; // max-height: 120vh !important;
max-width: 100%; // max-width: 100%;
opacity: 1; 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 { &.is_dragging {

View file

@ -112,12 +112,16 @@ const NodeLayoutUnconnected: FC<IProps> = memo(
}, [nodeSetCoverImage, node.cover]); }, [nodeSetCoverImage, node.cover]);
return ( return (
<Card className={styles.node} seamless> <div className={styles.node}>
{block && {block &&
createElement(block, { node, is_loading, updateLayout, layout, modalShowPhotoswipe })} createElement(block, { node, is_loading, updateLayout, layout, modalShowPhotoswipe })}
<Card seamless>
<NodePanel <NodePanel
node={pick(['title', 'user', 'is_liked', 'is_heroic', 'deleted_at', 'created_at'], node)} node={pick(
['title', 'user', 'is_liked', 'is_heroic', 'deleted_at', 'created_at'],
node
)}
layout={layout} layout={layout}
can_edit={can_edit} can_edit={can_edit}
can_like={can_like} can_like={can_like}
@ -170,7 +174,11 @@ const NodeLayoutUnconnected: FC<IProps> = memo(
<Sticky> <Sticky>
<Group style={{ flex: 1, minWidth: 0 }}> <Group style={{ flex: 1, minWidth: 0 }}>
{!is_loading && ( {!is_loading && (
<NodeTags is_editable={is_user} tags={node.tags} onChange={onTagsChange} /> <NodeTags
is_editable={is_user}
tags={node.tags}
onChange={onTagsChange}
/>
)} )}
{is_loading && <NodeRelatedPlaceholder />} {is_loading && <NodeRelatedPlaceholder />}
@ -181,10 +189,17 @@ const NodeLayoutUnconnected: FC<IProps> = memo(
Object.keys(related.albums) Object.keys(related.albums)
.filter(album => related.albums[album].length > 0) .filter(album => related.albums[album].length > 0)
.map(album => ( .map(album => (
<NodeRelated title={album} items={related.albums[album]} key={album} /> <NodeRelated
title={album}
items={related.albums[album]}
key={album}
/>
))} ))}
{!is_loading && related && related.similar && related.similar.length > 0 && ( {!is_loading &&
related &&
related.similar &&
related.similar.length > 0 && (
<NodeRelated title="ПОХОЖИЕ" items={related.similar} /> <NodeRelated title="ПОХОЖИЕ" items={related.similar} />
)} )}
</Group> </Group>
@ -197,6 +212,7 @@ const NodeLayoutUnconnected: FC<IProps> = memo(
<Footer /> <Footer />
</Card> </Card>
</div>
); );
} }
); );

View file

@ -27,8 +27,8 @@
} }
.node { .node {
background: $node_bg; // background: $node_bg;
box-shadow: $node_shadow; // box-shadow: $node_shadow;
} }
.buttons { .buttons {