diff --git a/components/modal.tsx b/components/modal.tsx index 98a5d2f..b19cb11 100644 --- a/components/modal.tsx +++ b/components/modal.tsx @@ -60,7 +60,7 @@ const Modal = forwardRef(({modalOpen, toggleModal, c }; useEffect(() => { - fetch('https://api.quotable.io/random').then( res => res.json() ).then( quote => setRandomQuote(`${quote.content} — ${quote.author}`)); + !card.flavor_text ? fetch('https://api.quotable.io/random').then( res => res.json() ).then( quote => setRandomQuote(`${quote.content} — ${quote.author}`)) : null; if( (ref as MutableRefObject).current ) { (ref as MutableRefObject).current.scrollTo(0, 0); } diff --git a/pages/index.tsx b/pages/index.tsx index 2e6f209..93249e6 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -112,7 +112,7 @@ export default function Home(props) { setModalOpen(true); document.body.classList.toggle('prevent-scroll'); }} - className="cursor-pointer hover:scale-110 transition-transform duration-150 ease-in-out w-full sm:w-1/2 md:w-1/3 lg:w-1/4 p-2" + className="cursor-pointer hover:scale-110 transition-transform duration-150 ease-in-out w-1/2 md:w-1/3 lg:w-1/4 p-2" key={card.id} alt={`${card.name} Card`} src={card.image_uris?.png || "https://via.placeholder.com/150" } width={100} height={100} /> ) diff --git a/tsconfig.json b/tsconfig.json index f6b3767..3b6e2da 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,11 @@ { "compilerOptions": { "target": "es5", - "lib": ["dom", "dom.iterable", "esnext"], + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], "allowJs": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, @@ -12,8 +16,15 @@ "resolveJsonModule": true, "isolatedModules": true, "jsx": "preserve", - "incremental": true + "incremental": true, + "strict": false }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], - "exclude": ["node_modules"] + "include": [ + "next-env.d.ts", + "**/*.ts", + "**/*.tsx" + ], + "exclude": [ + "node_modules" + ] }