Skip to content

Commit

Permalink
🚨 prettier --write
Browse files Browse the repository at this point in the history
  • Loading branch information
johannchopin committed Jun 27, 2020
1 parent 39c5b7f commit 1db8b27
Show file tree
Hide file tree
Showing 17 changed files with 39 additions and 27 deletions.
9 changes: 7 additions & 2 deletions src/components/Button/ToggleLayoutButtons.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ type Props = { layout: LayoutName, onClick: (layoutName: LayoutName) => void }

const ToggleLayoutButtons = (props: Props) => {
const renderLayoutBtn = (layoutName: LayoutName) => (
<button className={`btn layout ${props.layout === layoutName ? 'selected': ''}`} onClick={() => { props.onClick(layoutName) }}>
<button
className={`btn layout ${props.layout === layoutName ? 'selected' : ''}`}
onClick={() => {
props.onClick(layoutName)
}}
>
<Icon name={layoutName} />
</button>
)

return (
<div className='toggle-btn-group'>
<div className="toggle-btn-group">
{renderLayoutBtn('grid')}
{renderLayoutBtn('list')}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Button/__tests__/stubs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const props = {
target: '_blank',
icon: 'star',
text: 'GitHub'
text: 'GitHub',
}
2 changes: 1 addition & 1 deletion src/components/ContributorsList/__tests__/stubs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const props = {
profile: 'https://github.com/profile',
avatar: 'https://github.com/avatar'
avatar: 'https://github.com/avatar',
}
2 changes: 1 addition & 1 deletion src/components/GitmojiList/GitmojiCard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type Props = {
code: string,
description: string,
emoji: string,
name: string
name: string,
}

const GitmojiCard = (props: Props) => (
Expand Down
2 changes: 1 addition & 1 deletion src/components/GitmojiList/GitmojiRaw/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type Props = {
code: string,
description: string,
emoji: string,
name: string
name: string,
}

const GitmojiRaw = (props: Props) => (
Expand Down
2 changes: 1 addition & 1 deletion src/components/GitmojiList/__tests__/stubs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { gitmojis } from '../../../data/gitmojis.json'

export const props = {
gitmojis: gitmojis.slice(0, 6),
layout: 'grid'
layout: 'grid',
}
8 changes: 4 additions & 4 deletions src/components/GitmojiList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ type Props = {
code: string,
description: string,
emoji: string,
name: string
}>
name: string,
}>,
}

const GitmojiList = (props: Props) => {
Expand Down Expand Up @@ -45,7 +45,7 @@ const GitmojiList = (props: Props) => {
React.useEffect(() => {
const clipboard = new Clipboard('.gitmoji-code, .gitmoji-emoji')

clipboard.on('success', function(e) {
clipboard.on('success', function (e) {
window.ga('send', 'event', 'Gitmoji', 'Copy to Clipboard')

const elementClasses = e.trigger.classList
Expand All @@ -59,7 +59,7 @@ const GitmojiList = (props: Props) => {
message: notificationMessage,
layout: 'growl',
effect: 'scale',
type: 'notice'
type: 'notice',
})

notification.show()
Expand Down
2 changes: 1 addition & 1 deletion src/components/Icon/__tests__/stubs.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const props = {
name: 'star'
name: 'star',
}
10 changes: 8 additions & 2 deletions src/components/Icon/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,17 @@ export const IconDefinitions = () => (
</symbol>
<symbol id="icon-grid" x="0px" y="0px" viewBox="0 0 512 512">
<title>grid</title>
<path fill="currentColor" d="M464 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zM197.3 72h117.3v96H197.3zm0 136h117.3v96H197.3zm-40 232H52c-6.6 0-12-5.4-12-12v-84h117.3zm0-136H40v-96h117.3zm0-136H40V84c0-6.6 5.4-12 12-12h105.3zm157.4 272H197.3v-96h117.3v96zm157.3 0H354.7v-96H472zm0-136H354.7v-96H472zm0-136H354.7V72H472z"></path>
<path
fill="currentColor"
d="M464 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zM197.3 72h117.3v96H197.3zm0 136h117.3v96H197.3zm-40 232H52c-6.6 0-12-5.4-12-12v-84h117.3zm0-136H40v-96h117.3zm0-136H40V84c0-6.6 5.4-12 12-12h105.3zm157.4 272H197.3v-96h117.3v96zm157.3 0H354.7v-96H472zm0-136H354.7v-96H472zm0-136H354.7V72H472z"
></path>
</symbol>
<symbol id="icon-list" x="0px" y="0px" viewBox="0 0 512 512">
<title>list</title>
<path fill="currentColor" d="M0 80v352c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48H48C21.49 32 0 53.49 0 80zm472 224H197.333v-96H472v96zm0 40v84c0 6.627-5.373 12-12 12H197.333v-96H472zM40 208h117.333v96H40v-96zm157.333-40V72H460c6.627 0 12 5.373 12 12v84H197.333zm-40-96v96H40V84c0-6.627 5.373-12 12-12h105.333zM40 344h117.333v96H52c-6.627 0-12-5.373-12-12v-84z"></path>
<path
fill="currentColor"
d="M0 80v352c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48H48C21.49 32 0 53.49 0 80zm472 224H197.333v-96H472v96zm0 40v84c0 6.627-5.373 12-12 12H197.333v-96H472zM40 208h117.333v96H40v-96zm157.333-40V72H460c6.627 0 12 5.373 12 12v84H197.333zm-40-96v96H40V84c0-6.627 5.373-12 12-12h105.333zM40 344h117.333v96H52c-6.627 0-12-5.373-12-12v-84z"
></path>
</symbol>
</defs>
</svg>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Layout/Logo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import LOGO_STATUSES, {
Sexy,
Smiling,
Sunglasses,
Tongue
Tongue,
} from './statuses'

export const getIconByStatus = (status: $Keys<typeof LOGO_STATUSES>) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Layout/Logo/statuses/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ const LOGO_STATUSES: Object = {
SEXY: 'sexy',
SMILING: 'smiling',
SUNGLASSES: 'sunglasses',
TONGUE: 'tongue'
TONGUE: 'tongue',
}

export default LOGO_STATUSES
2 changes: 1 addition & 1 deletion src/components/Layout/__tests__/stubs.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const props = {
headerWithSocialButtons: true
headerWithSocialButtons: true,
}
6 changes: 5 additions & 1 deletion src/components/Layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import Header from './Header'
import Navigation from './Navigation'
import Footer from './Footer'

type Props = { headerWithSocialButtons: boolean, layout: 'grid' | 'list', children: React.Node }
type Props = {
headerWithSocialButtons: boolean,
layout: 'grid' | 'list',
children: React.Node,
}

const Layout = (props: Props) => (
<>
Expand Down
2 changes: 1 addition & 1 deletion src/components/SEO/__tests__/stubs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const props = {
pageUrl: '/about',
pageTitle: 'About'
pageTitle: 'About',
}
6 changes: 3 additions & 3 deletions src/pages/_document.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class InlineStylesHead extends Head {
nonce={this.props.nonce}
data-href={`${assetPrefix}/_next/${file}`}
dangerouslySetInnerHTML={{
__html: readFileSync(join(process.cwd(), '.next', file), 'utf-8')
__html: readFileSync(join(process.cwd(), '.next', file), 'utf-8'),
}}
/>
))
Expand All @@ -44,15 +44,15 @@ class CustomDocument extends Document {
<script
type="text/javascript"
dangerouslySetInnerHTML={{
__html: `(function(a,e,f,g,b,c,d){a.GoogleAnalyticsObject=b;a[b]=a[b]||function(){(a[b].q=a[b].q||[]).push(arguments)};a[b].l=1*new Date;c=e.createElement(f);d=e.getElementsByTagName(f)[0];c.async=1;c.src=g;d.parentNode.insertBefore(c,d)})(window,document,"script","//www.google-analytics.com/analytics.js","ga");ga("create","UA-67824860-7","auto");ga("send","pageview");`
__html: `(function(a,e,f,g,b,c,d){a.GoogleAnalyticsObject=b;a[b]=a[b]||function(){(a[b].q=a[b].q||[]).push(arguments)};a[b].l=1*new Date;c=e.createElement(f);d=e.getElementsByTagName(f)[0];c.async=1;c.src=g;d.parentNode.insertBefore(c,d)})(window,document,"script","//www.google-analytics.com/analytics.js","ga");ga("create","UA-67824860-7","auto");ga("send","pageview");`,
}}
/>
<script
type="text/javascript"
dangerouslySetInnerHTML={{
__html: `(function(e){function d(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}function b(a){this.options=d({},this.options);d(this.options,a);this._init()}b.prototype.options={wrapper:document.body,message:"yo!",layout:"growl",effect:"slide",type:"error",ttl:6E3,onClose:function(){return!1},onOpen:function(){return!1}};b.prototype._init=function(){this.ntf=document.createElement("div");this.ntf.className="ns-box ns-"+this.options.layout+" ns-effect-"+this.options.effect+" ns-type-"+this.options.type;
this.ntf.innerHTML='<div class="ns-box-inner">'+this.options.message+'</div><span class="ns-close"></span></div>';this.options.wrapper.insertBefore(this.ntf, this.options.wrapper.nextSibling);var a=this;this.dismissttl=setTimeout(function(){a.active&&a.dismiss()},this.options.ttl);this._initEvents()};b.prototype._initEvents=function(){var a=this;this.ntf.querySelector(".ns-close").addEventListener("click",function(){a.dismiss()})};b.prototype.show=function(){this.active=!0;this.ntf.classList.remove("ns-hide");
this.ntf.classList.add("ns-show");this.options.onOpen()};b.prototype.dismiss=function(){var a=this;this.active=!1;clearTimeout(this.dismissttl);this.ntf.classList.remove("ns-show");setTimeout(function(){a.ntf.classList.add("ns-hide");a.options.onClose()},25);var b=function(c){if(c.target!==a.ntf)return!1;this.removeEventListener("animationend",b);a.options.wrapper.removeChild(this)};this.ntf.addEventListener("animationend",b)};e.NotificationFx=b})(window);`
this.ntf.classList.add("ns-show");this.options.onOpen()};b.prototype.dismiss=function(){var a=this;this.active=!1;clearTimeout(this.dismissttl);this.ntf.classList.remove("ns-show");setTimeout(function(){a.ntf.classList.add("ns-hide");a.options.onClose()},25);var b=function(c){if(c.target!==a.ntf)return!1;this.removeEventListener("animationend",b);a.options.wrapper.removeChild(this)};this.ntf.addEventListener("animationend",b)};e.NotificationFx=b})(window);`,
}}
/>
</body>
Expand Down
5 changes: 1 addition & 4 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ const Home = () => {
<>
<SEO />
<Layout headerWithSocialButtons layout={layout}>
<ToggleLayoutButtons
layout={layout}
onClick={setLayout}
/>
<ToggleLayoutButtons layout={layout} onClick={setLayout} />
<GitmojiList gitmojis={gitmojis} layout={layout} />
</Layout>
</>
Expand Down
2 changes: 1 addition & 1 deletion src/styles/_includes/_vars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@ $gitmojis: (
wheelchair: #00b1fb,
white-check-mark: #77e856,
wrench: #ffc400,
zap: #40c4ff
zap: #40c4ff,
);

0 comments on commit 1db8b27

Please sign in to comment.