Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
Add some images
Browse files Browse the repository at this point in the history
  • Loading branch information
anxolin committed Nov 16, 2021
1 parent b6a6d81 commit 79218c6
Show file tree
Hide file tree
Showing 21 changed files with 153 additions and 100 deletions.
23 changes: 23 additions & 0 deletions components/Layout/Footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import Link from 'next/link'

import { useRouter } from 'next/router'
import cn from 'classnames'

export default function Footer() {
const { locale, asPath } = useRouter()

return (
<footer>
Languages:
<Link href={asPath} locale="en">
<a className={cn({
active: locale === "en"
})}>English</a>
</Link> | <Link href={asPath} locale="es">
<a className={cn({
active: locale === "es"
})}>Español</a>
</Link>
</footer>
)
}
55 changes: 55 additions & 0 deletions components/Layout/Header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import Image from 'next/image'
import Link from 'next/link'

import utilStyles from '../../styles/utils.module.scss'

import { LayoutProps, SITE_TITLE } from '.'

export default function Header(props: LayoutProps) {
const { home = false } = props

return (
<header className="header">
{home ? (
<>
<Image
priority
src="/favicon.png"
className={utilStyles.borderCircle}
height={144}
width={144}
alt={SITE_TITLE}
/>
<h1 className={utilStyles.heading2Xl}>{SITE_TITLE}</h1>
</>
) : (
<>
<Link href="/">
<a>
<Image
priority
src="/favicon.png"
className={utilStyles.borderCircle}
height={108}
width={108}
alt={SITE_TITLE}
/>
</a>
</Link>
<h2 className={utilStyles.headingLg}>
<Link href="/">
<a className={utilStyles.colorInherit}>{SITE_TITLE}</a>
</Link>
</h2>
</>
)}
<style jsx>{`
.header {
display: flex;
flex-direction: column;
align-items: center;
}
`}</style>
</header>
)
}
6 changes: 0 additions & 6 deletions components/Layout/Layout.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ export default css`
margin: 3rem auto 6rem;
}
.header {
display: flex;
flex-direction: column;
align-items: center;
}
.backToHome {
margin: 3rem 0 0;
}
Expand Down
105 changes: 33 additions & 72 deletions components/Layout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,81 +1,52 @@
import Head from 'next/head'
import Image from 'next/image'
import Link from 'next/link'

import styles from './Layout.style'
import utilStyles from '../../styles/utils.module.scss'

import { PropsWithChildren } from 'react'
import { useRouter } from 'next/router'
import cn from 'classnames'

import { Trans } from '@lingui/macro'
import Header from './Header'
import Footer from './Footer'

const name = 'CoW Protocol'
export const siteTitle = 'CoW Protocol'
export const SITE_TITLE = 'CoW Protocol'
export const URL_PRODUCTION = "https://cowswap.exchange"

type LayoutProps = PropsWithChildren<{
export type LayoutProps = PropsWithChildren<{
home?: boolean
}>

export default function Layout(props: LayoutProps) {
const { children, home = false } = props
const router = useRouter()
const { locale } = router

return (
<>
<div className="container">
<Head>
<link rel="icon" href="/favicon.ico" />
<meta
name="description"
content="Learn how to build a personal website using Next.js"
/>
<Head>
<meta
name="description"
content="Ethereum's MetaDEX Aggregator that allows to trade with MEV protection while using ETH-less orders that are settled p2p among users or the best AMM."
/>
<meta name="theme-color" media="(prefers-color-scheme: light)" content="white" />
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#163861" />

<link rel="shortcut icon" type="image/png" href="/favicon.png" />
<link rel="apple-touch-icon" sizes="192x192" href="/images/logo-square-192.png" />
<link rel="apple-touch-icon" sizes="512x512" href="/images/logo-square-512.png" />

<meta property="og:type" content="website" />
<meta property="og:title" content={SITE_TITLE} />

<meta
property="og:image"
content={`https://og-image.vercel.app/${encodeURI(
siteTitle
)}.png?theme=light&md=0&fontSize=75px&images=https%3A%2F%2Fassets.vercel.com%2Fimage%2Fupload%2Ffront%2Fassets%2Fdesign%2Fnextjs-black-logo.svg`}
/>
<meta name="og:title" content={siteTitle} />
<meta name="twitter:card" content="summary_large_image" />
</Head>
<header className="header">
{home ? (
<>
<Image
priority
src="/images/profile.jpg"
className={utilStyles.borderCircle}
height={144}
width={144}
alt={name}
/>
<h1 className={utilStyles.heading2Xl}>{name}</h1>
</>
) : (
<>
<Link href="/">
<a>
<Image
priority
src="/images/profile.jpg"
className={utilStyles.borderCircle}
height={108}
width={108}
alt={name}
/>
</a>
</Link>
<h2 className={utilStyles.headingLg}>
<Link href="/">
<a className={utilStyles.colorInherit}>{name}</a>
</Link>
</h2>
</>
)}
</header>
<meta property="og:description" content="Ethereums MetaDEX Aggregator built by Gnosis. It allows users to trade tokens with MEV protection while using ETH-less orders that are settled p2p among users or into the best on-chain liquidity pool." />
<meta property="og:image" content={URL_PRODUCTION + "/images/og-meta-cowswap.png"} />
<meta property="og:url" content={URL_PRODUCTION} /> {/* TODO: Add URL */}

<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@MEVprotection" />
<meta name="twitter:title" content={SITE_TITLE} />
<meta name="twitter:image" content={URL_PRODUCTION + "/images/og-meta-cowswap.png"} />
</Head>
<div className="container">
<Header home={home} />
<main>{children}</main>
{!home && (
<div className="backToHome">
Expand All @@ -85,18 +56,8 @@ export default function Layout(props: LayoutProps) {
</div>
)}
</div>
<footer>
Languages:
<Link href={router.asPath} locale="en">
<a className={cn({
active: locale === "en"
})}>English</a>
</Link> | <Link href={router.asPath} locale="es">
<a className={cn({
active: locale === "es"
})}>Español</a>
</Link>
</footer>
<Footer />

<style jsx>{styles}</style>
</>
)
Expand Down
6 changes: 3 additions & 3 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Link from 'next/link'
import { GetStaticProps } from 'next'

import { getSortedPostsData } from '../lib/posts'
import Layout, { siteTitle } from '../components/Layout'
import Layout, { SITE_TITLE } from '../components/Layout'
import Date from '../components/Date'

import utilStyles from '../styles/utils.module.scss'
Expand All @@ -20,11 +20,11 @@ export default function Home({ allPostsData }) {
return (
<Layout home>
<Head>
<title>{siteTitle}</title>
<title>{SITE_TITLE}</title>
</Head>
<section className={utilStyles.headingMd}>
{/* https://blog.logrocket.com/complete-guide-internationalization-nextjs/ */}
<p><Trans>Hi there, I'm reviewing how easy it is to develop for NEXT.js</Trans></p>
<p><Trans>MetaDEX Aggregator Exchange with MEV Protection</Trans></p>

</section>

Expand Down
2 changes: 1 addition & 1 deletion posts/ssg-ssr__es.md → posts/become-solver.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 'Cuando usar Static Generation vs Server Side Rendering'
title: 'How to become a solver for CoW protocol'
date: '2020-01-02'
---

Expand Down
2 changes: 1 addition & 1 deletion posts/ssg-ssr.md → posts/become-solver__es.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 'When to Use Static Generation v.s. Server-side Rendering'
title: 'Como ser un solver para CoW protocol'
date: '2020-01-02'
---

Expand Down
2 changes: 1 addition & 1 deletion posts/pre-rendering.md → posts/token-launch.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 'Two Forms of Pre-rendering'
title: 'CoW Token launch, learn all about it!'
date: '2020-01-01'
---

Expand Down
Binary file removed public/favicon.ico
Binary file not shown.
Binary file added public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/logo-blue-bg-256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/logo-square-192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/logo-square-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/og-meta-cowswap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/images/profile.jpg
Binary file not shown.
2 changes: 1 addition & 1 deletion translations/locales/en/messages.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions translations/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@ msgstr ""
"Language-Team: \n"
"Plural-Forms: \n"

#: components/Layout.tsx:82
#: components/Layout/index.tsx:50
msgid "Back to home"
msgstr "Back to home"

#: pages/index.tsx:31
#: pages/index.tsx:33
msgid "Blog"
msgstr "Blog"

#: pages/index.tsx:25
msgid "Hi there, I'm reviewing how easy it is to develop for NEXT.js"
msgstr "Hi there, I'm reviewing how easy it is to develop for NEXT.js"
#: pages/index.tsx:27
msgid "MetaDEX Aggregator Exchange with MEV Protection"
msgstr "MetaDEX Aggregator Exchange with MEV Protection"

#: pages/index.tsx:35
msgid "Posts are not internationalized yet. This is just a PoC"
msgstr "Posts are not internationalized yet. This is just a PoC"
2 changes: 1 addition & 1 deletion translations/locales/es/messages.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions translations/locales/es/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@ msgstr ""
"Language-Team: \n"
"Plural-Forms: \n"

#: components/Layout.tsx:82
#: components/Layout/index.tsx:50
msgid "Back to home"
msgstr "Volver"

#: pages/index.tsx:31
#: pages/index.tsx:33
msgid "Blog"
msgstr "Blog"

#: pages/index.tsx:25
msgid "Hi there, I'm reviewing how easy it is to develop for NEXT.js"
msgstr "Hola! Estoy revisando lo facil que es desarrollar en NEXT.js"
#: pages/index.tsx:27
msgid "MetaDEX Aggregator Exchange with MEV Protection"
msgstr "MetaDEX Aggregator Exchange con protección contra MEV"

#: pages/index.tsx:35
msgid "Posts are not internationalized yet. This is just a PoC"
msgstr ""
2 changes: 1 addition & 1 deletion translations/locales/pseudo/messages.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 15 additions & 3 deletions translations/locales/pseudo/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,28 @@ msgstr ""
"Language-Team: \n"
"Plural-Forms: \n"

#: components/Layout.tsx:82
#: components/Layout/index.tsx:50
msgid "Back to home"
msgstr ""

#: pages/index.tsx:31
#: pages/index.tsx:33
msgid "Blog"
msgstr ""

#: pages/index.tsx:27
#~ msgid "DEFI Liquidity Protocol with MEV Protection"
#~ msgstr ""

#: pages/index.tsx:25
msgid "Hi there, I'm reviewing how easy it is to develop for NEXT.js"
#~ msgid "Hi there, I'm reviewing how easy it is to develop for NEXT.js"
#~ msgstr ""

#: pages/index.tsx:27
msgid "MetaDEX Aggregator Exchange with MEV Protection"
msgstr ""

#: pages/index.tsx:35
msgid "Posts are not internationalized yet. This is just a PoC"
msgstr ""

#: pages/index.tsx:47
Expand Down

0 comments on commit 79218c6

Please sign in to comment.