bad488494f
Before: black text in dark mode <img width="1224" height="860" alt="image" src="https://github.com/user-attachments/assets/a419ef77-9358-4588-ad19-a15b57448682" /> After updated styling: the correct grey text in dark mode <img width="638" height="249" alt="Screenshot 2026-04-05 at 2 47 24 PM" src="https://github.com/user-attachments/assets/bf736464-d33c-40f1-8244-2cf5d93b7e9c" /> --------- Co-authored-by: Charles Bochet <charles@twenty.com>
36 lines
964 B
TypeScript
36 lines
964 B
TypeScript
import { styled } from '@linaria/react';
|
|
import { type ReactNode } from 'react';
|
|
import { themeCssVariables } from 'twenty-ui/theme-constants';
|
|
|
|
type ThemeSpacingKey = keyof typeof themeCssVariables.spacing;
|
|
|
|
type SettingsEmptyPlaceholderProps = {
|
|
children: ReactNode;
|
|
padding?: ThemeSpacingKey;
|
|
textAlign?: 'left' | 'center' | 'right';
|
|
};
|
|
|
|
const StyledPlaceholder = styled.div<{
|
|
placeholderPadding: string;
|
|
placeholderTextAlign: string;
|
|
}>`
|
|
color: ${themeCssVariables.font.color.tertiary};
|
|
padding: ${({ placeholderPadding }) => placeholderPadding};
|
|
text-align: ${({ placeholderTextAlign }) => placeholderTextAlign};
|
|
`;
|
|
|
|
export const SettingsEmptyPlaceholder = ({
|
|
children,
|
|
padding = '8',
|
|
textAlign = 'center',
|
|
}: SettingsEmptyPlaceholderProps) => {
|
|
return (
|
|
<StyledPlaceholder
|
|
placeholderPadding={themeCssVariables.spacing[padding]}
|
|
placeholderTextAlign={textAlign}
|
|
>
|
|
{children}
|
|
</StyledPlaceholder>
|
|
);
|
|
};
|