Skip to content

Commit 23ae5ec

Browse files
committed
Update search styles, generic for tables, org page
1 parent 6d767e5 commit 23ae5ec

File tree

5 files changed

+31
-28
lines changed

5 files changed

+31
-28
lines changed

src/components/add-member-form.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export default function AddMemberForm({ onSubmit }) {
3131
id='osmId'
3232
placeholder='OSM ID'
3333
value={values.osmId}
34+
style={{ width: '6rem' }}
3435
/>
3536
{status && status.msg && <div>{status.msg}</div>}
3637
<Button type='submit' variant='submit' disabled={isSubmitting}>

src/components/layout.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export const globalStyles = css.global`
8989
display: flex;
9090
flex-direction: column;
9191
justify-content: space-between;
92-
margin-bottom: ${theme.layout.globalSpacing};
92+
margin-bottom: 0.5rem;
9393
}
9494
9595
@media (min-width: ${theme.mediaRanges.medium}) {
@@ -99,7 +99,7 @@ export const globalStyles = css.global`
9999
}
100100
.section-actions {
101101
flex-direction: row;
102-
align-items: center;
102+
align-items: baseline;
103103
}
104104
}
105105
@@ -182,7 +182,7 @@ export const globalStyles = css.global`
182182
}
183183
184184
.form-control {
185-
margin-bottom: 1rem;
185+
margin-bottom: 0.5rem;
186186
display: flex;
187187
justify-content: space-between;
188188
align-items: center;
@@ -192,7 +192,12 @@ export const globalStyles = css.global`
192192
flex-direction: column;
193193
align-items: flex-start;
194194
}
195-
195+
.justify-start {
196+
justify-content: flex-start;
197+
}
198+
.justify-end {
199+
justify-content: flex-end;
200+
}
196201
.form-control :global(label) {
197202
font-size: 0.875rem;
198203
margin-bottom: 0.5rem;
@@ -202,7 +207,7 @@ export const globalStyles = css.global`
202207
.form-control :global(textarea) {
203208
min-width: 6rem;
204209
padding: 0.5rem 1rem 0.5rem 0.25rem;
205-
margin-right: 1rem;
210+
margin-right: 0.5rem;
206211
border: 2px solid ${theme.colors.primaryColor};
207212
}
208213

src/components/tables/table.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,16 @@ export default function Table({
117117
}
118118
119119
thead th {
120-
padding: 0 1rem 1rem;
120+
padding: 0.5rem 1rem;
121121
vertical-align: middle;
122122
position: relative;
123123
text-transform: uppercase;
124124
text-align: left;
125125
font-family: ${theme.typography.headingFontFamily};
126126
font-weight: ${theme.typography.baseFontWeight};
127-
font-size: 0.875rem 1rem;
127+
font-size: 0.875rem;
128128
letter-spacing: 0.125rem;
129+
background: ${theme.colors.primaryLite};
129130
border-bottom: 4px solid ${theme.colors.primaryColor};
130131
}
131132

src/components/tables/users.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ const SearchInput = ({ onSearch, 'data-cy': dataCy }) => (
1212
initialValues={{ search: '' }}
1313
onSubmit={({ search }) => onSearch(search)}
1414
>
15-
<Form className='form-control'>
15+
<Form className='form-control justify-start'>
1616
<Field
1717
data-cy={`${dataCy}-search-input`}
18-
type='text'
18+
type='search'
1919
name='search'
2020
id='search'
21-
placeholder='Type an username...'
21+
placeholder='Search username...'
22+
style={{ width: '12rem' }}
2223
/>
2324
<Button
2425
data-cy={`${dataCy}-search-submit`}

src/pages/organizations/[id]/index.js

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -357,21 +357,18 @@ class Organization extends Component {
357357

358358
{isStaff ? (
359359
<div className='team__table'>
360-
<Section>
361-
<div className='section-actions'>
362-
<SectionHeader>Staff Members</SectionHeader>
363-
<div>
364-
{isOwner && (
365-
<AddMemberForm
366-
onSubmit={async ({ osmId }) => {
367-
await addManager(org.data.id, osmId)
368-
return this.getOrg()
369-
}}
370-
/>
371-
)}
372-
</div>
373-
</div>
374-
</Section>
360+
<div className='section-actions'>
361+
<SectionHeader>Staff Members </SectionHeader>
362+
{isOwner && (
363+
<AddMemberForm
364+
onSubmit={async ({ osmId }) => {
365+
await addManager(org.data.id, osmId)
366+
return this.getOrg()
367+
}}
368+
/>
369+
)}
370+
</div>
371+
375372
<UsersTable
376373
isSearchable
377374
type='org-staff'
@@ -385,9 +382,7 @@ class Organization extends Component {
385382
{isStaff ? (
386383
<div className='team__table'>
387384
<Section>
388-
<div className='section-actions'>
389-
<SectionHeader>Organization Members</SectionHeader>
390-
</div>
385+
<SectionHeader>Organization Members</SectionHeader>
391386
<UsersTable
392387
isSearchable
393388
type='org-members'

0 commit comments

Comments
 (0)