npm install
was broken because the dependencynode-sass
. changing to thesass
LTS fixed it.create-react-app
is no longer recommended by the React team. for the next SPA we build, we can consider usingVite
instead. this will provide better compatibility with commonly-used libraries and might avoid future bugs.- the implementation doesn't satisfy the user stories, I was unable to search for movies or see a list of movies in the home page. currently i see only an empty state.
- the fetch url is incorrect, this can be improved by using a single source of truth (from constants.js, for example) and testing your code before opening a pull request.
- there is no linter configured, which results in irregular code styles in the codebase (e.g.: both single and double quotes, uneven tab spaces, lack of semi-colons, etc...). it would also prevent other issues in your code, such as unused variables, unused functions, and empty functions.
- there is room
- https://lukeberrypi.vercel.app
- @lukeberrypi
- https://youtube.com/lukeberrypi
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
/* | |
disable backdrop/background scroll when there is a modal/dialog open | |
this depends on having the open attribute on the dialog itself | |
more: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog | |
*/ | |
dialog::backdrop { overflow: hidden; } body:has(dialog[open]) { overflow: hidden; pointer-events: none; } dialog[open] { pointer-events: auto; } |
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
\documentclass[a4paper,10pt]{article} | |
\usepackage[margin=0.5in,nofoot]{geometry} | |
\usepackage{fontawesome5} | |
\usepackage{hyperref} | |
\usepackage{titlesec} | |
\usepackage{xcolor} | |
\hypersetup{ | |
colorlinks=true, | |
linkcolor=blue, |
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
import { useEffect, useState } from 'react'; | |
export default function useDebounce(value: string, delay: number) { | |
const [debouncedValue, setDebouncedValue] = useState(value); | |
useEffect(() => { | |
const handler = setTimeout(() => { | |
setDebouncedValue(value); | |
}, delay); |
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
{ | |
"workbench.colorTheme": "Vesper", | |
"workbench.iconTheme": "chalice-icon-theme", | |
"editor.fontSize": 15, | |
"editor.fontWeight": "300", | |
"terminal.explorerKind": "external", | |
"terminal.integrated.fontSize": 20, | |
"terminal.integrated.fontWeight": "300", | |
"editor.glyphMargin": false, | |
"editor.fontFamily": "JetBrains Mono", |
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
const createRange = (len, start = 1) => | |
Array(len) | |
.fill(0) | |
.map((_, i) => i + start); |
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
javascript:(function(){ | |
allowCopyAndPaste = function(e){ | |
e.stopImmediatePropagation(); | |
return true; | |
}; | |
document.addEventListener('copy', allowCopyAndPaste, true); | |
document.addEventListener('paste', allowCopyAndPaste, true); | |
document.addEventListener('onpaste', allowCopyAndPaste, true); | |
})(); |
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
export const isTouchable = () => { | |
const userAgent = window.navigator.userAgent; | |
return ( | |
!!userAgent && userAgent.match(/(iPad)|(iPhone)|(iPod)|(android)|(webOS)/i) | |
); | |
}; | |
export const isIphone = () => { | |
return ( | |
!!navigator.platform && |
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
// Zed settings | |
// | |
// For information on how to configure Zed, see the Zed | |
// documentation: https://zed.dev/docs/configuring-zed | |
// | |
// To see all of Zed's default settings without changing your | |
// custom settings, run the `open default settings` command | |
// from the command palette or from `Zed` application menu. | |
{ | |
"features": { |
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
{ | |
"files.autoSave": "onFocusChange", | |
"editor.formatOnSave": true, | |
"workbench.colorTheme": "Gruvbox Dark Medium", | |
"workbench.iconTheme": "gruvbox-material-icon-theme", | |
"editor.fontSize": 16, | |
"terminal.integrated.fontSize": 16, | |
"explorer.confirmDragAndDrop": false, | |
"editor.minimap.enabled": false, | |
"breadcrumbs.enabled": false, |
NewerOlder