-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some layout API: - Connect search to API - Trying some APIv3 Pagination: - Add pagination - Improve pagination component - Improve Pagination interface Temporarily hide claim card Improve MapCard interface Upgrade @oacore/design to 'latest'
- Loading branch information
1 parent
784fa22
commit d401f3a
Showing
32 changed files
with
1,042 additions
and
378 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import React, { useState } from 'react' | ||
import { Button, Link } from '@oacore/design' | ||
import { classNames } from '@oacore/design/lib/utils' | ||
|
||
import styles from './styles.module.css' | ||
|
||
const AuthorLink = ({ name }) => ( | ||
<Link | ||
href={`https://core.ac.uk/search?q=author:(${name})`} | ||
className={styles.authorLink} | ||
> | ||
{name.replace(',', ' ')} | ||
</Link> | ||
) | ||
|
||
const Authors = ({ authors }) => { | ||
const [isExpanded, setIsExpanded] = useState(false) | ||
if (authors.length <= 3) { | ||
return authors.map((author, index) => ( | ||
<> | ||
<AuthorLink name={author.name} /> | ||
{index < authors.length - 1 ? ', ' : ''} | ||
</> | ||
)) | ||
} | ||
|
||
return ( | ||
<> | ||
<AuthorLink name={authors[0].name} />,{' '} | ||
<AuthorLink name={authors[1].name} />,{' '} | ||
<span | ||
className={classNames.use( | ||
styles.moreAuthorsBox, | ||
isExpanded && styles.moreAuthorsExpanded | ||
)} | ||
> | ||
<Button | ||
className={styles.showMore} | ||
aria-controls="more-authors" | ||
onClick={() => setIsExpanded(true)} | ||
aria-hidden={isExpanded} | ||
title="Show more authors" | ||
> | ||
+ {authors.length - 3} MORE | ||
</Button> | ||
<span | ||
id="more-authors" | ||
aria-hidden={!isExpanded} | ||
className={styles.moreAuthors} | ||
> | ||
{authors.slice(2, -1).map((author) => ( | ||
<> | ||
<AuthorLink name={author.name} />,{' '} | ||
</> | ||
))} | ||
</span> | ||
</span> | ||
<AuthorLink name={authors[authors.length - 1].name} /> | ||
</> | ||
) | ||
} | ||
|
||
export default Authors |
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,36 @@ | ||
.author-link { | ||
color: var(--gray-800); | ||
text-decoration: underline; | ||
} | ||
|
||
.show-more { | ||
position: relative; | ||
padding: 0 0.25rem; | ||
margin: 0 0.25rem; | ||
color: var(--gray-700); | ||
text-transform: uppercase; | ||
white-space: nowrap; | ||
background: var(--gray-100); | ||
} | ||
|
||
.show-more::after { | ||
position: absolute; | ||
right: -0.05rem; | ||
content: ','; | ||
} | ||
|
||
.more-authors { | ||
display: none; | ||
} | ||
|
||
.more-authors-box { | ||
display: contents; | ||
} | ||
|
||
.more-authors-expanded .show-more { | ||
display: none; | ||
} | ||
|
||
.more-authors-expanded .more-authors { | ||
display: inline-block; | ||
} |
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
File renamed without changes.
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,12 +1,12 @@ | ||
import Content from './content' | ||
import Sidebar from './sidebar' | ||
import Result from './result' | ||
import Results from './results' | ||
import Main from './main' | ||
import Search from './search' | ||
import ResultStats from './result-stats' | ||
|
||
Search.Content = Content | ||
Search.Sidebar = Sidebar | ||
Search.Result = Result | ||
Search.Results = Results | ||
Search.Main = Main | ||
Search.ResultStats = ResultStats | ||
|
||
export default Search |
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,12 @@ | ||
import React from 'react' | ||
import { classNames } from '@oacore/design/lib/utils' | ||
|
||
import styles from './styles.module.css' | ||
|
||
const Main = ({ children, className, tag: Tag = 'div', ...restProps }) => ( | ||
<Tag className={classNames.use(styles.main, className)} {...restProps}> | ||
{children} | ||
</Tag> | ||
) | ||
|
||
export default Main |
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
Oops, something went wrong.