mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	chore: stylable card (#9604)
https://linear.app/unleash/issue/2-3442/make-card-component-stylable Makes the Card component introduced in https://github.com/Unleash/unleash/pull/9096 stylable. E.g. ```tsx const StyledCard = styled(Card)(({ theme }) => ({ backgroundColor: 'pink', })); ```
This commit is contained in:
		
							parent
							
								
									4677b28aee
								
							
						
					
					
						commit
						b885a927e6
					
				@ -1,4 +1,4 @@
 | 
			
		||||
import { styled, Card as MUICard, Box } from '@mui/material';
 | 
			
		||||
import { styled, Card as MUICard, Box, type CardProps } from '@mui/material';
 | 
			
		||||
 | 
			
		||||
const StyledCard = styled(MUICard)(({ theme }) => ({
 | 
			
		||||
    display: 'flex',
 | 
			
		||||
@ -77,7 +77,7 @@ const StyledCardFooter = styled(Box)(({ theme }) => ({
 | 
			
		||||
    textWrap: 'nowrap',
 | 
			
		||||
}));
 | 
			
		||||
 | 
			
		||||
interface ICardProps {
 | 
			
		||||
interface ICardProps extends Omit<CardProps, 'title'> {
 | 
			
		||||
    icon?: React.ReactNode;
 | 
			
		||||
    title?: React.ReactNode;
 | 
			
		||||
    headerActions?: React.ReactNode;
 | 
			
		||||
@ -91,8 +91,9 @@ export const Card = ({
 | 
			
		||||
    headerActions,
 | 
			
		||||
    footer,
 | 
			
		||||
    children,
 | 
			
		||||
    ...props
 | 
			
		||||
}: ICardProps) => (
 | 
			
		||||
    <StyledCard>
 | 
			
		||||
    <StyledCard {...props}>
 | 
			
		||||
        <StyledCardBody>
 | 
			
		||||
            <StyledCardBodyHeader>
 | 
			
		||||
                {icon && (
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user