12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- import React from 'react';
- import Avatar from 'app/components/avatar';
- const USER = {
- id: 1,
- name: 'Jane Bloggs',
- email: 'janebloggs@example.com',
- };
- export default {
- title: 'Core/Style/Avatar',
- component: Avatar,
- args: {
- hasTooltip: false,
- suggested: false,
- },
- };
- export const Letters = ({...args}) => {
- const user = Object.assign({}, USER);
- return <Avatar user={user} {...args} />;
- };
- Letters.parameters = {
- docs: {
- description: {
- story: 'This is the default avatar',
- },
- },
- };
- export const Gravatar = ({...args}) => {
- const user = {
- id: 2,
- name: 'Ben Vinegar',
- email: 'ben@benv.ca',
- avatar: {
- avatarType: 'gravatar',
- avatarUuid: '2d641b5d-8c74-44de-9cb6-fbd54701b35e',
- },
- };
- return <Avatar user={user} {...args} />;
- };
- Gravatar.parameters = {
- docs: {
- description: {
- story: 'Avatar source from gravatar',
- },
- },
- };
- export const UploadedImage = ({...args}) => {
- const user = Object.assign({}, USER, {
- avatar: {
- avatarType: 'upload',
- avatarUuid: '51e63edabf31412aa2a955e9cf2c1ca0',
- },
- });
- return <Avatar user={user} {...args} />;
- };
- UploadedImage.parameters = {
- docs: {
- description: {
- story: 'Uploaded image',
- },
- },
- };
- export const TeamAvatar = ({...args}) => {
- const team = {
- name: 'Captain Planet',
- slug: 'captain-planet',
- };
- return <Avatar team={team} {...args} />;
- };
- TeamAvatar.parameters = {
- docs: {
- description: {
- story: 'Avatar for teams',
- },
- },
- };
|