From 9ac799f30ad8af72c32938bdac9725bf7933d24c Mon Sep 17 00:00:00 2001 From: Alexander Platov Date: Wed, 25 Aug 2021 09:47:52 +0300 Subject: [PATCH] Fix `Activity` and `ScrollBox` components. Gap in `Dialog` footer. (#57) Signed-off-by: Alexander Platov --- packages/ui/src/components/Dialog.svelte | 31 +++++++------- packages/ui/src/components/ScrollBox.svelte | 17 ++++---- .../src/components/Activity.svelte | 42 +++++++++++++------ 3 files changed, 56 insertions(+), 34 deletions(-) diff --git a/packages/ui/src/components/Dialog.svelte b/packages/ui/src/components/Dialog.svelte index b5afe1204d..fc776d586d 100644 --- a/packages/ui/src/components/Dialog.svelte +++ b/packages/ui/src/components/Dialog.svelte @@ -34,15 +34,15 @@
{ okAction(); dispatch('close') }}>
-
-
{ dispatch('close') }}>
+
+
{ dispatch('close') }}>
- +
@@ -55,14 +55,14 @@ flex-direction: row-reverse; width: 100vw; min-height: 100vh; - height: 100vh; + max-height: 100vh; .dialog { display: flex; flex-direction: column; - width: auto; + width: 45rem; min-height: 100vh; - height: 100vh; + max-height: 100vh; background-color: var(--theme-bg-color); border-radius: 1.875rem 0 0 1.875rem; box-shadow: 0px 3.125rem 7.5rem rgba(0, 0, 0, .4); @@ -90,21 +90,22 @@ .content { flex-shrink: 0; - width: 40rem; + flex-grow: 1; margin: 0 2.5rem; - height: calc(100vh - 10.5rem); + height: fit-content; } .footer { - display: flex; - overflow: hidden; - flex-direction: row-reverse; - align-items: center; flex-shrink: 0; - gap: .75rem; + display: grid; + grid-auto-flow: column; + justify-content: end; + align-items: center; + column-gap: .75rem; padding: 0 2.5rem; height: 6rem; mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0) 1.25rem, rgba(0, 0, 0, 1) 2.5rem); + overflow: hidden; } } } diff --git a/packages/ui/src/components/ScrollBox.svelte b/packages/ui/src/components/ScrollBox.svelte index cc14a1d488..92706c5f46 100644 --- a/packages/ui/src/components/ScrollBox.svelte +++ b/packages/ui/src/components/ScrollBox.svelte @@ -14,14 +14,14 @@ --> -
-
+
+
@@ -38,10 +38,8 @@ .box { position: absolute; - display: grid; - grid-auto-flow: column; + display: flex; padding: 0 0 .375rem 0; - gap: 1.5rem; top: 0; left: 0; width: auto; @@ -56,7 +54,7 @@ overflow-x: hidden; overflow-y: auto; .box { - grid-auto-flow: row; + flex-direction: column; padding: 0 .5rem 0 .5rem; width: 100%; height: auto; @@ -73,5 +71,10 @@ padding: 0 .375rem .375rem 0; } } + + &.noShift { + margin: 0; + .box { padding: 0; } + } } diff --git a/plugins/chunter-resources/src/components/Activity.svelte b/plugins/chunter-resources/src/components/Activity.svelte index e51c361e7a..e2c7ea4d9f 100644 --- a/plugins/chunter-resources/src/components/Activity.svelte +++ b/plugins/chunter-resources/src/components/Activity.svelte @@ -20,9 +20,8 @@ import type { Doc, Ref, Space } from '@anticrm/core' import type { Comment } from '@anticrm/chunter' import { ReferenceInput } from '@anticrm/text-editor' import { createQuery, getClient } from '@anticrm/presentation' -import { Section, IconComments, Grid } from '@anticrm/ui' +import { ScrollBox, Grid } from '@anticrm/ui' -import Bookmark from './icons/Bookmark.svelte' import Backlink from './Backlink.svelte' import chunter from '@anticrm/chunter' @@ -45,13 +44,32 @@ function onMessage(event: CustomEvent) { } -
- - {#if comments} - {#each comments as comment} - - {/each} - {/if} - - -
+
+
+ + {#if comments} + + {#each comments as comment} + + {/each} + + {/if} + +
+ +
+ +