-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* π Renamed to tsx * β¨ Declared image type Needed for catImg in Avatar story * π Renamed Props to AvatarProps .. * π Added AvatarProps to story * π Had to move image declarations inside a custom_typings folder Was not picked up by TS before * β»οΈ Arrow function to named function * π¨ Arrow to named * π¨ JPG as type string * π₯ Removed knobs Not needed when we have controlled props * π¨ Self closing tags * π Moved custom_typings folder (for jpg module) into stories folder Needed for the module to be used in Avatar.stories * π custom_typings moved to core-react/src because of jsconfig is there * π§ Still working on image module * π§ Still not able to export the jpg module TS reaches module only if custom.d.ts is opened * π¨ Removed useless img module and replaced local src with url Quick fix instead of img module to fix ts error on img import
- Loading branch information
Showing
5 changed files
with
48 additions
and
56 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,41 @@ | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
import { Story, Meta } from '@storybook/react' | ||
import { Avatar, AvatarProps, Typography } from '@equinor/eds-core-react' | ||
|
||
const Container = styled.div` | ||
margin: 32px; | ||
display: grid; | ||
grid-gap: 16px; | ||
` | ||
const Wrapper = styled.div` | ||
display: grid; | ||
grid-gap: 32px; | ||
grid-template-columns: repeat(5, fit-content(100%)); | ||
` | ||
|
||
export default { | ||
title: 'Components/Avatar', | ||
component: Avatar, | ||
} as Meta | ||
|
||
export const Default: Story<AvatarProps> = (args) => ( | ||
<Avatar src={'https://i.imgur.com/UM3mrju.jpg'} {...args} /> | ||
) | ||
|
||
export const Examples: Story<AvatarProps> = () => ( | ||
<Container> | ||
<Typography variant="h2">Sizes</Typography> | ||
<Wrapper> | ||
<Avatar src={'https://i.imgur.com/UM3mrju.jpg'} size={16} alt="avatar" /> | ||
<Avatar src={'https://i.imgur.com/UM3mrju.jpg'} size={24} alt="avatar" /> | ||
<Avatar src={'https://i.imgur.com/UM3mrju.jpg'} size={32} alt="avatar" /> | ||
<Avatar src={'https://i.imgur.com/UM3mrju.jpg'} size={40} alt="avatar" /> | ||
<Avatar src={'https://i.imgur.com/UM3mrju.jpg'} size={48} alt="avatar" /> | ||
</Wrapper> | ||
<Typography variant="h2">Disabled</Typography> | ||
<Wrapper> | ||
<Avatar src={'https://i.imgur.com/UM3mrju.jpg'} disabled alt="avatar" /> | ||
</Wrapper> | ||
</Container> | ||
) |
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 +1 @@ | ||
export { Avatar } from './Avatar' | ||
export * from './Avatar' |
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