From 650e62cfa1faee630fec839a30b4339580441df4 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Tue, 21 Apr 2020 16:35:14 +0700 Subject: [PATCH] fixed images to be under node --- .../node/NodeImageSlideBlock/index.tsx | 3 +- .../node/NodeImageSlideBlock/styles.scss | 13 +- src/containers/node/NodeLayout/index.tsx | 170 ++++++++++-------- src/containers/node/NodeLayout/styles.scss | 4 +- 4 files changed, 106 insertions(+), 84 deletions(-) diff --git a/src/components/node/NodeImageSlideBlock/index.tsx b/src/components/node/NodeImageSlideBlock/index.tsx index f7753228..be24dfbf 100644 --- a/src/components/node/NodeImageSlideBlock/index.tsx +++ b/src/components/node/NodeImageSlideBlock/index.tsx @@ -165,7 +165,8 @@ const NodeImageSlideBlock: FC = ({ 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]); diff --git a/src/components/node/NodeImageSlideBlock/styles.scss b/src/components/node/NodeImageSlideBlock/styles.scss index 4b9874c8..6953d04e 100644 --- a/src/components/node/NodeImageSlideBlock/styles.scss +++ b/src/components/node/NodeImageSlideBlock/styles.scss @@ -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 { diff --git a/src/containers/node/NodeLayout/index.tsx b/src/containers/node/NodeLayout/index.tsx index dfcc0a3e..87ec4d14 100644 --- a/src/containers/node/NodeLayout/index.tsx +++ b/src/containers/node/NodeLayout/index.tsx @@ -112,91 +112,107 @@ const NodeLayoutUnconnected: FC = memo( }, [nodeSetCoverImage, node.cover]); return ( - +
{block && createElement(block, { node, is_loading, updateLayout, layout, modalShowPhotoswipe })} - + + - {node.deleted_at ? ( - - ) : ( - - - - - {inline_block && ( -
- {createElement(inline_block, { - node, - is_loading, - updateLayout, - layout, - modalShowPhotoswipe, - })} -
- )} + {node.deleted_at ? ( + + ) : ( + + + + + {inline_block && ( +
+ {createElement(inline_block, { + node, + is_loading, + updateLayout, + layout, + modalShowPhotoswipe, + })} +
+ )} - {is_loading || is_loading_comments || (!comments.length && !inline_block) ? ( - - ) : ( - - )} + {is_loading || is_loading_comments || (!comments.length && !inline_block) ? ( + + ) : ( + + )} - {is_user && !is_loading && } + {is_user && !is_loading && } +
+ +
+ + + {!is_loading && ( + + )} + + {is_loading && } + + {!is_loading && + related && + related.albums && + Object.keys(related.albums) + .filter(album => related.albums[album].length > 0) + .map(album => ( + + ))} + + {!is_loading && + related && + related.similar && + related.similar.length > 0 && ( + + )} + + +
+
+
+ )} -
- - - {!is_loading && ( - - )} - - {is_loading && } - - {!is_loading && - related && - related.albums && - Object.keys(related.albums) - .filter(album => related.albums[album].length > 0) - .map(album => ( - - ))} - - {!is_loading && related && related.similar && related.similar.length > 0 && ( - - )} - - -
-
-
-
- )} - -
); } ); diff --git a/src/containers/node/NodeLayout/styles.scss b/src/containers/node/NodeLayout/styles.scss index 1770299b..b789bfaa 100644 --- a/src/containers/node/NodeLayout/styles.scss +++ b/src/containers/node/NodeLayout/styles.scss @@ -27,8 +27,8 @@ } .node { - background: $node_bg; - box-shadow: $node_shadow; + // background: $node_bg; + // box-shadow: $node_shadow; } .buttons {