diff --git a/.prettierrc b/.prettierrc index b785842..0a72520 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,6 +1,6 @@ { - "trailingComma": "es5", - "tabWidth": 2, - "semi": false, - "singleQuote": true + "trailingComma": "es5", + "tabWidth": 2, + "semi": true, + "singleQuote": true } diff --git a/config.js b/config.js index 87a7ab7..80f705b 100644 --- a/config.js +++ b/config.js @@ -1,52 +1,52 @@ -"use strict"; +'use strict'; module.exports = { - url: "https://lumen.netlify.com", - pathPrefix: "/", - title: "Blog by John Doe", + url: 'https://lumen.netlify.com', + pathPrefix: '/', + title: 'Blog by John Doe', subtitle: - "Pellentesque odio nisi, euismod in, pharetra a, ultricies in, diam. Sed arcu.", - copyright: "© All rights reserved.", - disqusShortname: "", + 'Pellentesque odio nisi, euismod in, pharetra a, ultricies in, diam. Sed arcu.', + copyright: '© All rights reserved.', + disqusShortname: '', postsPerPage: 4, - googleAnalyticsId: "UA-73379983-2", + googleAnalyticsId: 'UA-73379983-2', useKatex: false, menu: [ { - label: "Articles", - path: "/", + label: 'Articles', + path: '/', }, { - label: "About me", - path: "/pages/about", + label: 'About me', + path: '/pages/about', }, { - label: "Contact me", - path: "/pages/contacts", + label: 'Contact me', + path: '/pages/contacts', }, ], author: { - name: "John Doe", - photo: "/photo.jpg", + name: 'John Doe', + photo: '/photo.jpg', bio: - "Pellentesque odio nisi, euismod in, pharetra a, ultricies in, diam. Sed arcu.", + 'Pellentesque odio nisi, euismod in, pharetra a, ultricies in, diam. Sed arcu.', contacts: { - email: "", - facebook: "#", - telegram: "#", - twitter: "#", - github: "#", - rss: "", - vkontakte: "", - linkedin: "#", - instagram: "#", - line: "", - gitlab: "", - weibo: "", - codepen: "", - youtube: "", - soundcloud: "", - medium: "#", + email: '', + facebook: '#', + telegram: '#', + twitter: '#', + github: '#', + rss: '', + vkontakte: '', + linkedin: '#', + instagram: '#', + line: '', + gitlab: '', + weibo: '', + codepen: '', + youtube: '', + soundcloud: '', + medium: '#', }, }, }; diff --git a/src/constants/icons.js b/src/constants/icons.js index b1002a8..f05fcc1 100644 --- a/src/constants/icons.js +++ b/src/constants/icons.js @@ -80,6 +80,6 @@ const ICONS = { 'M2.846 6.887a.928.928 0 00-.303-.784l-2.24-2.7V3h6.958l5.378 11.795L17.367 3H24v.403L22.084 5.24a.561.561 0 00-.213.538v13.498a.56.56 0 00.213.537l1.871 1.837v.403h-9.412v-.403l1.939-1.882c.19-.19.19-.246.19-.537V8.321l-5.389 13.688h-.728L4.28 8.321v9.174c-.052.385.076.774.347 1.052l2.521 3.058v.404H0v-.404l2.521-3.058c.27-.279.39-.67.325-1.052V6.887z', viewBox: '0 0 24 24', }, -} +}; -export default ICONS +export default ICONS; diff --git a/src/hooks/use-site-metadata.js b/src/hooks/use-site-metadata.js index 4ea4238..d247d8a 100644 --- a/src/hooks/use-site-metadata.js +++ b/src/hooks/use-site-metadata.js @@ -1,5 +1,5 @@ // @flow strict -import { useStaticQuery, graphql } from 'gatsby' +import { useStaticQuery, graphql } from 'gatsby'; const useSiteMetadata = () => { const { site } = useStaticQuery( @@ -43,9 +43,9 @@ const useSiteMetadata = () => { } } ` - ) + ); - return site.siteMetadata -} + return site.siteMetadata; +}; -export default useSiteMetadata +export default useSiteMetadata; diff --git a/src/utils/get-contact-href.js b/src/utils/get-contact-href.js index 0adba18..b9fb6ed 100644 --- a/src/utils/get-contact-href.js +++ b/src/utils/get-contact-href.js @@ -1,59 +1,59 @@ // @flow strict const getContactHref = (name: string, contact: string) => { - let href + let href; switch (name) { case 'twitter': - href = `https://www.twitter.com/${contact}` - break + href = `https://www.twitter.com/${contact}`; + break; case 'github': - href = `https://github.com/${contact}` - break + href = `https://github.com/${contact}`; + break; case 'vkontakte': - href = `https://vk.com/${contact}` - break + href = `https://vk.com/${contact}`; + break; case 'telegram': - href = `https://t.me/${contact}` - break + href = `https://t.me/${contact}`; + break; case 'email': - href = `mailto:${contact}` - break + href = `mailto:${contact}`; + break; case 'linkedin': - href = `https://www.linkedin.com/in/${contact}` - break + href = `https://www.linkedin.com/in/${contact}`; + break; case 'instagram': - href = `https://www.instagram.com/${contact}` - break + href = `https://www.instagram.com/${contact}`; + break; case 'line': - href = `line://ti/p/${contact}` - break + href = `line://ti/p/${contact}`; + break; case 'facebook': - href = `https://www.facebook.com/${contact}` - break + href = `https://www.facebook.com/${contact}`; + break; case 'gitlab': - href = `https://www.gitlab.com/${contact}` - break + href = `https://www.gitlab.com/${contact}`; + break; case 'weibo': - href = `https://www.weibo.com/${contact}` - break + href = `https://www.weibo.com/${contact}`; + break; case 'codepen': - href = `https://www.codepen.io/${contact}` - break + href = `https://www.codepen.io/${contact}`; + break; case 'youtube': - href = `https://www.youtube.com/channel/${contact}` - break + href = `https://www.youtube.com/channel/${contact}`; + break; case 'soundcloud': - href = `https://soundcloud.com/${contact}` - break + href = `https://soundcloud.com/${contact}`; + break; case 'medium': - href = `https://medium.com/${contact}` - break + href = `https://medium.com/${contact}`; + break; default: - href = contact - break + href = contact; + break; } - return href -} + return href; +}; -export default getContactHref +export default getContactHref; diff --git a/src/utils/get-contact-href.test.js b/src/utils/get-contact-href.test.js index 975280e..a53c23c 100644 --- a/src/utils/get-contact-href.test.js +++ b/src/utils/get-contact-href.test.js @@ -1,23 +1,23 @@ // @flow strict -import getContactHref from './get-contact-href' +import getContactHref from './get-contact-href'; test('getContactHref', () => { - expect(getContactHref('twitter', '#')).toBe('https://www.twitter.com/#') - expect(getContactHref('github', '#')).toBe('https://github.com/#') - expect(getContactHref('email', '#')).toBe('mailto:#') - expect(getContactHref('vkontakte', '#')).toBe('https://vk.com/#') - expect(getContactHref('telegram', '#')).toBe('https://t.me/#') - expect(getContactHref('rss', '#')).toBe('#') - expect(getContactHref('linkedin', '#')).toBe('https://www.linkedin.com/in/#') - expect(getContactHref('instagram', '#')).toBe('https://www.instagram.com/#') - expect(getContactHref('line', '#')).toBe('line://ti/p/#') - expect(getContactHref('facebook', '#')).toBe('https://www.facebook.com/#') - expect(getContactHref('gitlab', '#')).toBe('https://www.gitlab.com/#') - expect(getContactHref('weibo', '#')).toBe('https://www.weibo.com/#') - expect(getContactHref('codepen', '#')).toBe('https://www.codepen.io/#') + expect(getContactHref('twitter', '#')).toBe('https://www.twitter.com/#'); + expect(getContactHref('github', '#')).toBe('https://github.com/#'); + expect(getContactHref('email', '#')).toBe('mailto:#'); + expect(getContactHref('vkontakte', '#')).toBe('https://vk.com/#'); + expect(getContactHref('telegram', '#')).toBe('https://t.me/#'); + expect(getContactHref('rss', '#')).toBe('#'); + expect(getContactHref('linkedin', '#')).toBe('https://www.linkedin.com/in/#'); + expect(getContactHref('instagram', '#')).toBe('https://www.instagram.com/#'); + expect(getContactHref('line', '#')).toBe('line://ti/p/#'); + expect(getContactHref('facebook', '#')).toBe('https://www.facebook.com/#'); + expect(getContactHref('gitlab', '#')).toBe('https://www.gitlab.com/#'); + expect(getContactHref('weibo', '#')).toBe('https://www.weibo.com/#'); + expect(getContactHref('codepen', '#')).toBe('https://www.codepen.io/#'); expect(getContactHref('youtube', '#')).toBe( 'https://www.youtube.com/channel/#' - ) - expect(getContactHref('soundcloud', '#')).toBe('https://soundcloud.com/#') - expect(getContactHref('medium', '#')).toBe('https://medium.com/#') -}) + ); + expect(getContactHref('soundcloud', '#')).toBe('https://soundcloud.com/#'); + expect(getContactHref('medium', '#')).toBe('https://medium.com/#'); +}); diff --git a/src/utils/get-icon.js b/src/utils/get-icon.js index c6262de..2b5631f 100644 --- a/src/utils/get-icon.js +++ b/src/utils/get-icon.js @@ -1,64 +1,64 @@ // @flow strict -import { ICONS } from '../constants' +import { ICONS } from '../constants'; const getIcon = (name: string) => { - let icon + let icon; switch (name) { case 'twitter': - icon = ICONS.TWITTER - break + icon = ICONS.TWITTER; + break; case 'github': - icon = ICONS.GITHUB - break + icon = ICONS.GITHUB; + break; case 'vkontakte': - icon = ICONS.VKONTAKTE - break + icon = ICONS.VKONTAKTE; + break; case 'telegram': - icon = ICONS.TELEGRAM - break + icon = ICONS.TELEGRAM; + break; case 'email': - icon = ICONS.EMAIL - break + icon = ICONS.EMAIL; + break; case 'rss': - icon = ICONS.RSS - break + icon = ICONS.RSS; + break; case 'linkedin': - icon = ICONS.LINKEDIN - break + icon = ICONS.LINKEDIN; + break; case 'instagram': - icon = ICONS.INSTAGRAM - break + icon = ICONS.INSTAGRAM; + break; case 'line': - icon = ICONS.LINE - break + icon = ICONS.LINE; + break; case 'facebook': - icon = ICONS.FACEBOOK - break + icon = ICONS.FACEBOOK; + break; case 'gitlab': - icon = ICONS.GITLAB - break + icon = ICONS.GITLAB; + break; case 'weibo': - icon = ICONS.WEIBO - break + icon = ICONS.WEIBO; + break; case 'codepen': - icon = ICONS.CODEPEN - break + icon = ICONS.CODEPEN; + break; case 'youtube': - icon = ICONS.YOUTUBE - break + icon = ICONS.YOUTUBE; + break; case 'soundcloud': - icon = ICONS.SOUNDCLOUD - break + icon = ICONS.SOUNDCLOUD; + break; case 'medium': - icon = ICONS.MEDIUM - break + icon = ICONS.MEDIUM; + break; default: - icon = {} - break + icon = {}; + break; } - return icon -} + return icon; +}; -export default getIcon +export default getIcon; diff --git a/src/utils/get-icon.test.js b/src/utils/get-icon.test.js index b2b0be9..9143bf6 100644 --- a/src/utils/get-icon.test.js +++ b/src/utils/get-icon.test.js @@ -1,22 +1,22 @@ // @flow strict -import getIcon from './get-icon' -import { ICONS } from '../constants' +import getIcon from './get-icon'; +import { ICONS } from '../constants'; test('getIcon', () => { - expect(getIcon('twitter')).toBe(ICONS.TWITTER) - expect(getIcon('github')).toBe(ICONS.GITHUB) - expect(getIcon('vkontakte')).toBe(ICONS.VKONTAKTE) - expect(getIcon('telegram')).toEqual(ICONS.TELEGRAM) - expect(getIcon('email')).toEqual(ICONS.EMAIL) - expect(getIcon('rss')).toEqual(ICONS.RSS) - expect(getIcon('linkedin')).toEqual(ICONS.LINKEDIN) - expect(getIcon('instagram')).toEqual(ICONS.INSTAGRAM) - expect(getIcon('line')).toEqual(ICONS.LINE) - expect(getIcon('facebook')).toEqual(ICONS.FACEBOOK) - expect(getIcon('gitlab')).toEqual(ICONS.GITLAB) - expect(getIcon('weibo')).toEqual(ICONS.WEIBO) - expect(getIcon('codepen')).toEqual(ICONS.CODEPEN) - expect(getIcon('youtube')).toEqual(ICONS.YOUTUBE) - expect(getIcon('soundcloud')).toEqual(ICONS.SOUNDCLOUD) - expect(getIcon('medium')).toEqual(ICONS.MEDIUM) -}) + expect(getIcon('twitter')).toBe(ICONS.TWITTER); + expect(getIcon('github')).toBe(ICONS.GITHUB); + expect(getIcon('vkontakte')).toBe(ICONS.VKONTAKTE); + expect(getIcon('telegram')).toEqual(ICONS.TELEGRAM); + expect(getIcon('email')).toEqual(ICONS.EMAIL); + expect(getIcon('rss')).toEqual(ICONS.RSS); + expect(getIcon('linkedin')).toEqual(ICONS.LINKEDIN); + expect(getIcon('instagram')).toEqual(ICONS.INSTAGRAM); + expect(getIcon('line')).toEqual(ICONS.LINE); + expect(getIcon('facebook')).toEqual(ICONS.FACEBOOK); + expect(getIcon('gitlab')).toEqual(ICONS.GITLAB); + expect(getIcon('weibo')).toEqual(ICONS.WEIBO); + expect(getIcon('codepen')).toEqual(ICONS.CODEPEN); + expect(getIcon('youtube')).toEqual(ICONS.YOUTUBE); + expect(getIcon('soundcloud')).toEqual(ICONS.SOUNDCLOUD); + expect(getIcon('medium')).toEqual(ICONS.MEDIUM); +});