[ENG-1244] Fix highlighted RenameTextBox text colour on light theme (#1499)

fix text color
This commit is contained in:
nikec 2023-10-11 16:29:07 +02:00 committed by GitHub
parent be63385dd1
commit d9c8af0551
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View file

@ -155,7 +155,7 @@ export const RenameTextBox = forwardRef<HTMLDivElement, Props>(
suppressContentEditableWarning
className={clsx(
'cursor-default truncate rounded-md px-1.5 py-px text-xs text-ink outline-none',
allowRename && 'whitespace-normal bg-app ring-2 ring-accent-deep',
allowRename && 'whitespace-normal bg-app !text-ink ring-2 ring-accent-deep',
className
)}
onDoubleClick={(e) => {

View file

@ -8,6 +8,7 @@ import {
type ExplorerItem
} from '@sd/client';
import { toast } from '@sd/ui';
import { useIsDark } from '~/hooks';
import { useExplorerContext } from '../Context';
import { RenameTextBox } from '../FilePath/RenameTextBox';
@ -19,10 +20,11 @@ interface Props {
style?: React.CSSProperties;
}
export const RenamableItemText = ({ item, allowHighlight, style }: Props) => {
export const RenamableItemText = ({ item, allowHighlight = true, style }: Props) => {
const rspc = useRspcLibraryContext();
const explorer = useExplorerContext();
const quickPreviewStore = useQuickPreviewStore();
const isDark = useIsDark();
const itemData = getExplorerItemData(item);
@ -111,8 +113,8 @@ export const RenamableItemText = ({ item, allowHighlight, style }: Props) => {
disabled={disabled}
onRename={handleRename}
className={clsx(
'text-center font-medium text-ink',
selected && allowHighlight !== false && 'bg-accent text-white dark:text-ink'
'text-center font-medium',
selected && allowHighlight && ['bg-accent', !isDark && 'text-white']
)}
style={style}
/>