Skip to content

Commit f2fe491

Browse files
committed
Use images in 3rd party buttons
1 parent d0378af commit f2fe491

File tree

5 files changed

+66
-7
lines changed

5 files changed

+66
-7
lines changed

public/static/icon-osmcha-logo.svg

Lines changed: 1 addition & 0 deletions
Loading

public/static/neis-one-logo.png

1.34 KB
Loading

public/static/osm_logo.png

191 KB
Loading

src/components/button.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ const URL = process.env.APP_URL
88

99
const ButtonStyles = css.global`
1010
.button {
11-
display: inline-block;
11+
display: inline-flex;
1212
text-align: center;
13+
justify-content: center;
14+
align-items: center;
15+
gap: 0.25rem;
1316
white-space: nowrap;
1417
vertical-align: middle;
1518
line-height: 1.5rem;
@@ -38,13 +41,29 @@ const ButtonStyles = css.global`
3841
box-shadow: 0 0;
3942
}
4043
44+
/* Button variations
45+
========================================================================== */
46+
4147
.button.primary {
4248
color: #ffffff;
4349
background: ${theme.colors.primaryColor};
4450
border: none;
4551
box-shadow: 2px 2px #ffffff, 4px 4px ${theme.colors.primaryColor};
4652
}
4753
54+
.borderless {
55+
border: none;
56+
box-shadow: none;
57+
}
58+
.transparent {
59+
background: transparent;
60+
}
61+
.unstyled {
62+
background: transparent;
63+
border: none;
64+
box-shadow: none;
65+
}
66+
4867
/* Button size modifiers
4968
========================================================================== */
5069

src/pages/teams/[id]/members-table.js

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import T from 'prop-types'
22
import Table from '../../../components/tables/table'
33
import { useState } from 'react'
4+
import join from 'url-join'
5+
46
import Pagination from '../../../components/pagination'
57
import { serverRuntimeConfig } from '../../../../next.config.js'
68
import * as R from 'ramda'
79
import SearchInput from '../../../components/tables/search-input'
810
import Button from '../../../components/button'
11+
const URL = process.env.APP_URL
912
const { DEFAULT_PAGE_SIZE } = serverRuntimeConfig
1013

1114
function MembersTable({ rows: allRows, onRowClick }) {
@@ -21,38 +24,74 @@ function MembersTable({ rows: allRows, onRowClick }) {
2124
{ key: 'id', sortable: true },
2225
{ key: 'role', sortable: true },
2326
{
24-
key: '3rd party',
27+
key: 'External Profiles',
2528
render: ({ name }) => (
2629
<>
2730
<Button
2831
onClick={(e) => {
2932
e.stopPropagation()
3033
window.open(
3134
`https://www.openstreetmap.org/user/${name}`,
32-
'_blank'
35+
'_blank',
36+
'noreferrer'
3337
)
3438
}}
39+
flat
40+
size='small'
41+
className='unstyled small'
42+
title='View profile on OSM'
3543
>
36-
OSM Profile
44+
<img
45+
src={`${join(URL, `/static/osm_logo.png`)}`}
46+
alt='OSM Logo'
47+
width='16'
48+
height='16'
49+
/>
50+
OSM
3751
</Button>
3852
<Button
3953
onClick={(e) => {
4054
e.stopPropagation()
41-
window.open(`https://hdyc.neis-one.org/?${name}`, '_blank')
55+
window.open(
56+
`https://hdyc.neis-one.org/?${name}`,
57+
'_blank',
58+
'noreferrer'
59+
)
4260
}}
61+
flat
62+
size='small'
63+
className='unstyled small'
64+
title='View profile on HDYC'
4365
>
66+
<img
67+
src={`${join(URL, `/static/neis-one-logo.png`)}`}
68+
alt='How Do You Contribute Logo'
69+
width='16'
70+
height='16'
71+
/>
4472
HDYC
4573
</Button>
4674
<Button
4775
onClick={(e) => {
4876
e.stopPropagation()
4977
window.open(
5078
`https://osmcha.org/?filters={"users":[{"label":"${name}","value":"${name}"}]}`,
51-
'_blank'
79+
'_blank',
80+
'noreferrer'
5281
)
5382
}}
83+
flat
84+
size='small'
85+
className='unstyled small'
86+
title='View profile on OSMCha'
5487
>
55-
OSM Profile
88+
<img
89+
src={`${join(URL, `/static/icon-osmcha-logo.svg`)}`}
90+
alt='OSMCha Logo'
91+
width='16'
92+
height='16'
93+
/>
94+
OSMCha
5695
</Button>
5796
</>
5897
),

0 commit comments

Comments
 (0)