Skip to content

Commit 0dec891

Browse files
fix behaviour of annotation footer in sidebar
1 parent e6ec661 commit 0dec891

File tree

2 files changed

+71
-32
lines changed

2 files changed

+71
-32
lines changed

src/annotations/components/AnnotationEditable.tsx

Lines changed: 70 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -740,12 +740,12 @@ export default class AnnotationEditable extends React.Component<Props, State> {
740740
this.props.isShared ? (
741741
<span>
742742
Disable Auto-Add
743-
<br /> Only added to Spaces you select
743+
<br /> Only added to Spaces you manually select
744744
</span>
745745
) : (
746746
<span>
747747
Enable Auto-Add
748-
<br /> Added to all Spaces the page is
748+
<br /> Added to all Spaces the page is in
749749
</span>
750750
)
751751
}
@@ -952,7 +952,10 @@ export default class AnnotationEditable extends React.Component<Props, State> {
952952
this.props.shareMenuAnnotationInstanceId ===
953953
this.props.unifiedId,
954954
buttonRef: this.shareMenuButtonRef,
955-
leftSideItem: this.renderAutoAddedIndicator(),
955+
leftSideItem:
956+
this.displayLists.length === 0
957+
? this.renderAutoAddedIndicator()
958+
: null,
956959
showKeyShortcut: this.props.isInFocus && 'S',
957960
},
958961
{
@@ -1022,6 +1025,12 @@ export default class AnnotationEditable extends React.Component<Props, State> {
10221025
inFocus={this.props.isInFocus}
10231026
inPageMode={this.props.contextLocation === 'in-page'}
10241027
inEditMode={isEditing || isEditingHighlight}
1028+
isShown={
1029+
this.state.hoverCard ||
1030+
this.props.isInFocus ||
1031+
isEditing ||
1032+
isEditingHighlight
1033+
}
10251034
>
10261035
<ItemBoxBottom
10271036
borderTop={false}
@@ -1072,7 +1081,12 @@ export default class AnnotationEditable extends React.Component<Props, State> {
10721081
inFocus={this.props.isInFocus}
10731082
inPageMode={this.props.contextLocation === 'in-page'}
10741083
inEditMode={isEditing || isEditingHighlight}
1075-
isShown={true}
1084+
// isShown={
1085+
// isEditing ||
1086+
// isEditingHighlight ||
1087+
// isDeleting ||
1088+
// this.props.isInFocus
1089+
// }
10761090
>
10771091
<ShareMenuContainer>
10781092
<PrimaryAction
@@ -1418,7 +1432,11 @@ export default class AnnotationEditable extends React.Component<Props, State> {
14181432
{(this.creationInfo?.createdWhen &&
14191433
!this.props.isEditing) ||
14201434
this.displayLists.length >= 1 ? (
1421-
<DateAndSpaces>
1435+
<DateAndSpaces
1436+
inSidebar={
1437+
this.props.contextLocation === 'in-page'
1438+
}
1439+
>
14221440
{this.creationInfo?.createdWhen &&
14231441
!this.props.isEditing && (
14241442
<CreationInfoBox>
@@ -1428,27 +1446,33 @@ export default class AnnotationEditable extends React.Component<Props, State> {
14281446
</CreationInfoBox>
14291447
)}
14301448
{this.displayLists.length >= 1 && (
1431-
<ListsSegment
1432-
tabIndex={0}
1433-
lists={this.displayLists}
1434-
onMouseEnter={
1435-
this.props.onListsHover
1436-
}
1437-
onListClick={this.props.onListClick}
1438-
onEditBtnClick={() => null}
1439-
spacePickerButtonRef={
1440-
this.spacePickerBodyButtonRef
1441-
}
1442-
padding={
1443-
this.props.isEditing
1444-
? '0px'
1445-
: '0px'
1446-
}
1447-
removeSpaceForAnnotation={
1448-
this.props
1449-
.removeSpaceFromEditorPicker
1450-
}
1451-
/>
1449+
<ListSegmentBox>
1450+
{this.renderAutoAddedIndicator()}
1451+
<ListsSegment
1452+
tabIndex={0}
1453+
lists={this.displayLists}
1454+
onMouseEnter={
1455+
this.props.onListsHover
1456+
}
1457+
onListClick={
1458+
this.props.onListClick
1459+
}
1460+
onEditBtnClick={() => null}
1461+
spacePickerButtonRef={
1462+
this
1463+
.spacePickerBodyButtonRef
1464+
}
1465+
padding={
1466+
this.props.isEditing
1467+
? '0px'
1468+
: '0px'
1469+
}
1470+
removeSpaceForAnnotation={
1471+
this.props
1472+
.removeSpaceFromEditorPicker
1473+
}
1474+
/>
1475+
</ListSegmentBox>
14521476
)}
14531477
</DateAndSpaces>
14541478
) : null}
@@ -1482,14 +1506,26 @@ export default class AnnotationEditable extends React.Component<Props, State> {
14821506
}
14831507
}
14841508

1485-
const DateAndSpaces = styled.div`
1509+
const ListSegmentBox = styled.div`
14861510
display: flex;
1487-
justify-content: space-between;
14881511
align-items: center;
1512+
justify-content: flex-start;
1513+
width: 100%;
1514+
grid-gap: 10px;
1515+
/* padding: 0px 15px; */
1516+
`
1517+
1518+
const DateAndSpaces = styled.div<{
1519+
inSidebar: boolean
1520+
}>`
1521+
display: flex;
1522+
justify-content: space-between;
14891523
width: 100%;
1490-
grid-gap: 20px;
1491-
padding: 5px 15px 10px 15px;
14921524
box-sizing: border-box;
1525+
flex-direction: column-reverse;
1526+
align-items: flex-start;
1527+
padding: 10px 15px 10px 15px;
1528+
grid-gap: 10px;
14931529
`
14941530

14951531
const DeleteScreenContainer = styled.div`
@@ -1709,11 +1745,14 @@ const DefaultFooterStyled = styled.div<{
17091745
props.inPageMode &&
17101746
css`
17111747
backdrop-filter: unset;
1712-
background: ${(props) => props.theme.colors.black};
1748+
background: transparent;
17131749
`};
17141750
`
17151751
const ActionFooterStyled = styled(DefaultFooterStyled)`
17161752
padding: 0 0px 0px 0px;
1753+
position: absolute;
1754+
bottom: 0;
1755+
background: ${(props) => props.theme.colors.black0};
17171756
`
17181757

17191758
const HighlightActionsBox = styled.div<{}>`

0 commit comments

Comments
 (0)