mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-16 14:00:56 +02:00
feat: allow the hiding of top picks
This commit is contained in:
@@ -22,6 +22,12 @@
|
|||||||
@include isMobile {
|
@include isMobile {
|
||||||
max-width: 11rem;
|
max-width: 11rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.color-picker-container--no-top-picks {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
grid-template-columns: unset;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.color-picker__top-picks {
|
.color-picker__top-picks {
|
||||||
|
@@ -67,6 +67,7 @@ interface ColorPickerProps {
|
|||||||
palette?: ColorPaletteCustom | null;
|
palette?: ColorPaletteCustom | null;
|
||||||
topPicks?: ColorTuple;
|
topPicks?: ColorTuple;
|
||||||
updateData: (formData?: any) => void;
|
updateData: (formData?: any) => void;
|
||||||
|
hideTopPicks?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ColorPickerPopupContent = ({
|
const ColorPickerPopupContent = ({
|
||||||
@@ -224,17 +225,26 @@ export const ColorPicker = ({
|
|||||||
topPicks,
|
topPicks,
|
||||||
updateData,
|
updateData,
|
||||||
appState,
|
appState,
|
||||||
|
hideTopPicks = false,
|
||||||
}: ColorPickerProps) => {
|
}: ColorPickerProps) => {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div role="dialog" aria-modal="true" className="color-picker-container">
|
<div
|
||||||
<TopPicks
|
role="dialog"
|
||||||
activeColor={color}
|
aria-modal="true"
|
||||||
onChange={onChange}
|
className={clsx("color-picker-container", {
|
||||||
type={type}
|
"color-picker-container--no-top-picks": hideTopPicks,
|
||||||
topPicks={topPicks}
|
})}
|
||||||
/>
|
>
|
||||||
<ButtonSeparator />
|
{!hideTopPicks && (
|
||||||
|
<TopPicks
|
||||||
|
activeColor={color}
|
||||||
|
onChange={onChange}
|
||||||
|
type={type}
|
||||||
|
topPicks={topPicks}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{!hideTopPicks && <ButtonSeparator />}
|
||||||
<Popover.Root
|
<Popover.Root
|
||||||
open={appState.openPopup === type}
|
open={appState.openPopup === type}
|
||||||
onOpenChange={(open) => {
|
onOpenChange={(open) => {
|
||||||
|
Reference in New Issue
Block a user