-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
886 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,4 @@ AWS_S3_REGION=sa-east-1 | |
AWS_S3_ACCESS_KEY_ID= | ||
AWS_S3_SECRET_ACCESS_KEY= | ||
AWS_S3_BUCKET= | ||
AWS_CLOUD_FRONT_URL= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,38 @@ | ||
// @ts-check | ||
import bundleAnalyzer from '@next/bundle-analyzer' | ||
|
||
/** | ||
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. | ||
* This is especially useful for Docker builds. | ||
*/ | ||
!process.env.SKIP_ENV_VALIDATION && (await import("./src/env/server.mjs")); | ||
!process.env.SKIP_ENV_VALIDATION && (await import('./src/env/server.mjs')) | ||
|
||
const withBundleAnalyzer = bundleAnalyzer({ | ||
enabled: process.env.ANALYZE === 'true', | ||
}) | ||
|
||
/** @type {import("next").NextConfig} */ | ||
const config = { | ||
reactStrictMode: true, | ||
swcMinify: true, | ||
i18n: { | ||
locales: ["en"], | ||
defaultLocale: "en", | ||
locales: ['en'], | ||
defaultLocale: 'en', | ||
}, | ||
images: { | ||
// Follows TailwindCSS screens breakpoints | ||
deviceSizes: [640, 768, 1024, 1280, 1536], | ||
domains: [`${process.env.AWS_CLOUD_FRONT_URL?.replace('https://', '')}`], | ||
}, | ||
experimental: { | ||
swcPlugins: [ | ||
[ | ||
'next-superjson-plugin', | ||
{ | ||
excluded: [], | ||
}, | ||
], | ||
], | ||
}, | ||
}; | ||
export default config; | ||
} | ||
export default withBundleAnalyzer(config) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
prisma/migrations/20230115132923_adds_updatedat_and_createdat/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
-- AlterTable | ||
ALTER TABLE "Deck" ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/components/deck-card-list/deck-card-list.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import Link from 'next/link' | ||
|
||
import { Image } from '~/components/image' | ||
import { routes } from '~/utils/navigation' | ||
|
||
import type { DeckCardListProps } from './deck-card-list.types' | ||
import { Error } from './error.component' | ||
import { Loading } from './loading.component' | ||
|
||
export function DeckCardList({ decks }: DeckCardListProps) { | ||
return ( | ||
<div className='flex-w grid grid-cols-1 gap-5 sm:grid-cols-2'> | ||
{decks.map((deck, idx) => ( | ||
<Link | ||
href={routes.editDeck(deck.id)} | ||
key={deck.id} | ||
className='flex flex-col overflow-hidden rounded-md border border-primary-900 bg-primary-50 shadow-md hover:bg-primary-100 lg:h-64 lg:flex-row' | ||
> | ||
<div className='relative flex aspect-square w-full lg:w-2/5'> | ||
<Image | ||
fill | ||
src={deck.image} | ||
priority={idx === 0} | ||
style={{ objectFit: 'cover' }} | ||
alt={`${deck.title} image`} | ||
sizes='(min-width: 1024px) 250px, | ||
(min-width: 640px) 50vw, | ||
100vw' | ||
/> | ||
</div> | ||
<div className='flex flex-1 flex-col p-4'> | ||
<h5 className='mb-2 text-2xl font-bold tracking-tight text-primary-900'> | ||
{deck.title} | ||
</h5> | ||
<p className='mb-3 font-normal text-primary-900'> | ||
{deck.description} | ||
</p> | ||
</div> | ||
</Link> | ||
))} | ||
</div> | ||
) | ||
} | ||
|
||
DeckCardList.Loading = Loading | ||
DeckCardList.Error = Error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import type { Deck } from '@prisma/client' | ||
|
||
export type DeckCardListProps = { | ||
decks: Array<Deck> | ||
} | ||
|
||
export type ErrorProps = { | ||
onRetryPress: () => void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Button } from '../button' | ||
import type { ErrorProps } from './deck-card-list.types' | ||
|
||
export function Error(props: ErrorProps) { | ||
const { onRetryPress } = props | ||
|
||
return ( | ||
<div className='m-auto flex max-w-xl flex-col items-center gap-10 p-10 sm:p-20'> | ||
<h2 className='text-center text-xl text-primary-900'> | ||
β Ocorreu um erro ao buscas os seus Decks. Por favor, tente novamente | ||
mais tarde! | ||
</h2> | ||
<Button onClick={onRetryPress} variant='secondary'> | ||
Tentar Novamente | ||
</Button> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { DeckCardList } from './deck-card-list.component' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export function Loading() { | ||
return ( | ||
<div className='grid w-full animate-pulse grid-cols-1 gap-5 sm:grid-cols-2'> | ||
{Array.from({ length: 6 }).map((_, index) => ( | ||
<div key={index} className='h-96 rounded-md bg-primary-200 sm:h-64' /> | ||
))} | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
export type ImageUploaderProps = { | ||
id: string | ||
error?: string | ||
defaultValue?: string | ||
} & Omit< | ||
React.DetailedHTMLProps< | ||
React.InputHTMLAttributes<HTMLInputElement>, | ||
HTMLInputElement | ||
>, | ||
'type' | 'id' | ||
'type' | 'id' | 'defaultValue' | ||
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
1543184
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
briskly β ./
briskly-emiliosheinz.vercel.app
brisklyapp.vercel.app
briskly-git-main-emiliosheinz.vercel.app