-
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.
bring all movies and using next image
- Loading branch information
1 parent
290ae53
commit 82b505d
Showing
11 changed files
with
768 additions
and
1,158 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 |
---|---|---|
@@ -1,45 +1,3 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es2021": true, | ||
"jest": true | ||
}, | ||
"extends": [ | ||
"next", | ||
"next/core-web-vitals", | ||
"plugin:@typescript-eslint/recommended", | ||
"prettier", | ||
"airbnb" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaFeatures": { | ||
"jsx": true | ||
}, | ||
"ecmaVersion": 12, | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"react", | ||
"@typescript-eslint" | ||
], | ||
"rules": { | ||
"react/jsx-uses-react": "off", | ||
"react/react-in-jsx-scope": "off", | ||
"react-hooks/rules-of-hooks": "error", | ||
"react-hooks/exhaustive-deps": "warn", | ||
"react/jsx-filename-extension": [1, { "extensions": [".tsx"] }], | ||
"react/jsx-props-no-spreading": "off", | ||
"react/prop-types": "off", | ||
"@typescript-eslint/explicit-module-boundary-types": "off", | ||
"import/prefer-default-export": "off", | ||
"import/extensions": [ | ||
"error", | ||
"ignorePackages", | ||
{ | ||
"ts": "never", | ||
"tsx": "never" | ||
} | ||
] | ||
} | ||
"extends": ["eslint-config-henrique/react"] | ||
} |
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 @@ | ||
16.20.0 |
This file was deleted.
Oops, something went wrong.
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,3 +1,7 @@ | ||
module.exports = { | ||
reactStrictMode: true, | ||
} | ||
|
||
images: { | ||
domains: ['s3.us-west-2.amazonaws.com'], | ||
}, | ||
}; |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,26 +1,24 @@ | ||
import Image from 'next/image'; | ||
|
||
import { base64Blur } from './utils/base64Blur'; | ||
|
||
import { ICoverProps } from './@interfaces'; | ||
|
||
export function Cover({ cover, title, loading }: ICoverProps) { | ||
return ( | ||
<div> | ||
{loading ? ( | ||
<div className="flex flex-col justify-center items-center"> | ||
<div className="text-center"> | ||
<div className="spinner-border text-blue-500" role="status"> | ||
<span className="sr-only">Loading...</span> | ||
</div> | ||
</div> | ||
<p className="text-center text-blue-500">Carregando...</p> | ||
</div> | ||
) : ( | ||
<img | ||
src={cover} | ||
alt={title} | ||
height={360} | ||
width={360} | ||
className="rounded-2xl md:mr-86" | ||
/> | ||
)} | ||
<div className="flex justify-center w-[360px] h-[240px]"> | ||
<Image | ||
className="rounded-2xl" | ||
src={cover} | ||
alt={title} | ||
height={240} | ||
width={360} | ||
layout="fixed" | ||
quality={60} | ||
priority | ||
placeholder="blur" | ||
blurDataURL={base64Blur} | ||
/> | ||
</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,22 @@ | ||
const shimmer = (w: number, h: number) => ` | ||
<svg width="${w}" height="${h}" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<defs> | ||
<linearGradient id="g"> | ||
<stop stop-color="#333" offset="20%" /> | ||
<stop stop-color="#222" offset="50%" /> | ||
<stop stop-color="#333" offset="70%" /> | ||
</linearGradient> | ||
</defs> | ||
<rect width="${w}" height="${h}" fill="#333" /> | ||
<rect id="r" width="${w}" height="${h}" fill="url(#g)" /> | ||
<animate xlink:href="#r" attributeName="x" from="-${w}" to="${w}" dur="1s" repeatCount="indefinite" /> | ||
</svg>`; | ||
|
||
const toBase64 = (str: string) => | ||
typeof window === 'undefined' | ||
? Buffer.from(str).toString('base64') | ||
: window.btoa(str); | ||
|
||
export const base64Blur = `data:image/svg+xml;base64,${toBase64( | ||
shimmer(700, 475), | ||
)}`; |
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.