Skip to content

Commit

Permalink
fix: image default width
Browse files Browse the repository at this point in the history
  • Loading branch information
abelflopes committed Jun 15, 2024
1 parent 9b25bcd commit d8b3468
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/components/_provisional/src/image/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Skeleton } from "@react-ck/skeleton";
export interface ImageProps extends React.ImgHTMLAttributes<HTMLImageElement> {
/** Required img alt description */
alt: string;
fullWidth?: boolean;
}

export const Image = ({
Expand All @@ -14,6 +15,7 @@ export const Image = ({
hidden,
onLoad,
onError,
fullWidth,
...otherProps
}: Readonly<ImageProps>): React.ReactElement => {
const [shouldDisplay, setShouldDisplay] = useState(false);
Expand All @@ -38,7 +40,9 @@ export const Image = ({
<>
{!shouldDisplay && <Skeleton className={className} />}
<img
className={classNames(className, styles.root)}
className={classNames(className, styles.root, {
[`${styles.fullwidth}`]: fullWidth,
})}
alt={alt}
onLoad={computedOnLoad}
onError={computedOnError}
Expand Down

0 comments on commit d8b3468

Please sign in to comment.