File tree Expand file tree Collapse file tree 3 files changed +52
-7
lines changed
Expand file tree Collapse file tree 3 files changed +52
-7
lines changed Original file line number Diff line number Diff line change @@ -6,22 +6,46 @@ export const Container = styled.div(
66 display : 'flex' ,
77 alignItems : 'center' ,
88 marginBottom : 4 ,
9+ marginTop : 2 ,
910 } )
1011) ;
1112
1213export const Avatar = styled . img (
1314 css ( {
1415 size : '24px' ,
15- borderRadius : '2px ' ,
16+ borderRadius : '50% ' ,
1617 border : '1px solid' ,
1718 borderColor : 'grays.400' ,
1819 } )
1920) ;
2021
21- export const Name = styled . span (
22+ export const AvatarPlaceholder = styled . div (
23+ css ( {
24+ width : 24 ,
25+ height : 24 ,
26+ display : 'flex' ,
27+ alignItems : 'center' ,
28+ justifyContent : 'center' ,
29+ fontWeight : 'medium' ,
30+ borderRadius : '50%' ,
31+ backgroundColor : 'grays.600' ,
32+ } )
33+ ) ;
34+
35+ export const PrimaryName = styled . span (
36+ css ( {
37+ display : 'inline-block' ,
38+ fontSize : 3 ,
39+ marginLeft : 2 ,
40+ marginBottom : '1px' ,
41+ } )
42+ ) ;
43+
44+ export const AuthorName = styled . span (
2245 css ( {
2346 display : 'inline-block' ,
2447 fontSize : 2 ,
2548 marginLeft : 2 ,
49+ color : 'grays.400' ,
2650 } )
2751) ;
Original file line number Diff line number Diff line change 11import React from 'react' ;
2- import { Container , Avatar , Name } from './elements' ;
2+ import {
3+ Container ,
4+ Avatar ,
5+ PrimaryName ,
6+ AuthorName ,
7+ AvatarPlaceholder ,
8+ } from './elements' ;
39
4- const AvatarBlock = ( { url, name } ) => (
10+ const AvatarBlock = ( { url, name, teamName } ) => (
511 < Container >
6- < Avatar src = { url } />
7- < Name > { name } </ Name >
12+ { url ? (
13+ < Avatar src = { url } />
14+ ) : (
15+ < AvatarPlaceholder > { teamName . charAt ( 0 ) . toUpperCase ( ) } </ AvatarPlaceholder >
16+ ) }
17+ < div style = { { display : 'flex' , flexDirection : 'column' } } >
18+ { teamName && teamName !== name ? (
19+ < >
20+ < PrimaryName > { teamName } </ PrimaryName >
21+ < AuthorName > { name } </ AuthorName >
22+ </ >
23+ ) : (
24+ < PrimaryName > { name } </ PrimaryName >
25+ ) }
26+ </ div >
827 </ Container >
928) ;
1029
Original file line number Diff line number Diff line change @@ -17,9 +17,11 @@ export const SandboxInfo: FunctionComponent<Props> = ({ sandbox }) => {
1717 < Container >
1818 < Title title = { title } > { title } </ Title >
1919 { sandbox . description && < Description > { sandbox . description } </ Description > }
20+
2021 { sandbox . author && (
2122 < AvatarBlock
22- url = { sandbox . author . avatarUrl }
23+ teamName = { sandbox . team ?. name }
24+ url = { sandbox . team ?. avatarUrl }
2325 name = { sandbox . author . username }
2426 />
2527 ) }
You can’t perform that action at this time.
0 commit comments