Skip to content

Commit

Permalink
add back "spaces" button to the annotationCreate
Browse files Browse the repository at this point in the history
  • Loading branch information
blackforestboi committed Feb 9, 2024
1 parent 439b821 commit d64b46c
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 22 deletions.
2 changes: 1 addition & 1 deletion external/@worldbrain/memex-common
63 changes: 43 additions & 20 deletions src/annotations/components/AnnotationCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import delay from 'src/util/delay'
import { AnnotationsSidebarInPageEventEmitter } from 'src/sidebar/annotations-sidebar/types'
import { ImageSupportInterface } from 'src/image-support/background/types'
import { sleepPromise } from 'src/util/promises'
import { PrimaryAction } from '@worldbrain/memex-common/lib/common-ui/components/PrimaryAction'

interface State {
isTagPickerShown: boolean
Expand Down Expand Up @@ -357,7 +358,7 @@ export class AnnotationCreate extends React.Component<Props, State>
render() {
return (
<>
<TextBoxContainerStyled>
<TextBoxContainerStyled hasLists={this.displayLists.length > 0}>
<EditorContainer>
{this.state.onEditClick || this.props.autoFocus ? (
<MemexEditor
Expand Down Expand Up @@ -426,27 +427,38 @@ export class AnnotationCreate extends React.Component<Props, State>
{this.props.comment.length > 0 &&
(this.state.onEditClick || this.props.autoFocus) && (
<FooterContainer>
<ListsSegment
newLineOrientation={true}
lists={this.displayLists}
onMouseEnter={this.props.onListsHover}
onListClick={undefined}
onEditBtnClick={() =>
this.setState({
isListPickerShown: true,
})
}
spacePickerButtonRef={
this.spacePickerButtonRef
}
renderSpacePicker={this.renderSpacePicker}
/>
{this.renderSpacePicker()}
<SaveActionBar>
<PrimaryAction
onClick={() =>
this.setState({
isListPickerShown: true,
})
}
label="Spaces"
innerRef={this.spacePickerButtonRef}
icon="plus"
iconColor="prime1"
size="small"
type="tertiary"
/>
{this.renderActionButtons()}
</SaveActionBar>
{this.renderSpacePicker()}
</FooterContainer>
)}
<ListsSegment
newLineOrientation={true}
lists={this.displayLists}
onMouseEnter={this.props.onListsHover}
onListClick={undefined}
onEditBtnClick={() =>
this.setState({
isListPickerShown: true,
})
}
spacePickerButtonRef={this.spacePickerButtonRef}
renderSpacePicker={this.renderSpacePicker}
/>
</TextBoxContainerStyled>
</>
)
Expand Down Expand Up @@ -564,8 +576,10 @@ const FooterContainer = styled.div`

const SaveActionBar = styled.div`
display: flex;
justify-content: flex-end;
justify-content: space-between;
align-items: center;
width: fill-available;
width: -moz-available;
z-index: 1001;
grid-gap: 10px;
Expand All @@ -590,17 +604,26 @@ const MarkdownButtonContainer = styled.div`
}
`

const TextBoxContainerStyled = styled.div`
const TextBoxContainerStyled = styled.div<{
hasLists: boolean
}>`
box-shadow: none;
cursor: default;
box-sizing: border-box;
display: flex;
flex-direction: column;
font-size: 14px;
width: calc(100% - 1px);
border-radius: 8px;
border-bottom: 1px solid ${(props) => props.theme.colors.greyScale3};
& * {
font-family: ${(props) => props.theme.fonts.primary};
}
${(props) =>
props.hasLists
? css`
padding-bottom: 10px;
`
: undefined}
`
Original file line number Diff line number Diff line change
Expand Up @@ -5587,8 +5587,9 @@ const AnnotationActions = styled.div`
justify-content: flex-start;
align-items: center;
width: fill-available;
height: 30px;
height: 20px;
padding-bottom: 5px;
padding-top: 5px;
`

const ActionButtons = styled.div`
Expand Down

0 comments on commit d64b46c

Please sign in to comment.