Skip to content

Commit

Permalink
feat(Default Avatar): added default avatar for subscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
newick authored and JalilArfaoui committed Sep 6, 2019
1 parent 4307321 commit 4388e77
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
10 changes: 6 additions & 4 deletions src/components/atoms/Avatar/Avatar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import React from 'react';
import { storiesOf } from '@storybook/react';
import { withKnobs, text } from '@storybook/addon-knobs';
import Avatar from './Avatar';
import Faker from 'faker';

const defaultAvatar = Faker.image.avatar();
import AvatarDefault from '../icons/AvatarDefault';

storiesOf('atoms/Avatar', module)
.addDecorator(withKnobs)
.add('normal', () => <Avatar src={text('content', defaultAvatar)} />);
.add('normal', () => (
<Avatar>
<AvatarDefault />
</Avatar>
));
10 changes: 6 additions & 4 deletions src/components/atoms/Avatar/Avatar.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import styled from 'styled-components';

export default styled.img`
display: block
width: 89px;
height: 89px;
export default styled.div`
display: flex;
justify-content: center;
align-items: center;
width: 90px;
height: 90px;
background-color: ${props => props.theme.contributorGrey};
border-radius: 50%;
`;
10 changes: 10 additions & 0 deletions src/components/atoms/icons/AvatarDefault.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';

export default () => (
<svg width="52.844" height="52.813">
<path
fill="#707070"
d="M38.756 28.633a16.538 16.538 0 1 0-23.2-.741A25.12 25.12 0 0 0 0 50.609a2.2 2.2 0 1 0 4.4 0 20.76 20.76 0 0 1 15.373-19.494 16.407 16.407 0 0 0 14.578.458 20.893 20.893 0 0 1 14.081 19.034 2.2 2.2 0 0 0 2.2 2.2 2.2 2.2 0 0 0 2.2-2.2 25.311 25.311 0 0 0-14.076-21.974zm-17.557-1.774a12.006 12.006 0 0 1-5.8-10.328 12.137 12.137 0 1 1 5.8 10.328z"
/>
</svg>
);
5 changes: 4 additions & 1 deletion src/components/organisms/Contributor/ContributorLarge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import styled, { css } from 'styled-components';

import Avatar from 'components/atoms/Avatar/Avatar';
import AvatarDefault from 'components/atoms/icons/AvatarDefault';
import UserName from 'components/atoms/UserName/UserName';
import Stat from 'components/atoms/Stat/Stat';
import StatType from 'components/atoms/Stat/StatType';
Expand Down Expand Up @@ -42,7 +43,9 @@ const ContributorIntro = styled.p`
export const Contributor = () => (
<ContributorCard>
<ContributorWrapper>
<Avatar />
<Avatar>
<AvatarDefault />
</Avatar>

<ContributorInfos>
<UserName>Jean Michel</UserName>
Expand Down

0 comments on commit 4388e77

Please sign in to comment.