From 0dec8917c0943369d17d611f86fa8cbb3910271e Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 17 Jun 2024 11:09:20 +0200 Subject: [PATCH] fix behaviour of annotation footer in sidebar --- external/@worldbrain/memex-common | 2 +- .../components/AnnotationEditable.tsx | 101 ++++++++++++------ 2 files changed, 71 insertions(+), 32 deletions(-) diff --git a/external/@worldbrain/memex-common b/external/@worldbrain/memex-common index e87e946c01..8fe6b2afae 160000 --- a/external/@worldbrain/memex-common +++ b/external/@worldbrain/memex-common @@ -1 +1 @@ -Subproject commit e87e946c0137327f8a8b1c44f15e58de2c8b8262 +Subproject commit 8fe6b2afae215fdb5f9f5503bacae103db9e4159 diff --git a/src/annotations/components/AnnotationEditable.tsx b/src/annotations/components/AnnotationEditable.tsx index 4b9c1978a9..290e51760d 100644 --- a/src/annotations/components/AnnotationEditable.tsx +++ b/src/annotations/components/AnnotationEditable.tsx @@ -740,12 +740,12 @@ export default class AnnotationEditable extends React.Component { this.props.isShared ? ( Disable Auto-Add -
Only added to Spaces you select +
Only added to Spaces you manually select
) : ( Enable Auto-Add -
Added to all Spaces the page is +
Added to all Spaces the page is in
) } @@ -952,7 +952,10 @@ export default class AnnotationEditable extends React.Component { this.props.shareMenuAnnotationInstanceId === this.props.unifiedId, buttonRef: this.shareMenuButtonRef, - leftSideItem: this.renderAutoAddedIndicator(), + leftSideItem: + this.displayLists.length === 0 + ? this.renderAutoAddedIndicator() + : null, showKeyShortcut: this.props.isInFocus && 'S', }, { @@ -1022,6 +1025,12 @@ export default class AnnotationEditable extends React.Component { inFocus={this.props.isInFocus} inPageMode={this.props.contextLocation === 'in-page'} inEditMode={isEditing || isEditingHighlight} + isShown={ + this.state.hoverCard || + this.props.isInFocus || + isEditing || + isEditingHighlight + } > { inFocus={this.props.isInFocus} inPageMode={this.props.contextLocation === 'in-page'} inEditMode={isEditing || isEditingHighlight} - isShown={true} + // isShown={ + // isEditing || + // isEditingHighlight || + // isDeleting || + // this.props.isInFocus + // } > { {(this.creationInfo?.createdWhen && !this.props.isEditing) || this.displayLists.length >= 1 ? ( - + {this.creationInfo?.createdWhen && !this.props.isEditing && ( @@ -1428,27 +1446,33 @@ export default class AnnotationEditable extends React.Component { )} {this.displayLists.length >= 1 && ( - null} - spacePickerButtonRef={ - this.spacePickerBodyButtonRef - } - padding={ - this.props.isEditing - ? '0px' - : '0px' - } - removeSpaceForAnnotation={ - this.props - .removeSpaceFromEditorPicker - } - /> + + {this.renderAutoAddedIndicator()} + null} + spacePickerButtonRef={ + this + .spacePickerBodyButtonRef + } + padding={ + this.props.isEditing + ? '0px' + : '0px' + } + removeSpaceForAnnotation={ + this.props + .removeSpaceFromEditorPicker + } + /> + )} ) : null} @@ -1482,14 +1506,26 @@ export default class AnnotationEditable extends React.Component { } } -const DateAndSpaces = styled.div` +const ListSegmentBox = styled.div` display: flex; - justify-content: space-between; align-items: center; + justify-content: flex-start; + width: 100%; + grid-gap: 10px; + /* padding: 0px 15px; */ +` + +const DateAndSpaces = styled.div<{ + inSidebar: boolean +}>` + display: flex; + justify-content: space-between; width: 100%; - grid-gap: 20px; - padding: 5px 15px 10px 15px; box-sizing: border-box; + flex-direction: column-reverse; + align-items: flex-start; + padding: 10px 15px 10px 15px; + grid-gap: 10px; ` const DeleteScreenContainer = styled.div` @@ -1709,11 +1745,14 @@ const DefaultFooterStyled = styled.div<{ props.inPageMode && css` backdrop-filter: unset; - background: ${(props) => props.theme.colors.black}; + background: transparent; `}; ` const ActionFooterStyled = styled(DefaultFooterStyled)` padding: 0 0px 0px 0px; + position: absolute; + bottom: 0; + background: ${(props) => props.theme.colors.black0}; ` const HighlightActionsBox = styled.div<{}>`