Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2022-12-01 16:03:46 +06:00 committed by GitHub
parent e87b7fd27f
commit 50b6fa1877
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 10 deletions

View File

@ -82,7 +82,7 @@
$: if (editableMap) updateTxes(object) $: if (editableMap) updateTxes(object)
$: newTxPos = newTx(txes, $lastViews) $: newTxPos = newTx(txesF, $lastViews)
function newTx (txes: DisplayTx[], lastViews: Map<Ref<Doc>, number> | undefined): number { function newTx (txes: DisplayTx[], lastViews: Map<Ref<Doc>, number> | undefined): number {
const lastView = lastViews?.get(object._id) const lastView = lastViews?.get(object._id)
@ -129,7 +129,12 @@
{#if txesF} {#if txesF}
<Grid column={1} rowGap={1.5}> <Grid column={1} rowGap={1.5}>
{#each txesF as tx, i} {#each txesF as tx, i}
<TxView {tx} {viewlets} isNew={newTxPos === i} /> <TxView
{tx}
{viewlets}
isNew={newTxPos <= i && newTxPos !== -1}
isNextNew={newTxPos < i && newTxPos !== -1}
/>
{/each} {/each}
</Grid> </Grid>
{/if} {/if}
@ -166,7 +171,12 @@
{#if txesF} {#if txesF}
<Grid column={1} rowGap={1.5}> <Grid column={1} rowGap={1.5}>
{#each txesF as tx, i} {#each txesF as tx, i}
<TxView {tx} {viewlets} isNew={newTxPos === i} /> <TxView
{tx}
{viewlets}
isNew={newTxPos <= i && newTxPos !== -1}
isNextNew={newTxPos < i && newTxPos !== -1}
/>
{/each} {/each}
</Grid> </Grid>
{/if} {/if}

View File

@ -42,6 +42,7 @@
export let viewlets: Map<ActivityKey, TxViewlet> export let viewlets: Map<ActivityKey, TxViewlet>
export let showIcon: boolean = true export let showIcon: boolean = true
export let isNew: boolean = false export let isNew: boolean = false
export let isNextNew: boolean = false
// export let showDocument = false // export let showDocument = false
let ptx: DisplayTx | undefined let ptx: DisplayTx | undefined
@ -141,7 +142,7 @@
</script> </script>
{#if (viewlet !== undefined && !((viewlet?.hideOnRemove ?? false) && tx.removed)) || model.length > 0} {#if (viewlet !== undefined && !((viewlet?.hideOnRemove ?? false) && tx.removed)) || model.length > 0}
<div class="flex-between msgactivity-container" class:showIcon> <div class="flex-between msgactivity-container" class:showIcon class:isNew class:isNextNew>
{#if showIcon} {#if showIcon}
<div class="flex-center icon"> <div class="flex-center icon">
{#if viewlet} {#if viewlet}
@ -156,7 +157,6 @@
<div <div
class="flex-grow flex-col clear-mins" class="flex-grow flex-col clear-mins"
class:isNew
class:comment={viewlet && viewlet?.editable} class:comment={viewlet && viewlet?.editable}
class:mention={viewlet?.display === 'emphasized' || isMessageType(model[0]?.attribute)} class:mention={viewlet?.display === 'emphasized' || isMessageType(model[0]?.attribute)}
> >
@ -351,11 +351,6 @@
min-width: 0; min-width: 0;
} }
.isNew {
padding-bottom: 0.5rem;
border-bottom: 1px solid var(--highlight-red);
}
.showIcon { .showIcon {
&::after, &::after,
&::before { &::before {
@ -364,6 +359,19 @@
width: 1px; width: 1px;
background-color: var(--popup-divider); background-color: var(--popup-divider);
} }
&.isNew {
&::before {
background-color: var(--highlight-red);
}
.icon {
border: 1px solid var(--highlight-red);
}
&.isNextNew {
&:after {
background-color: var(--highlight-red);
}
}
}
&::before { &::before {
top: -1.5rem; top: -1.5rem;
height: 1.5rem; height: 1.5rem;