This repository has been archived by the owner on Mar 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Image): 'fluid' variant and size variables (#54)
* introduce support for resizing Image * introduce fluent variant * update changelog * fix prop definitions
- Loading branch information
Showing
7 changed files
with
46 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import React from 'react' | ||
import { Image } from '@stardust-ui/react' | ||
|
||
const ImageExample = () => <Image src="//placehold.it/100" /> | ||
const ImageExample = () => <Image src="public/images/wireframe/square-image.png" /> | ||
|
||
export default ImageExample |
24 changes: 24 additions & 0 deletions
24
docs/src/examples/components/Image/Variations/ImageExampleFluid.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from 'react' | ||
import { Image, Layout } from '@stardust-ui/react' | ||
|
||
const ImageExampleFluent = () => ( | ||
<div> | ||
<Layout | ||
style={{ maxWidth: '70px' }} | ||
debug | ||
renderMainArea={() => <Image fluid src="public/images/wireframe/square-image.png" />} | ||
/> | ||
<Layout | ||
style={{ maxWidth: '100px' }} | ||
debug | ||
renderMainArea={() => <Image fluid src="public/images/wireframe/square-image.png" />} | ||
/> | ||
<Layout | ||
style={{ maxWidth: '150px' }} | ||
debug | ||
renderMainArea={() => <Image fluid src="public/images/wireframe/square-image.png" />} | ||
/> | ||
</div> | ||
) | ||
|
||
export default ImageExampleFluent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
import { pxToRem } from '../../lib' | ||
|
||
export default () => { | ||
const vars: any = {} | ||
|
||
vars.avatarRadius = pxToRem(9999) | ||
vars.avatarSize = pxToRem(32) | ||
|
||
return vars | ||
} | ||
export default () => ({ | ||
width: undefined, | ||
height: undefined, | ||
avatarRadius: pxToRem(9999), | ||
avatarSize: pxToRem(32), | ||
}) |