Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add upload resource button in resource hub #348

Merged
merged 3 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions components/ResourceHub/Resources.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { Fragment, useMemo, useState } from 'react'
import { useRouter } from 'next/router'
import NextLink from 'next/link'
import type { NextRouter } from 'next/router'
import AddIcon from '@mui/icons-material/Add'

import SearchIcon from '../../assets/svg/search.svg'
import CrossIcon from '../../assets/svg/cross.svg'
Expand All @@ -33,6 +34,9 @@ import companyResources from './company-resources.json'
import communityResources from './community-resources.json'
import css from './styles.module.css'

export const uploadResourceUrl =
'https://github.com/safe-global/safe-docs/issues/new?assignees=&labels=resource-hub&projects=&template=resource-hub-submission.yml&title=%5BResource+Hub%5D+'

const resources = [
...communityResources.map(r => ({ ...r, origin: 'Community' })),
...companyResources.map(r => ({ ...r, origin: 'Safe Team' }))
Expand Down Expand Up @@ -215,6 +219,28 @@ export const Resources = (): ReactElement => {

const sidebar = (
<>
<NextLink href={uploadResourceUrl} target='_blank' rel='noreferrer'>
<Button
endIcon={
<AddIcon sx={{ mr: [1.5, 1] }} />
}
sx={{
alignItems: 'space-between',
border: ['none', 'solid 1px rgba(161, 163, 167, 1)'],
color: 'white',
my: 2
}}
fullWidth
>
<Typography
sx={{ width: '100%', textAlign: 'left', ml: 1 }}
color='white'
variant='caption'
>
Suggest new resource
</Typography>
</Button>
</NextLink>
<SidebarAccordion
title='Resource type'
items={uniqueTypes}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@emotion/cache": "^11.11.0",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.15.8",
"@mui/material": "^5.14.18",
"@preact/signals": "^1.2.2",
"@svgr/webpack": "^8.1.0",
Expand Down
27 changes: 27 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading