mirror of
https://github.com/valitydev/vality.dev.git
synced 2024-11-06 00:55:20 +00:00
OPS-249: Add text color for buttons (#15)
This commit is contained in:
parent
7dd9eb2c3d
commit
98964ee777
@ -16,6 +16,7 @@ interface Props extends React.ComponentProps<typeof ButtonUnstyled> {
|
||||
size?: "small" | "medium" | "large";
|
||||
svgColoredParams?: SvgColoredParam[];
|
||||
disabled?: boolean;
|
||||
textColor?: string;
|
||||
}
|
||||
|
||||
function getColoredSvgCss(params: SvgColoredParam[] = [], color: string) {
|
||||
@ -28,7 +29,7 @@ const StyledButton = styled(ButtonUnstyled)<{
|
||||
({
|
||||
theme,
|
||||
color,
|
||||
styled: { variant, size, svgColoredParams, hasText, disabled },
|
||||
styled: { variant, size, svgColoredParams, hasText, disabled, textColor },
|
||||
}) => {
|
||||
const buttonSizes = {
|
||||
large: 6,
|
||||
@ -51,7 +52,7 @@ const StyledButton = styled(ButtonUnstyled)<{
|
||||
if (disabled) {
|
||||
iconColor = theme?.palette?.grey?.[500];
|
||||
} else {
|
||||
if (!hasText && variant === "contained")
|
||||
if (textColor)
|
||||
hoverIconColor =
|
||||
activeIconColor =
|
||||
iconColor =
|
||||
@ -167,6 +168,7 @@ export const Button: React.FC<Props> = ({
|
||||
size,
|
||||
svgColoredParams,
|
||||
disabled,
|
||||
textColor,
|
||||
...props
|
||||
}) => {
|
||||
const { navigate } = useI18next();
|
||||
@ -187,6 +189,7 @@ export const Button: React.FC<Props> = ({
|
||||
svgColoredParams: svgColoredParams || ["fill"],
|
||||
hasText: !!children,
|
||||
disabled: !!disabled,
|
||||
textColor,
|
||||
}}
|
||||
>
|
||||
<Stack
|
||||
|
@ -109,6 +109,7 @@ export const Carousel: React.FC<Props> = ({ images, width }) => {
|
||||
}}
|
||||
endIcon={<Repeat />}
|
||||
size="large"
|
||||
textColor="primary"
|
||||
/>
|
||||
)}
|
||||
</Box>
|
||||
@ -122,6 +123,7 @@ export const Carousel: React.FC<Props> = ({ images, width }) => {
|
||||
}}
|
||||
endIcon={<ArrowLeft />}
|
||||
size="large"
|
||||
textColor="primary"
|
||||
/>
|
||||
)}
|
||||
<Button
|
||||
@ -133,6 +135,7 @@ export const Carousel: React.FC<Props> = ({ images, width }) => {
|
||||
endIcon={<ArrowRight />}
|
||||
size="large"
|
||||
disabled={!(active > -images.length + 1)}
|
||||
textColor="primary"
|
||||
/>
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
Loading…
Reference in New Issue
Block a user