Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(create): update broken SVG paths in templates #6762

Merged
merged 3 commits into from
Feb 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type FeatureItem = {
const FeatureList: FeatureItem[] = [
{
title: 'Easy to Use',
image: require('@site/src/static/img/undraw_docusaurus_mountain.svg'),
image: require('@site/static/img/undraw_docusaurus_mountain.svg'),
description: (
<>
Docusaurus was designed from the ground up to be easily installed and
Expand All @@ -21,7 +21,7 @@ const FeatureList: FeatureItem[] = [
},
{
title: 'Focus on What Matters',
image: require('@site/src/static/img/undraw_docusaurus_tree.svg'),
image: require('@site/static/img/undraw_docusaurus_tree.svg'),
description: (
<>
Docusaurus lets you focus on your docs, and we&apos;ll do the chores. Go
Expand All @@ -31,7 +31,7 @@ const FeatureList: FeatureItem[] = [
},
{
title: 'Powered by React',
image: require('@site/src/static/img/undraw_docusaurus_react.svg'),
image: require('@site/static/img/undraw_docusaurus_react.svg'),
description: (
<>
Extend or customize your website layout by reusing React. Docusaurus can
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import styles from './styles.module.css';

type FeatureItem = {
title: string;
image: string;
Svg: React.ComponentType<React.ComponentProps<'svg'>>;
description: JSX.Element;
};

const FeatureList: FeatureItem[] = [
{
title: 'Easy to Use',
image: require('@site/src/static/img/undraw_docusaurus_mountain.svg'),
Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default,
description: (
<>
Docusaurus was designed from the ground up to be easily installed and
Expand All @@ -21,7 +21,7 @@ const FeatureList: FeatureItem[] = [
},
{
title: 'Focus on What Matters',
image: require('@site/src/static/img/undraw_docusaurus_tree.svg'),
Svg: require('@site/static/img/undraw_docusaurus_tree.svg').default,
description: (
<>
Docusaurus lets you focus on your docs, and we&apos;ll do the chores. Go
Expand All @@ -31,7 +31,7 @@ const FeatureList: FeatureItem[] = [
},
{
title: 'Powered by React',
image: require('@site/src/static/img/undraw_docusaurus_react.svg'),
Svg: require('@site/static/img/undraw_docusaurus_react.svg').default,
description: (
<>
Extend or customize your website layout by reusing React. Docusaurus can
Expand All @@ -41,11 +41,11 @@ const FeatureList: FeatureItem[] = [
},
];

function Feature({title, image, description}: FeatureItem) {
function Feature({title, Svg, description}: FeatureItem) {
return (
<div className={clsx('col col--4')}>
<div className="text--center">
<img className={styles.featureSvg} alt={title} src={image} />
<Svg className={styles.featureSvg} role="img" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a side fix, because TypeScript correctly warns us that svg elements should not have alt. Instead, I've added a <title> to each SVG graphic. See also #6684

</div>
<div className="text--center padding-horiz--md">
<h3>{title}</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function Feature({Svg, title, description}) {
return (
<div className={clsx('col col--4')}>
<div className="text--center">
<Svg className={styles.featureSvg} alt={title} />
<Svg className={styles.featureSvg} role="img" />
</div>
<div className="text--center padding-horiz--md">
<h3>{title}</h3>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading