Skip to content

Commit 2ea40c4

Browse files
committed
update cv and deps
1 parent e06c372 commit 2ea40c4

21 files changed

+1319
-4433
lines changed

.babelrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"presets": [
33
"next/babel",
4-
"@zeit/next-typescript/babel"
54
],
65
"plugins": [
76
[

components/Font.tsx

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11

2-
export const headerFont = `
3-
font-family: 'Merriweather Sans', sans-serif;
4-
`;
5-
6-
export const contentFont = `
7-
font-family: 'Lato', sans-serif;
8-
`;
9-
10-
export const FontHeadLink = () => (
11-
<link
12-
rel="stylesheet"
13-
href="https://fonts.googleapis.com/css?family=Lato:100,400,700|Merriweather:400,700"
14-
/>
15-
);
2+
export const fontFamily =
3+
"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif";
4+
5+
export const headerFont = fontFamily;
6+
7+
export const contentFont = fontFamily;
8+

components/Heading.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import styled from 'styled-components';
22
import { headerFont } from './Font';
33

44
const shared = `
5-
margin: 0;
6-
${headerFont}
5+
margin: 0.5rem 0;
6+
font-family: ${headerFont};
77
`;
88

99
export const H1 = styled.h1`${shared}

components/Logo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import styled from 'styled-components';
22

33
import Image from './layout/Image';
44
import { iconSize } from './theme';
5-
import { BACKEND_URL } from '../config/client.js';
5+
import { BACKEND_URL } from '../config/client';
66

77
type LogoProps = {
88
dim?: number;

components/Navbar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { createRef, Component, RefObject } from 'react';
55
import Logo from './Logo';
66
import { zIndex } from './theme';
77
import { linkHighlight } from './mixins';
8-
import { BACKEND_URL } from '../config/client.js';
8+
import { BACKEND_URL } from '../config/client';
99

1010
export const navbarHeight = 4;
1111

@@ -89,7 +89,7 @@ class Navbar extends Component {
8989

9090
onScroll = () => {
9191
const scrollY = window.scrollY;
92-
const navHeight = this.navRef.current.offsetHeight;
92+
const navHeight = this.navRef.current?.offsetHeight;
9393

9494
const nextState = {
9595
scrollY,

components/Page.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import Head from 'next/head';
2-
import { injectGlobal } from 'styled-components';
2+
import { createGlobalStyle } from 'styled-components'
33

44
import { forMedia } from './mixins';
5-
import { FontHeadLink, contentFont } from './Font';
5+
import { contentFont } from './Font';
66

77
import Navbar from './Navbar';
88
import Footer from './Footer';
9-
import { BACKEND_URL, META_KEYWORDS, TWITTER_URL } from '../config/client.js';
9+
import { BACKEND_URL, META_KEYWORDS, TWITTER_URL } from '../config/client';
1010
import { AnalyticsHeadScript } from './Analytics';
1111

12-
injectGlobal`
12+
const GlobalStyle = createGlobalStyle`
1313
html {
1414
font-size: 15px;
1515
}
@@ -25,7 +25,7 @@ injectGlobal`
2525
}
2626
2727
body {
28-
${contentFont}
28+
font-family: ${contentFont};
2929
background-color: snow;
3030
}
3131
@@ -34,6 +34,10 @@ injectGlobal`
3434
box-sizing: border-box;
3535
}
3636
37+
li {
38+
line-height: 1.6rem;
39+
}
40+
3741
a {
3842
color: currentColor;
3943
}
@@ -55,7 +59,6 @@ const Page: React.SFC<PageProps> = ({ title, children }) => (
5559
<title>{title}</title>
5660
<meta name="keywords" content={META_KEYWORDS} />
5761
<meta name="description" content="Javier Carrillo Milla. Freelance Software Engineer" />
58-
<FontHeadLink />
5962

6063
<meta name="theme-color" content="#000" />
6164
<link rel="apple-touch-icon" href={logo} />
@@ -72,6 +75,8 @@ const Page: React.SFC<PageProps> = ({ title, children }) => (
7275
<AnalyticsHeadScript />
7376
</Head>
7477

78+
<GlobalStyle />
79+
7580
<Navbar />
7681

7782
{children}

components/Text.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const Text: React.SFC = ({ children }) => (
66
{`
77
margin: 1rem auto;
88
font-size: 1rem;
9+
line-height: 1.6;
910
white-space: pre-line;
1011
line-height: 1.75rem;
1112
margin-bottom: 0;

components/button/Button.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ const Button = styled<ButtonProps, 'button'>('button')`
2828
2929
${({ variation = 'fullWidth' }) => styles[variation]}
3030
31-
border: 2px solid currentColor;
31+
border: 1px solid currentColor;
32+
border-radius: 4px;
3233
3334
color: currentColor;
3435
background-color: transparent;

components/button/DownloadResume.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Button from './Button';
2-
import resume from '@stringparser/cv';
2+
import resume from '@stringparser/cv/src/config';
33

44
const DownloadResume: React.SFC = ({ children }) => (
55
<a href={resume.pdf}>

components/button/EmailMeButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Link from 'next/link';
22

33
import Button from './Button';
4-
import { EMAIL, BACKEND_URL } from '../../config/client.js';
4+
import { EMAIL, BACKEND_URL } from '../../config/client';
55

66
const onMailto = (href: string) => () => window.location.assign(href);
77

components/section/Section.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,9 @@ export type SectionProps = {
4040
};
4141

4242
const Section = styled<SectionProps, 'section'>('section')`
43-
${boxShadow()}
4443
${align('v-center')}
4544
${forMedia('phone', 'padding: 2rem;')}
46-
${forMedia('tablet', 'padding: 3rem;')}
45+
${forMedia('tablet', 'padding: 2rem;')}
4746
${({ variation }) => sectionTypes[variation || 'secondary']}
4847
4948
${({ mixins }) => composeMixins(mixins)}

config/client.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

config/client.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
import {technologies} from '@stringparser/cv/src/config';
3+
4+
export const PHONE = '004917630139466';
5+
export const EMAIL = '[email protected]';
6+
export const GITHUB_URL = 'https://github.com/stringparser';
7+
export const TWITTER_URL = 'https://twitter.com/stringparser';
8+
export const BACKEND_URL = process.env.NODE_ENV === 'production'
9+
? 'https://stringparser.github.io'
10+
: ''
11+
;
12+
export const LINKEDIN_URL = 'https://www.linkedin.com/in/stringparser';
13+
export const META_KEYWORDS = ['software', 'engineer'].concat(...technologies).join(', ').toLowerCase();

next-env.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.

next.config.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
const path = require('path');
2-
const withTypescript = require('@zeit/next-typescript');
3-
4-
const { BACKEND_URL } = require('./config/client');
5-
6-
exports = module.exports = withTypescript({
7-
assetPrefix: BACKEND_URL
8-
});
1+
exports = module.exports = {
2+
assetPrefix: process.env.NODE_ENV === 'production'
3+
? 'https://stringparser.github.io'
4+
: ''
5+
};

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@
1515
"deploy": "yarn export && git push origin `git subtree split --prefix=docs`:master --force"
1616
},
1717
"devDependencies": {
18+
"@babel/core": "^7.17.5",
1819
"@stringparser/cv": "https://github.com/stringparser/cv.git",
1920
"@types/next": "^6.0.3",
2021
"@types/react": "^16.4.4",
2122
"@types/react-dom": "^16.0.6",
22-
"@zeit/next-typescript": "^1.1.0",
2323
"babel-plugin-styled-components": "^1.5.1",
24-
"next": "^6.1.0",
25-
"react": "^16.4.1",
26-
"react-dom": "^16.4.1",
27-
"styled-components": "^3.3.3",
24+
"next": "^12.1.0",
25+
"react": "^17.0.2",
26+
"react-dom": "^17.0.2",
27+
"styled-components": "^5.2.3",
2828
"tslint": "^5.10.0",
2929
"tslint-config-airbnb": "^5.9.2",
3030
"tslint-react": "^3.6.0",
31-
"typescript": "^2.9.2"
31+
"typescript": "^4.6.2"
3232
},
3333
"dependencies": {
3434
"@types/segment-analytics": "^0.0.28",

pages/_document.tsx

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,44 @@
11

2-
import Document, { Head, Main, NextScript } from 'next/document';
2+
import Document, { Html, Head, Main, NextScript } from 'next/document';
33
import { ServerStyleSheet } from 'styled-components';
44

55
export default class MyDocument extends Document {
6-
static getInitialProps({ renderPage }) {
7-
const sheet = new ServerStyleSheet();
8-
const page = renderPage(App => props => sheet.collectStyles(<App {...props} />));
9-
const styleTags = sheet.getStyleElement();
10-
return { ...page, styleTags };
6+
static async getInitialProps(ctx) {
7+
const sheet = new ServerStyleSheet()
8+
const originalRenderPage = ctx.renderPage
9+
10+
try {
11+
ctx.renderPage = () =>
12+
originalRenderPage({
13+
enhanceApp: (App) => (props) =>
14+
sheet.collectStyles(<App {...props} />),
15+
})
16+
17+
const initialProps = await Document.getInitialProps(ctx)
18+
return {
19+
...initialProps,
20+
styles: (
21+
<>
22+
{initialProps.styles}
23+
{sheet.getStyleElement()}
24+
</>
25+
),
26+
}
27+
} finally {
28+
sheet.seal()
29+
}
1130
}
1231

1332
render() {
1433
return (
15-
<html lang="en">
34+
<Html lang="en">
1635
<Head>
17-
{this.props.styleTags}
1836
</Head>
1937
<body>
2038
<Main />
2139
<NextScript />
2240
</body>
23-
</html>
41+
</Html>
2442
);
2543
}
2644
}

0 commit comments

Comments
 (0)