mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 14:28:51 +08:00
fix(core): should not invert label when its shape text (#10765)
Closes: [BS-2797](https://linear.app/affine-design/issue/BS-2797/在-settings-preview-中,无需对-shape-text-颜色-label-进行反转) Releated: https://github.com/toeverything/AFFiNE/pull/10546
This commit is contained in:
+2
-1
@@ -72,7 +72,8 @@ export const ShapeSettings = () => {
|
||||
const { palettes: textColorPalettes, getCurrentColor: getCurrentTextColor } =
|
||||
usePalettes(
|
||||
DefaultTheme.ShapeTextColorShortPalettes,
|
||||
DefaultTheme.shapeTextColor
|
||||
DefaultTheme.shapeTextColor,
|
||||
true
|
||||
);
|
||||
|
||||
const [currentShape, setCurrentShape] = useState<ShapeName>(ShapeType.Rect);
|
||||
|
||||
@@ -17,13 +17,14 @@ export const useResolvedTheme = () => {
|
||||
|
||||
export const usePalettes = (
|
||||
originalPalettes: Palette[],
|
||||
defaultColor: Color
|
||||
defaultColor: Color,
|
||||
isShapeText = false
|
||||
) => {
|
||||
const theme = useResolvedTheme();
|
||||
const isDark = theme === ColorScheme.Dark;
|
||||
const palettes = originalPalettes.map(({ key, value }) => {
|
||||
// Title needs to be inverted.
|
||||
if (isDark) {
|
||||
if (!isShapeText && isDark) {
|
||||
if (key === 'Black') {
|
||||
key = 'White';
|
||||
} else if (key === 'White') {
|
||||
|
||||
Reference in New Issue
Block a user