From adf23510f1e7db3e7ecef14e22e586a7069e77e0 Mon Sep 17 00:00:00 2001 From: tpruisimao Date: Mon, 1 Nov 2021 21:14:40 +0000 Subject: [PATCH] add home page search --- components/ChapterContainer.tsx | 8 + components/ChapterList/index.tsx | 76 + components/Container.tsx | 9 +- .../BookCombobox/BookCombobox.module.css | 42 + components/SearchForm/BookCombobox/index.tsx | 100 + .../ChapterInput/ChapterInput.module.css | 11 + components/SearchForm/ChapterInput/index.tsx | 72 + .../SearchForm/Dialog/MobileSearch.module.css | 39 + components/SearchForm/Dialog/index.tsx | 145 + components/SearchForm/index.tsx | 217 + data/bible-books.tsx | 2 +- package-lock.json | 283 +- package.json | 7 +- pages/index.tsx | 11 +- styles/global.css | 148 +- tailwind.config.js | 12 +- utils/index.ts | 17 + yarn.lock | 4556 +++++++++++++++++ 18 files changed, 5617 insertions(+), 138 deletions(-) create mode 100644 components/ChapterList/index.tsx create mode 100644 components/SearchForm/BookCombobox/BookCombobox.module.css create mode 100644 components/SearchForm/BookCombobox/index.tsx create mode 100644 components/SearchForm/ChapterInput/ChapterInput.module.css create mode 100644 components/SearchForm/ChapterInput/index.tsx create mode 100644 components/SearchForm/Dialog/MobileSearch.module.css create mode 100644 components/SearchForm/Dialog/index.tsx create mode 100644 components/SearchForm/index.tsx create mode 100644 utils/index.ts create mode 100644 yarn.lock diff --git a/components/ChapterContainer.tsx b/components/ChapterContainer.tsx index 9bc6592..24124b2 100644 --- a/components/ChapterContainer.tsx +++ b/components/ChapterContainer.tsx @@ -1,8 +1,10 @@ import { useTheme } from 'next-themes'; import Head from 'next/head'; +import { useRouter } from 'next/router'; import { useEffect, useState } from 'react'; export default function Container(props: any) { + const router = useRouter(); const [mounted, setMounted] = useState(false); const { resolvedTheme, setTheme } = useTheme(); @@ -37,6 +39,12 @@ export default function Container(props: any) { )}