Skip to content
Snippets Groups Projects
Verified Commit 6c8aee89 authored by Loïs Poujade's avatar Loïs Poujade
Browse files

MaterialUI auto upgrade

ran `npx @mui/codemod v5.0.0/link-underline-hover`
parent 3e99e3d1
Branches
No related tags found
No related merge requests found
...@@ -39,14 +39,14 @@ describe('AttributionPanel', () => { ...@@ -39,14 +39,14 @@ describe('AttributionPanel', () => {
expect( expect(
wrapper.find(Typography).at(1).matchesElement( wrapper.find(Typography).at(1).matchesElement(
<Typography> <Typography>
<Link href="http://example.com">http://example.com</Link> <Link href="http://example.com" underline="hover">http://example.com</Link>
</Typography>, </Typography>,
), ),
).toBe(true); ).toBe(true);
expect( expect(
wrapper.find(Typography).at(2).matchesElement( wrapper.find(Typography).at(2).matchesElement(
<Typography> <Typography>
<Link href="http://stanford.edu">http://stanford.edu</Link> <Link href="http://stanford.edu" underline="hover">http://stanford.edu</Link>
</Typography>, </Typography>,
), ),
).toBe(true); ).toBe(true);
......
...@@ -68,7 +68,7 @@ describe('ManifestRelatedLinks', () => { ...@@ -68,7 +68,7 @@ describe('ManifestRelatedLinks', () => {
expect( expect(
wrapper.find(Typography).at(2) wrapper.find(Typography).at(2)
.matchesElement( .matchesElement(
<Typography component="dd"><Link href="http://example.com/">Home page</Link></Typography>, <Typography component="dd"><Link href="http://example.com/" underline="hover">Home page</Link></Typography>,
), ),
).toBe(true); ).toBe(true);
}); });
...@@ -85,7 +85,7 @@ describe('ManifestRelatedLinks', () => { ...@@ -85,7 +85,7 @@ describe('ManifestRelatedLinks', () => {
wrapper.find(Typography).at(4) wrapper.find(Typography).at(4)
.matchesElement( .matchesElement(
<Typography component="dd"> <Typography component="dd">
<Link href="http://example.com/pdf">PDF Version</Link> <Link href="http://example.com/pdf" underline="hover">PDF Version</Link>
</Typography>, </Typography>,
), ),
).toBe(true); ).toBe(true);
...@@ -102,7 +102,7 @@ describe('ManifestRelatedLinks', () => { ...@@ -102,7 +102,7 @@ describe('ManifestRelatedLinks', () => {
expect( expect(
wrapper.find(Typography).at(6) wrapper.find(Typography).at(6)
.matchesElement( .matchesElement(
<Typography component="dd"><Link href="http://example.com/related">http://example.com/related</Link></Typography>, <Typography component="dd"><Link href="http://example.com/related" underline="hover">http://example.com/related</Link></Typography>,
), ),
).toBe(true); ).toBe(true);
...@@ -110,7 +110,7 @@ describe('ManifestRelatedLinks', () => { ...@@ -110,7 +110,7 @@ describe('ManifestRelatedLinks', () => {
wrapper.find(Typography).at(7) wrapper.find(Typography).at(7)
.matchesElement( .matchesElement(
<Typography component="dd"> <Typography component="dd">
<Link href="http://example.com/video">Video</Link> <Link href="http://example.com/video" underline="hover">Video</Link>
<Typography>(video/ogg)</Typography> <Typography>(video/ogg)</Typography>
</Typography>, </Typography>,
), ),
...@@ -129,7 +129,7 @@ describe('ManifestRelatedLinks', () => { ...@@ -129,7 +129,7 @@ describe('ManifestRelatedLinks', () => {
wrapper.find(Typography).at(10) wrapper.find(Typography).at(10)
.matchesElement( .matchesElement(
<Typography component="dd"> <Typography component="dd">
<Link href="http://example.com/a">A</Link> <Link href="http://example.com/a" underline="hover">A</Link>
<Typography>(text/html)</Typography> <Typography>(text/html)</Typography>
</Typography>, </Typography>,
), ),
...@@ -138,7 +138,7 @@ describe('ManifestRelatedLinks', () => { ...@@ -138,7 +138,7 @@ describe('ManifestRelatedLinks', () => {
expect( expect(
wrapper.find(Typography).at(12) wrapper.find(Typography).at(12)
.matchesElement( .matchesElement(
<Typography component="dd"><Link href="http://example.com/b">http://example.com/b</Link></Typography>, <Typography component="dd"><Link href="http://example.com/b" underline="hover">http://example.com/b</Link></Typography>,
), ),
).toBe(true); ).toBe(true);
}); });
...@@ -154,7 +154,7 @@ describe('ManifestRelatedLinks', () => { ...@@ -154,7 +154,7 @@ describe('ManifestRelatedLinks', () => {
expect( expect(
wrapper.find(Typography).at(14) wrapper.find(Typography).at(14)
.matchesElement( .matchesElement(
<Typography component="dd"><Link href="http://example.com/">http://example.com/</Link></Typography>, <Typography component="dd"><Link href="http://example.com/" underline="hover">http://example.com/</Link></Typography>,
), ),
).toBe(true); ).toBe(true);
}); });
......
...@@ -45,7 +45,7 @@ export class AttributionPanel extends Component { ...@@ -45,7 +45,7 @@ export class AttributionPanel extends Component {
<Typography variant="subtitle2" component="dt">{t('rights')}</Typography> <Typography variant="subtitle2" component="dt">{t('rights')}</Typography>
{ rights.map(v => ( { rights.map(v => (
<Typography variant="body1" component="dd" key={v.toString()}> <Typography variant="body1" component="dd" key={v.toString()}>
<Link target="_blank" rel="noopener noreferrer" href={v}> <Link target="_blank" rel="noopener noreferrer" href={v} underline="hover">
{v} {v}
</Link> </Link>
</Typography> </Typography>
......
...@@ -212,7 +212,7 @@ export class CollectionDialog extends Component { ...@@ -212,7 +212,7 @@ export class CollectionDialog extends Component {
<Typography variant="subtitle2" component="dt">{t('rights')}</Typography> <Typography variant="subtitle2" component="dt">{t('rights')}</Typography>
{ rights.map(v => ( { rights.map(v => (
<Typography variant="body1" component="dd" key={v}> <Typography variant="body1" component="dd" key={v}>
<Link target="_blank" rel="noopener noreferrer" href={v}> <Link target="_blank" rel="noopener noreferrer" href={v} underline="hover">
{v} {v}
</Link> </Link>
</Typography> </Typography>
......
...@@ -47,7 +47,11 @@ export class ManifestRelatedLinks extends Component { ...@@ -47,7 +47,11 @@ export class ManifestRelatedLinks extends Component {
{ {
homepage.map(page => ( homepage.map(page => (
<Typography key={page.value} variant="body1" component="dd"> <Typography key={page.value} variant="body1" component="dd">
<Link target="_blank" rel="noopener noreferrer" href={page.value}> <Link
target="_blank"
rel="noopener noreferrer"
href={page.value}
underline="hover">
{page.label || page.value} {page.label || page.value}
</Link> </Link>
</Typography> </Typography>
...@@ -61,7 +65,11 @@ export class ManifestRelatedLinks extends Component { ...@@ -61,7 +65,11 @@ export class ManifestRelatedLinks extends Component {
{ {
renderings.map(rendering => ( renderings.map(rendering => (
<Typography key={rendering.value} variant="body1" component="dd"> <Typography key={rendering.value} variant="body1" component="dd">
<Link target="_blank" rel="noopener noreferrer" href={rendering.value}> <Link
target="_blank"
rel="noopener noreferrer"
href={rendering.value}
underline="hover">
{rendering.label || rendering.value} {rendering.label || rendering.value}
</Link> </Link>
</Typography> </Typography>
...@@ -75,7 +83,11 @@ export class ManifestRelatedLinks extends Component { ...@@ -75,7 +83,11 @@ export class ManifestRelatedLinks extends Component {
{ {
related.map(relatedItem => ( related.map(relatedItem => (
<Typography key={relatedItem.value} variant="body1" component="dd"> <Typography key={relatedItem.value} variant="body1" component="dd">
<Link target="_blank" rel="noopener noreferrer" href={relatedItem.value}> <Link
target="_blank"
rel="noopener noreferrer"
href={relatedItem.value}
underline="hover">
{relatedItem.label || relatedItem.value} {relatedItem.label || relatedItem.value}
</Link> </Link>
{ relatedItem.format && ( { relatedItem.format && (
...@@ -92,7 +104,11 @@ export class ManifestRelatedLinks extends Component { ...@@ -92,7 +104,11 @@ export class ManifestRelatedLinks extends Component {
{ {
seeAlso.map(seeAlsoItem => ( seeAlso.map(seeAlsoItem => (
<Typography key={seeAlsoItem.value} variant="body1" component="dd"> <Typography key={seeAlsoItem.value} variant="body1" component="dd">
<Link target="_blank" rel="noopener noreferrer" href={seeAlsoItem.value}> <Link
target="_blank"
rel="noopener noreferrer"
href={seeAlsoItem.value}
underline="hover">
{seeAlsoItem.label || seeAlsoItem.value} {seeAlsoItem.label || seeAlsoItem.value}
</Link> </Link>
{ seeAlsoItem.format && ( { seeAlsoItem.format && (
...@@ -107,7 +123,11 @@ export class ManifestRelatedLinks extends Component { ...@@ -107,7 +123,11 @@ export class ManifestRelatedLinks extends Component {
<> <>
<Typography variant="subtitle2" component="dt">{t('iiif_manifest')}</Typography> <Typography variant="subtitle2" component="dt">{t('iiif_manifest')}</Typography>
<Typography variant="body1" component="dd"> <Typography variant="body1" component="dd">
<Link target="_blank" rel="noopener noreferrer" href={manifestUrl}> <Link
target="_blank"
rel="noopener noreferrer"
href={manifestUrl}
underline="hover">
{manifestUrl} {manifestUrl}
</Link> </Link>
</Typography> </Typography>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment