Skip to content

Commit

Permalink
Merge pull request #77 from tonymtz/next
Browse files Browse the repository at this point in the history
NEXT Tomatoro version
  • Loading branch information
tonymtz authored Apr 29, 2024
2 parents 9cc2890 + f472c6c commit 7591f77
Show file tree
Hide file tree
Showing 31 changed files with 2,687 additions and 2,006 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
NEXT_PUBLIC_POSTHOG_KEY=${{ vars.NEXT_PUBLIC_POSTHOG_KEY }}
NEXT_PUBLIC_POSTHOG_HOST=${{ vars.NEXT_PUBLIC_POSTHOG_HOST }}
NEXT_PUBLIC_SENTRY_DSN=${{ vars.NEXT_PUBLIC_SENTRY_DSN }}
NEXT_PUBLIC_CMS_API_KEY=${{ secrets.NEXT_PUBLIC_CMS_API_KEY }}
SENTRY_DSN=${{ vars.SENTRY_DSN }}
# Deploy to CapRover
Expand Down
115 changes: 44 additions & 71 deletions @types/types.cms.d.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
type Locale = 'en' | 'es'

type Blog = {
id: number
attributes: {
title: string
content: string
locale: string
publishedAt: string
createdAt: string
updatedAt: string
slug: string
}
}

type Category = {
id: number
attributes: {
Expand All @@ -25,19 +12,25 @@ type Category = {

type Seo = {
id: number
attributes: {
title: string
description: string
keywords: string
createdAt: string
updatedAt: string
locale: Locale
image: {
data: Image | null
}
metaTitle: string
metaDescription: string
keywords: string
metaRobots: string
structuredData: string
metaViewport: string
canonicalURL: string
metaImage: {
data: Image | null
}
}

type Format = {
url: string
width: number
height: number
mime: number
}

type Image = {
id: number
attributes: {
Expand All @@ -48,67 +41,31 @@ type Image = {
height: number
url: string
formats: {
thumbnail?: {
url: string
width: number
height: number
},
small?: {
url: string
width: number
height: number
}
medium?: {
url: string
width: number
height: number
}
large?: {
url: string
width: number
height: number
}
thumbnail?: Format
small?: Format
medium?: Format
large?: Format
}
}
}

type StaticPage = {
id: number
attributes: {
title: string
content: string
excerpt: string
keywords: string
thumbnail?: {
data: Image | null
}
locale: string
createdAt: string
updatedAt: string
}
}

type Post = {
id: number
attributes: {
title: string
slug: string
content: string
excerpt: string
keywords: string
category: {
data: Category | null
}
hero?: {
createdAt: string
updatedAt: string
publishedAt: string
locale: Locale
hero: {
data: Image | null
}
thumbnail?: {
data: Image | null
seo: Seo | null
category: {
data: Category | null
}
locale: string
publishedAt: string
createdAt: string
updatedAt: string
}
}

Expand Down Expand Up @@ -137,3 +94,19 @@ type Banner = {
updatedAt: string
}
}

type Error404Page = {
id: string
attributes: {
title: string
content: string
locale: Locale
publishedAt: string
createdAt: string
updatedAt: string
hero: {
data: Image | null
}
seo: Seo | null
}
}
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ENV NEXT_TELEMETRY_DISABLED 1
ARG NEXT_PUBLIC_POSTHOG_KEY=$NEXT_PUBLIC_POSTHOG_KEY
ARG NEXT_PUBLIC_POSTHOG_HOST=$NEXT_PUBLIC_POSTHOG_HOST
ARG NEXT_PUBLIC_SENTRY_DSN=$NEXT_PUBLIC_SENTRY_DSN
ARG NEXT_PUBLIC_CMS_API_KEY=$NEXT_PUBLIC_CMS_API_KEY
ARG SENTRY_DSN=$SENTRY_DSN

RUN npm run build
Expand All @@ -26,6 +27,7 @@ ENV NEXT_TELEMETRY_DISABLED 1
ARG NEXT_PUBLIC_POSTHOG_KEY=$NEXT_PUBLIC_POSTHOG_KEY
ARG NEXT_PUBLIC_POSTHOG_HOST=$NEXT_PUBLIC_POSTHOG_HOST
ARG NEXT_PUBLIC_SENTRY_DSN=$NEXT_PUBLIC_SENTRY_DSN
ARG NEXT_PUBLIC_CMS_API_KEY=$NEXT_PUBLIC_CMS_API_KEY
ARG SENTRY_DSN=$SENTRY_DSN

RUN addgroup --system --gid 1001 nodejs
Expand Down
28 changes: 0 additions & 28 deletions components/molecules/blogs-list/blogs-list.component.tsx

This file was deleted.

16 changes: 0 additions & 16 deletions components/molecules/blogs-list/blogs-list.styles.tsx

This file was deleted.

1 change: 0 additions & 1 deletion components/molecules/blogs-list/index.ts

This file was deleted.

42 changes: 40 additions & 2 deletions components/organisms/footer/footer.component.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,56 @@
import Link from 'next/link'
import { useRouter } from 'next/router'
import useTranslation from 'next-translate/useTranslation'
import React, { FC } from 'react'
import React, { FC, useMemo } from 'react'
import { Flex, Heading, NavLink, Text } from 'theme-ui'

import { footerData } from './footer.config'
import { LINKS, PAGES } from '~/utils/config'

import { Container, section, Section } from './footer.styles'
import { FooterLink } from './footer.types'

interface Props {
version?: string
}

export const Footer: FC<Props> = ({ version }) => {
const { locale = 'en' } = useRouter()
const { t } = useTranslation('common')

const footerData = useMemo(() => {
// @ts-ignore
const pagesForLocale = PAGES[locale]

const siteItems: FooterLink[] = [
{ key: 'news', href: LINKS.NEWS },
{ key: 'terms', href: pagesForLocale.TERMS },
{ key: 'privacy', href: pagesForLocale.PRIVACY },
{ key: 'github', href: LINKS.GITHUB },
]

const supportItems: FooterLink[] = [
{ key: 'faq', href: pagesForLocale.FAQ },
{ key: 'status', href: LINKS.STATUS },
{ key: 'contact', href: pagesForLocale.CONTACT },
]

const toolItems: FooterLink[] = [
{ key: 'tomatoro', href: LINKS.TOMATORO },
{ key: 'mitrabajo', href: LINKS.MITRABAJO },
{ key: 'dolar', href: LINKS.DOLAR },
{ key: 'gatolinero', href: LINKS.GATOLINERO },
]

return {
links: [
{ key: 'site', items: siteItems },
{ key: 'support', items: supportItems },
{ key: 'moreTools', items: toolItems },
],
currentYear: new Date().getFullYear(),
}
}, [locale])

return (
<Container as="footer">
<Flex sx={ section }>
Expand Down
35 changes: 0 additions & 35 deletions components/organisms/footer/footer.config.ts

This file was deleted.

4 changes: 4 additions & 0 deletions components/organisms/footer/footer.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface FooterLink {
key: string
href: string
}
Loading

0 comments on commit 7591f77

Please sign in to comment.