Skip to content

Commit

Permalink
Moving/replacing inline styles.
Browse files Browse the repository at this point in the history
  • Loading branch information
erinesullivan committed Jul 25, 2024
1 parent ca0db3e commit 48387ce
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 71 deletions.
27 changes: 9 additions & 18 deletions src/modules/advanced/components/AdvancedSearchForm/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './styles.css';
import {
addFieldedSearch,
removeFieldedSearch,
Expand Down Expand Up @@ -113,14 +114,11 @@ const AdvancedSearchForm = ({ datastore }) => {

return (
<form className='y-spacing' onSubmit={handleSubmit}>
<h2 style={{ fontSize: '1.87rem' }}>{datastore.name} Search</h2>
<h2 className='h1'>{datastore.name} Search</h2>
{errors.map((error, index) => {
return (
<Alert type='error' key={index}>
<div
className='x-spacing'
style={{ fontSize: '1rem' }}
>
<div className='x-spacing h4'>
<Icon icon='error' size={20} />
<span>{error}</span>
</div>
Expand All @@ -145,20 +143,13 @@ const AdvancedSearchForm = ({ datastore }) => {
/>
);
})}
<div
style={{
display: 'flex',
justifyContent: 'space-around'
}}
<button
className='btn btn--small btn--secondary add-another-field'
onClick={handleAddAnotherFieldedSearch}
type='button'
>
<button
className='btn btn--small btn--secondary'
onClick={handleAddAnotherFieldedSearch}
type='button'
>
Add another field
</button>
</div>
Add another field
</button>

<button
className='btn btn--primary margin-top__m'
Expand Down
5 changes: 5 additions & 0 deletions src/modules/advanced/components/AdvancedSearchForm/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.add-another-field {
display: block;
margin-left: auto;
margin-right: auto;
}
32 changes: 9 additions & 23 deletions src/modules/advanced/components/FiltersContainer/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './styles.css';
import { useDispatch, useSelector } from 'react-redux';
import AdvancedFilter from '../AdvancedFilter';
import getFilters from './getFilters';
Expand Down Expand Up @@ -51,36 +52,22 @@ const ActiveAdvancedFilters = (datastore) => {

return (
<section aria-label='active-filters'>
<div
style={{
display: 'flex',
flexWrap: 'wrap',
gap: '0.25em'
}}
<h2
id='active-filters'
className='u-margin-top-none margin-bottom__xs h4'
>
<h2
id='active-filters'
className='u-margin-top-none margin-bottom__xs'
style={{ fontSize: '1rem' }}
>
Active filters
</h2>
Active filters
{' '}
<span className='text-grey__light padding-right__xs'>
({items.length})
</span>
</div>
</h2>

<p className='font-small u-margin-top-none'>
Unselect active filters through the options below.
</p>

<ul
style={{
fontSize: '0.9rem',
marginLeft: '2.5rem',
marginTop: '0'
}}
>
<ul className='margin-top__none active-filter-list'>
{items.map((item, index) => {
return (
<li key={index + item.group + item.value}>
Expand Down Expand Up @@ -201,8 +188,7 @@ const FiltersContainer = ({ datastore }) => {
})}
</div>
<button
style={{ marginTop: '1rem' }}
className='btn btn--primary'
className='btn btn--primary margin-top__m'
type='submit'
>
<Icon icon='search' size={24} /> Advanced Search
Expand Down
8 changes: 8 additions & 0 deletions src/modules/advanced/components/FiltersContainer/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#active-filters > .text-grey__light {
font-weight: 400;
}

.active-filter-list {
font-size: 0.9rem;
margin-left: 2.5rem;
}
4 changes: 1 addition & 3 deletions src/modules/lists/components/ActionsList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ const ActionsList = (props) => {
}}
aria-pressed={Boolean(isActive)}
>
<span style={{ opacity: '0.75' }}>
<Icon size={20} icon={action.icon} />
</span>
<Icon size={20} icon={action.icon} className={isActive ? null : 'text-grey'} />
{action.name}
</button>
</li>
Expand Down
7 changes: 1 addition & 6 deletions src/modules/lists/components/CitationAction/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './styles.css';
import React, { useEffect, useState } from 'react';
import { Tab, TabPanel, Tabs } from '../../../reusable';
import { cite } from '../../../citations';
Expand Down Expand Up @@ -107,12 +108,6 @@ const CitationAction = ({ datastore, list, record, setActive, setAlert, viewType
</label>
<div
id={`citation-text-${citationOption.id}`}
style={{
border: 'solid 1px var(--search-color-grey-400)',
boxShadow: 'none',
maxHeight: '40vh',
overflowY: 'auto'
}}
className='y-spacing copy-citation padding-y__xs padding-x__s container__rounded'
contentEditable
aria-describedby={`${citationOption.id}-disclaimer`}
Expand Down
6 changes: 6 additions & 0 deletions src/modules/lists/components/CitationAction/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.copy-citation {
border: solid 1px var(--search-color-grey-400);
box-shadow: none;
max-height: 40vh;
overflow-y: auto;
}
23 changes: 5 additions & 18 deletions src/modules/records/components/KeywordSwitch/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './styles.css';
import { Anchor, Icon } from '../../../reusable';
import PropTypes from 'prop-types';
import React from 'react';
Expand All @@ -22,31 +23,17 @@ const KeywordSwitch = ({ datastore, query }) => {
};

return (
<div
className={briefView ? 'record-preview' : 'container__rounded record'}
style={{
borderLeft: '4px solid var(--ds-color-maize-400)',
display: 'flex',
gap: '0.75rem',
padding: '1rem',
paddingLeft: '0.75rem'
}}
>
<div className={`flex padding__m padding-left__s ${briefView ? 'record-preview' : 'container__rounded record'} keyword-switch`}>
<Icon
d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z'
size={24}
style={{
color: 'var(--ds-color-maize-500)',
flexShrink: '0'
}}
/>
<div>
<p className='no-margin'>
{!briefView && isContainsSearch ? 'Seeing less precise results than you expected?' : 'Not seeing the results you expected?'}
<Anchor
to={`?query=${querySearch}`}
style={{ display: 'block' }}
>
</p>
<p className='no-margin'>
<Anchor to={`?query=${querySearch}`}>
{linkText()}
</Anchor>
</p>
Expand Down
9 changes: 9 additions & 0 deletions src/modules/records/components/KeywordSwitch/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.keyword-switch {
border-left: 4px solid var(--ds-color-maize-400);
gap: 0.75rem;
}

.keyword-switch > svg {
color: var(--ds-color-maize-500);
flex-shrink: 0;
}
3 changes: 2 additions & 1 deletion src/modules/records/components/RecordFull/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ const FullRecord = () => {
{' '}
anonymously if you encounter harmful or problematic language in catalog records or finding aids. More information about our policies and practices is available at
{' '}
<Anchor href='https://www.lib.umich.edu/about-us/policies/remediation-harmful-language-library-metadata?utm_source=library-search'>Remediation of Harmful Language</Anchor>.
<Anchor href='https://www.lib.umich.edu/about-us/policies/remediation-harmful-language-library-metadata?utm_source=library-search'>Remediation of Harmful Language</Anchor>
.
</p>
)}
</div>
Expand Down
6 changes: 4 additions & 2 deletions src/stylesheets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ body {
/*
Headings
*/
h1 {
h1,
.h1 {
font-size: 1.87rem;
}

Expand All @@ -140,7 +141,8 @@ h3 {
font-size: 1.25rem;
}

h4 {
h4,
.h4 {
font-size: 1rem;
}

Expand Down

0 comments on commit 48387ce

Please sign in to comment.