Skip to content

Commit

Permalink
Add YouTube Channel Link sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
willianjusten committed Apr 23, 2020
1 parent f5682dc commit cb8ec91
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"trailingComma": "none",
"tabWidth": 2,
"semi": false,
"singleQuote": true
"singleQuote": true,
"arrowParens": "avoid"
}
13 changes: 13 additions & 0 deletions src/components/MenuBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, { useState, useEffect } from 'react'
import { Home } from '@styled-icons/boxicons-solid/Home'
import { SearchAlt2 as Search } from '@styled-icons/boxicons-regular/SearchAlt2'
import { UpArrowAlt as Arrow } from '@styled-icons/boxicons-regular/UpArrowAlt'
import { Youtube } from '@styled-icons/boxicons-logos/Youtube'
import { LightBulb as Light } from '@styled-icons/entypo/LightBulb'
import { GraduationCap } from '@styled-icons/fa-solid/GraduationCap'
import { ThList } from '@styled-icons/typicons/ThList'
Expand Down Expand Up @@ -73,6 +74,18 @@ const MenuBar = () => {
<S.MenuBarNotification />
</S.MenuBarItem>
</S.MenuBarLink>
<S.MenuBarExternalLink
title="YouTube Videos"
href="https://www.youtube.com/WillianJustenCursos/"
target="_blank"
rel="noopener noreferrer"
onClick={() => GA.youTubeClickTrack()}
>
<S.MenuBarItem>
<Youtube />
<S.MenuBarNotification />
</S.MenuBarItem>
</S.MenuBarExternalLink>
</S.MenuBarGroup>

<S.MenuBarGroup>
Expand Down
4 changes: 4 additions & 0 deletions src/components/MenuBar/styled.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ export const MenuBarLink = styled(AniLink)`
}
`

export const MenuBarExternalLink = styled.a`
display: block;
`

export const MenuBarItem = styled.span`
color: var(--texts);
cursor: pointer;
Expand Down
8 changes: 8 additions & 0 deletions src/components/MenuBar/trackers.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,11 @@ export const topClickTrack = () => {
label: `Top na Menu Bar`
})
}

export const youTubeClickTrack = () => {
ReactGA.event({
category: 'youtube',
action: 'click',
label: 'Link YouTube na Menu Bar'
})
}
2 changes: 1 addition & 1 deletion src/components/Post/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Post.propTypes = {
slug: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
date: PropTypes.string.isRequired,
timeToRead: PropTypes.string,
timeToRead: PropTypes.number,
description: PropTypes.string.isRequired,
main_class: PropTypes.string,
disableCard: PropTypes.bool
Expand Down

0 comments on commit cb8ec91

Please sign in to comment.