Skip to content

Commit

Permalink
Improve UX of highlight color picker
Browse files Browse the repository at this point in the history
  • Loading branch information
blackforestboi committed Jul 24, 2024
1 parent 9630e11 commit 8ca329c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion external/@worldbrain/memex-common
16 changes: 10 additions & 6 deletions src/annotations/components/highlightColorPicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
} from '@worldbrain/memex-common/lib/common-ui/components/highlightColorPicker/utils'
import { color } from 'html2canvas/dist/types/css/types/color'
import KeyboardShortcuts from '@worldbrain/memex-common/lib/common-ui/components/keyboard-shortcuts'
import LoadingBlock from '@worldbrain/memex-common/lib/common-ui/components/loading-block'

export interface Props {
annotationId: string
Expand Down Expand Up @@ -406,7 +407,6 @@ export default class HighlightColorPicker extends React.Component<
}}
/>
</ColorEditBox>
// </PopoutBox>
)
}

Expand All @@ -428,11 +428,7 @@ export default class HighlightColorPicker extends React.Component<
this.state.highlightColorSettingLoadState == null ||
this.state.highlightColorSettingLoadState === 'running'
) {
return (
<LoadingBox>
<LoadingIndicator size={30} />
</LoadingBox>
)
return <LoadingBlock size={22} width={'230px'} height={'208px'} />
} else {
try {
const settings = this.state.highlightColorSettingState
Expand Down Expand Up @@ -687,6 +683,14 @@ const LoadingBox = styled.div`
width: 100%;
`

const TopSection = styled.div`
display: flex;
align-items: center;
justify-content: center;
grid-gap: 5px;
color: ${(props) => props.theme.colors.white};
`

export const GlobalStyle = createGlobalStyle`
.react-colorful {
Expand Down
4 changes: 3 additions & 1 deletion src/in-page-ui/ribbon/react/containers/ribbon/logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1062,11 +1062,13 @@ export class RibbonContainerLogic extends UILogic<
})

setState(!currentSetting)

try {
if (currentSetting === true) {
await this.dependencies.inPageUI.removeTooltip()
} else {
await this.dependencies.tooltip.setState(!currentSetting)
await this.dependencies.inPageUI.toggleTooltip()

await this.dependencies.inPageUI.showTooltip()
}
await this.dependencies.tooltip.setState(!currentSetting)
Expand Down

0 comments on commit 8ca329c

Please sign in to comment.