-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
app-project: Add MastodonIcon and BlueSkyIcon (#6338)
* add MastodonIcon and BlueSkyIcon
- Loading branch information
1 parent
fef769f
commit e6dc7db
Showing
10 changed files
with
86 additions
and
27 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
39 changes: 16 additions & 23 deletions
39
packages/app-project/src/shared/components/ConnectWithProject/ConnectWithProjectContainer.js
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,34 +1,27 @@ | ||
import { inject, observer } from 'mobx-react' | ||
import { arrayOf, shape, string } from 'prop-types' | ||
import { Component } from 'react' | ||
import { MobXProviderContext, observer } from 'mobx-react' | ||
import { useContext } from 'react' | ||
|
||
import ConnectWithProject from './ConnectWithProject' | ||
import isValidUrl from './helpers/isValidUrl' | ||
|
||
function storeMapper (stores) { | ||
const { project } = stores.store | ||
function useStore() { | ||
const { store } = useContext(MobXProviderContext) | ||
const projectName = store.project['display_name'] | ||
const urls = store.project.urls | ||
|
||
return { | ||
projectName: project['display_name'], | ||
urls: project.urls | ||
projectName, | ||
urls | ||
} | ||
} | ||
|
||
class ConnectWithProjectContainer extends Component { | ||
render () { | ||
const { projectName, urls } = this.props | ||
const validUrls = urls && urls.filter && urls.filter(urlObject => isValidUrl(urlObject.url)) | ||
return (!validUrls || validUrls.length > 0) | ||
? <ConnectWithProject projectName={projectName} urls={urls} /> | ||
: null | ||
} | ||
} | ||
const ConnectWithProjectContainer = () => { | ||
const { projectName = '', urls = [] } = useStore() | ||
const validUrls = urls && urls.filter && urls.filter(urlObject => isValidUrl(urlObject.url)) | ||
|
||
ConnectWithProjectContainer.propTypes = { | ||
projectName: string, | ||
urls: arrayOf(shape({ | ||
label: string.isRequired, | ||
url: string.isRequired | ||
})) | ||
return !validUrls || validUrls.length > 0 ? ( | ||
<ConnectWithProject projectName={projectName} urls={urls} /> | ||
) : null | ||
} | ||
|
||
export default inject(storeMapper)(observer(ConnectWithProjectContainer)) | ||
export default observer(ConnectWithProjectContainer) |
File renamed without changes.
1 change: 0 additions & 1 deletion
1
...ed/components/ConnectWithProject/components/ProjectLink/components/BitbucketIcon/index.js
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
...src/shared/components/ConnectWithProject/components/ProjectLink/components/BlueSkyIcon.js
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,19 @@ | ||
import { Blank } from 'grommet-icons' | ||
|
||
function BlueSkyIcon(props) { | ||
return ( | ||
<Blank | ||
viewBox='0 0 600 530' | ||
width='100' | ||
height='88' | ||
aria-label='BlueSky' | ||
{...props} | ||
> | ||
<path | ||
d='m135.7 44c66.5 50 138 151.2 164.3 205.5 26.3-54.3 97.8-155.5 164.3-205.5 48-36 125.7-63.9 125.7 24.8 0 17.7-10.2 148.8-16.1 170.1-20.7 74-96.2 92.8-163.3 81.4 117.3 20 147.2 86.1 82.7 152.2-122.4 125.6-175.9-31.5-189.6-71.7-2.5-7.4-3.7-10.8-3.7-7.9 0-3-1.2 0.5-3.7 7.9-13.7 40.2-67.2 197.3-189.6 71.7-64.5-66.1-34.6-132.2 82.7-152.2-67.2 11.4-142.6-7.4-163.3-81.4-5.9-21.3-16.1-152.4-16.1-170.1 0-88.7 77.7-60.8 125.7-24.8z' | ||
/> | ||
</Blank> | ||
) | ||
} | ||
|
||
export default BlueSkyIcon |
19 changes: 19 additions & 0 deletions
19
...rc/shared/components/ConnectWithProject/components/ProjectLink/components/MastodonIcon.js
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,19 @@ | ||
import { Blank } from 'grommet-icons' | ||
|
||
function MastodonIcon(props) { | ||
return ( | ||
<Blank | ||
viewBox='0 0 100 107' | ||
aria-label='Mastodon' | ||
{...props} | ||
> | ||
<path d='m97.6 63.9c-1.4 7.5-13.1 15.7-26.4 17.3-6.9 0.8-13.8 1.6-21.1 1.3-11.9-0.6-21.3-2.9-21.3-2.9q0 1.8 0.2 3.3c1.5 11.8 11.7 12.5 21.2 12.9 9.7 0.3 18.4-2.4 18.4-2.4l0.4 8.7c0 0-6.8 3.7-18.9 4.3-6.6 0.4-14.9-0.1-24.5-2.7-20.9-5.5-24.5-27.8-25-50.4-0.2-6.7-0.1-13-0.1-18.3 0-23.1 15.1-29.9 15.1-29.9 7.6-3.5 20.7-5 34.3-5.1h0.4c13.6 0.1 26.7 1.6 34.3 5.1 0 0 15.1 6.8 15.1 29.9 0 0 0.2 17-2.1 28.9z' /> | ||
<path | ||
fill='white' | ||
d='m81.9 36.8v28h-11.1v-27.2c0-5.7-2.4-8.6-7.2-8.6-5.3 0-8 3.4-8 10.2v14.9h-11v-14.9c0-6.8-2.7-10.2-8-10.2-4.8 0-7.2 2.9-7.2 8.6v27.2h-11.1v-28q0-8.6 4.4-13.7c3-3.3 6.9-5 11.8-5 5.7 0 10 2.1 12.8 6.5l2.8 4.6 2.8-4.6c2.8-4.4 7.1-6.5 12.8-6.5 4.8 0 8.8 1.7 11.8 5q4.4 5.1 4.4 13.7z' | ||
/> | ||
</Blank> | ||
) | ||
} | ||
|
||
export default MastodonIcon |
File renamed without changes.
1 change: 0 additions & 1 deletion
1
...shared/components/ConnectWithProject/components/ProjectLink/components/WeiboIcon/index.js
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