Skip to content

Commit

Permalink
Merge pull request #155 from DeKal/add-blog-page
Browse files Browse the repository at this point in the history
Create new page blogs and move Navbar to core
  • Loading branch information
DeKal authored Jan 17, 2020
2 parents 4227258 + f0568be commit 620dd6a
Show file tree
Hide file tree
Showing 34 changed files with 754 additions and 255 deletions.
42 changes: 36 additions & 6 deletions consts/pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,42 @@ export const CERTIFICATIONS = 'Certifications'
export const PROJECTS = 'Projects'
export const CONTACTS = 'Contacts'
export const WHYME = 'Whyme'
export const BLOG = 'Blogs'

export const PAGE_LIST = [
HOME,
ABOUT,
EXPERIENCES,
PROJECTS,
CERTIFICATIONS,
CONTACTS
{
name: HOME,
url: `/#${HOME}`,
cmpName: HOME
},
{
name: ABOUT,
url: `/#${ABOUT}`,
cmpName: ABOUT
},
{
name: EXPERIENCES,
url: `/#${EXPERIENCES}`,
cmpName: EXPERIENCES
},
{
name: PROJECTS,
url: `/#${PROJECTS}`,
cmpName: PROJECTS
},
{
name: CERTIFICATIONS,
url: `/#${CERTIFICATIONS}`,
cmpName: CERTIFICATIONS
},
{
name: CONTACTS,
url: `/#${CONTACTS}`,
cmpName: CONTACTS
},
{
name: BLOG,
url: `/blogs`,
cmpName: 'blogs'
}
]
11 changes: 11 additions & 0 deletions pages/blogs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React, { Fragment } from 'react'
import Head from '~/views/blogs/components/Head'
import Navbar from '~/views/core/components/Navbar'
const Blogs = () => (
<Fragment>
<Head />
<Navbar />
</Fragment>
)

export default Blogs
2 changes: 1 addition & 1 deletion pages/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Fragment } from 'react'
import Nav from '~/views/home/components/Navbar'
import Nav from '~/views/core/components/Navbar'
import Home from '~/views/home/components/Home'
import About from '~/views/home/components/About'
import Experiences from '~/views/home/components/Experiences'
Expand Down
3 changes: 2 additions & 1 deletion public/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,6 @@
"Exp: Brand360 Desc": "As a team leader, I operate the team to develop a web for Brand 360 company inorder to broadcast their images in Viet Nam. The idea is to use Wordpress template in order to have a fast and user-friendly web/admin UI.",
"Exp: Brand360 Skill": "Technical skills: Wordpress template, HTML, CSS, JS.",
"Project: Title": "Projects",
"Project: SubTitle": "Something cool to look back!!!"
"Project: SubTitle": "Something cool to look back!!!",
"Blogs": "Blogs"
}
3 changes: 2 additions & 1 deletion public/translations/vn.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,6 @@
"Exp: Brand360 Desc": "TrΓͺn vα»‹ trΓ­ lΓ  team leader, mΓ¬nh tα»• chα»©c mα»™t nhΓ³m để xΓ’y dα»±ng trang web cho cΓ΄ng ty Brand 360 để quαΊ£ng bΓ‘ hΓ¬nh αΊ£nh của họ ở Việt Nam. Ý tưởng chung lΓ  xΓ’y dα»±ng trang web dα»±a trΓͺn Wordpress để xΓ’y dα»±ng nhanh vΓ  cΓ΄ng cαΊ₯p cho người dΓΉng mα»™t giao diện thΓ’n thiện để Δ‘iều phα»‘i trang web.",
"Exp: Brand360 Skill": "KΔ© thuαΊ­t: Wordpress template, HTML, CSS, JS.",
"Project: Title": "Dα»± Γ‘n",
"Project: SubTitle": "Mα»™t vΓ i kỉ niệm để nhΓ¬n lαΊ‘i!!!"
"Project: SubTitle": "Mα»™t vΓ i kỉ niệm để nhΓ¬n lαΊ‘i!!!",
"Blogs": "Blogs"
}
1 change: 1 addition & 0 deletions theme/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const theme = {
navContentMinHeight: '80px',
footerHeight: '50px',
navHeightWhenScrollingOnMobile: '45px',
navPosWhenHiding: '-220px',
aboutMarginTop: '-200px',
colors: {
// Color variables
Expand Down
3 changes: 3 additions & 0 deletions utils/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ export const getSelectedSection = () => {
if (location.hash.length !== 0) {
const selectedPage = location.hash.substr(1)
return selectedPage
} else if (location.pathname.length !== 0) {
return location.pathname.substr(1)
}

return INIT_SELECTED_PAGE
}

Expand Down
13 changes: 13 additions & 0 deletions views/blogs/components/Head.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react'
import NextHead from 'next/head'

const Head = () => (
<NextHead>
<title>Coding with the Devil ;)</title>
<meta charSet="utf-8" />
<meta name="description" content="Coding with the Devil ;)" />
<meta name="keywords" content="coding, blogs, diaries" />
</NextHead>
)

export default Head
12 changes: 12 additions & 0 deletions views/blogs/components/__tests__/Head.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import * as React from 'react'
import { mountWithTheme } from '~/utils/withThemeProviders'
import Head from '~/views/blogs/components/Head'

describe('Head', () => {

it('should render without throwing an error', function () {
const wrap = mountWithTheme(<Head />)
expect(wrap).toMatchSnapshot()
})

})
13 changes: 13 additions & 0 deletions views/blogs/components/__tests__/__snapshots__/Head.spec.tsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Head should render without throwing an error 1`] = `
<Head>
<Head>
<Component
handleStateChange={null}
inAmpMode={false}
reduceComponentsToState={[Function]}
/>
</Head>
</Head>
`;
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useState } from 'react'

import styled from 'styled-components/macro'
import NavHeader from '~/views/home/components/nav/NavHeader'
import NavContent from '~/views/home/components/nav/NavContent'
import NavHeader from '~/views/core/components/nav/NavHeader'
import NavContent from '~/views/core/components/nav/NavContent'
import { INIT_NAV_CONTENT_SHOW } from '~/consts/initState'

const Navbar = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import { mountWithTheme } from '~/utils/withThemeProviders'
import Navbar from '~/views/home/components/Navbar'
import Navbar from '~/views/core/components/Navbar'

describe('Navbar', () => {

Expand Down
Loading

1 comment on commit 620dd6a

@vercel
Copy link

@vercel vercel bot commented on 620dd6a Jan 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.