diff --git a/src/components/About/About.js b/src/components/About/About.js index a2deb8e..de8861e 100644 --- a/src/components/About/About.js +++ b/src/components/About/About.js @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types' import { Link } from 'gatsby' import './About.scss' @@ -38,4 +39,16 @@ const About = ({ title, pageTitle, email }) => { ) } -export default About \ No newline at end of file +export default About + +About.propTypes = { + title: PropTypes.string, + pageTitle: PropTypes.string, + email: PropTypes.string +} + +About.defaultProps = { + title: null, + pageTitle: null, + email: null +} \ No newline at end of file diff --git a/src/components/Articles/Articles.js b/src/components/Articles/Articles.js index 172ea07..0d4d483 100644 --- a/src/components/Articles/Articles.js +++ b/src/components/Articles/Articles.js @@ -2,7 +2,7 @@ import React from 'react'; import ArticleCard from './ArticleCard/ArticleCard' import './Articles.scss' -export default () => { +const Articles = () => { return (
@@ -10,4 +10,6 @@ export default () => {
) -} \ No newline at end of file +} + +export default Articles \ No newline at end of file diff --git a/src/components/Description/Description.js b/src/components/Description/Description.js index 06c8a0f..44bac9a 100644 --- a/src/components/Description/Description.js +++ b/src/components/Description/Description.js @@ -1,7 +1,9 @@ import React from 'react'; import './Description.scss' -export default () => { +import HelloIcon from '../../images/hello-icon.svg' + +const Description = () => { return (
@@ -16,15 +18,7 @@ export default () => {

сборник статей и руководств по тематике веб-разработки и IT для того чтобы помочь вам

- +
@@ -32,4 +26,6 @@ export default () => {
) -} \ No newline at end of file +} + +export default Description \ No newline at end of file diff --git a/src/components/Footer/Footer.js b/src/components/Footer/Footer.js index d8ee49c..078184b 100644 --- a/src/components/Footer/Footer.js +++ b/src/components/Footer/Footer.js @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types' import './Footer.scss' const Footer = ({ title }) => { @@ -60,4 +61,12 @@ const Footer = ({ title }) => { ) } -export default Footer \ No newline at end of file +export default Footer + +Footer.propTypes = { + title: PropTypes.string +} + +Footer.defaultProps = { + title: null +} \ No newline at end of file diff --git a/src/components/Header/Header.js b/src/components/Header/Header.js index 2ba3e49..de5cd41 100644 --- a/src/components/Header/Header.js +++ b/src/components/Header/Header.js @@ -1,4 +1,5 @@ import React from 'react' +import PropTypes from 'prop-types' import { Link } from 'gatsby' import ThemeContext from '../../context/ThemeContext' import './Header.scss' @@ -87,4 +88,19 @@ const Header = ({ title, menuLinks }) => { ) } -export default Header \ No newline at end of file +export default Header + +Header.propTypes = { + title: PropTypes.string, + menuLinks: PropTypes.arrayOf( + PropTypes.shape({ + link: PropTypes.string, + name: PropTypes.string + }) + ) +} + +Header.defaultProps = { + title: null, + menuLinks: null +} \ No newline at end of file diff --git a/src/components/Newsletter/Newsletter.js b/src/components/Newsletter/Newsletter.js index 88cc8c9..e441528 100644 --- a/src/components/Newsletter/Newsletter.js +++ b/src/components/Newsletter/Newsletter.js @@ -1,7 +1,7 @@ import React from 'react'; import './Newsletter.scss' -export default () => { +const Newsletter = () => { return (
@@ -22,4 +22,6 @@ export default () => {
) -} \ No newline at end of file +} + +export default Newsletter \ No newline at end of file diff --git a/src/components/Offers/Offers.js b/src/components/Offers/Offers.js index 519fc99..7fef3f8 100644 --- a/src/components/Offers/Offers.js +++ b/src/components/Offers/Offers.js @@ -6,7 +6,7 @@ import ViewsIcon from '../../images/views-icon.svg' import TagIcon from '../../images/tag-icon.svg' import BooksIcon from '../../images/books-icon.svg' -export default () => { +const Offers = () => { return (
@@ -96,4 +96,6 @@ export default () => {
) -} \ No newline at end of file +} + +export default Offers \ No newline at end of file diff --git a/src/context/ThemeContext.js b/src/context/ThemeContext.js index f4ae59d..c8d3026 100644 --- a/src/context/ThemeContext.js +++ b/src/context/ThemeContext.js @@ -18,7 +18,7 @@ const ThemeProvider = ({ children }) => { } React.useEffect(() => { - if (localStorage.getItem('dark')) { + if (localStorage.getItem('dark') || (new Date().getHours() >= 22 || new Date().getHours() <= 6)) { toggleDarkTheme() } }, [setIsDark]) diff --git a/src/images/hello-icon.svg b/src/images/hello-icon.svg new file mode 100644 index 0000000..c947023 --- /dev/null +++ b/src/images/hello-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file