diff --git a/src/pages/index.js b/src/pages/index.js index d5a65d59..089ee757 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -3,80 +3,94 @@ * @license YetiForce Public License 5.0 (licenses/LicenseEN.txt or yetiforce.com) * @author Mariusz Krzaczkowski */ + import React from 'react'; +import PropTypes from 'prop-types'; import clsx from 'clsx'; import Layout from '@theme/Layout'; import Link from '@docusaurus/Link'; -import Head from '@docusaurus/Head'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; import useBaseUrl from '@docusaurus/useBaseUrl'; import styles from './styles.module.css'; -import Translate, { translate } from '@docusaurus/Translate'; +import { translate } from '@docusaurus/Translate'; const features = [ { message: 'User guides', url: 'user-guides', - imageUrl: 'img/main/user.svg' + imageUrl: 'img/main/user.svg', }, { message: 'Administrator guides', url: 'administrator-guides', - imageUrl: 'img/main/administrator.svg' + imageUrl: 'img/main/administrator.svg', }, { message: 'Developer Guides', url: 'developer-guides', - imageUrl: 'img/main/developer.svg' - } + imageUrl: 'img/main/developer.svg', + }, ]; -function Feature(props) { - const imgUrl = useBaseUrl(props['imageUrl']); +function Feature({ message, url, imageUrl, description }) { + const imgUrl = useBaseUrl(imageUrl); return (
{imgUrl && (
- {props['message']} + {message}

- + {translate({ - message: props['message'], - description: 'The homepage icon alt message' + message, + description: 'The homepage icon alt message', })}

)} - -

{props['description']}

+

{description}

); } +Feature.propTypes = { + message: PropTypes.string.isRequired, + url: PropTypes.string.isRequired, + imageUrl: PropTypes.string, + description: PropTypes.string, +}; + +Feature.defaultProps = { + imageUrl: '', + description: '', +}; + export default function Home() { const context = useDocusaurusContext(); const { siteConfig = {} } = context; + return (
-

{`${translate({ message: siteConfig.title })}`}

-

{`${translate({ message: siteConfig.tagline })}`}

+

{translate({ message: siteConfig.title })}

+

{translate({ message: siteConfig.tagline })}

- - {translate({ - message: 'Get Started' - })} + + {translate({ message: 'Get Started' })}
- {features && features.length > 0 && ( + {features.length > 0 && (