-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add custom creator avatar and contact url
- Loading branch information
1 parent
2a067bc
commit a0c01d1
Showing
7 changed files
with
136 additions
and
51 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
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,45 @@ | ||
import styled from 'styled-components' | ||
import Avatar from '../components/Avatar' | ||
import { Creator } from '../constants' | ||
|
||
const CreatorWrapper = styled.p` | ||
margin: 0; | ||
color: grey; | ||
display: flex; | ||
align-items: center; | ||
gap: 5px; | ||
white-space: nowrap; | ||
` | ||
|
||
const StyledContactURL = styled.a` | ||
color: inherit; | ||
text-decoration: none; | ||
font-weight: 400; | ||
&:hover { | ||
text-decoration: underline; | ||
color: inherit; | ||
} | ||
` | ||
|
||
const CreatorName = ({ name, contactURL }: Creator) => { | ||
if (contactURL) | ||
return ( | ||
<StyledContactURL href={contactURL} target="_blank" rel="noreferrer"> | ||
{name} | ||
</StyledContactURL> | ||
) | ||
|
||
return <>{name}</> | ||
} | ||
|
||
const ProjectCreator = ({ name, avatarURL, contactURL }: Creator) => { | ||
return ( | ||
<CreatorWrapper> | ||
{avatarURL && <Avatar src={avatarURL} name={name} />} | ||
<CreatorName name={name} contactURL={contactURL} /> | ||
</CreatorWrapper> | ||
) | ||
} | ||
|
||
export default ProjectCreator |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const Dot = () => { | ||
return <span style={{ color: 'gray', userSelect: 'none' }}>{' • '}</span> | ||
} | ||
|
||
export default Dot |
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