Skip to content

Commit

Permalink
[#10] searchBar setting
Browse files Browse the repository at this point in the history
  • Loading branch information
hanseulhee committed Aug 21, 2022
1 parent a252e5c commit d2295ee
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/components/Nav/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Category from "components/common/Category/TopLink";
import SearchBar from "components/Nav/SearchBar";
import Link from "next/link";

function Nav() {
function Nav({ searchField, setSearchField }) {
return (
<div css={wrapper}>
<div css={inWrapper}>
Expand All @@ -12,7 +12,7 @@ function Nav() {
<h1 css={logo}>온수냠냠냠</h1>
</a>
</Link>
<SearchBar />
<SearchBar searchField={searchField} setSearchField={setSearchField} />
</div>
<Category />
</div>
Expand All @@ -29,7 +29,7 @@ const wrapper = css`
background-color: white;
z-index: 30;
`;
const inWrapper = (theme: Theme) => css`
const inWrapper = css`
display: flex;
flex-direction: row;
align-items: center;
Expand Down
6 changes: 4 additions & 2 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { AppProps } from "next/app";
import Head from "next/head";
import { NextUIProvider } from "@nextui-org/react";
import { useState } from "react";
import { ThemeProvider } from "@emotion/react";
import Theme from "styles/Theme";
import GlobalStyle from "styles/GlobalStyle";
Expand All @@ -17,6 +18,7 @@ declare global {

function MyApp({ Component, pageProps }: AppProps) {
const isWeb = useMediaQuery(769);
const [searchField, setSearchField] = useState("");

return (
<ThemeProvider theme={Theme}>
Expand All @@ -27,8 +29,8 @@ function MyApp({ Component, pageProps }: AppProps) {
<GlobalStyle />
{isWeb ? <WebWarning /> : ""}
<NextUIProvider>
<Nav />
<Component {...pageProps} />
<Nav searchField={searchField} setSearchField={setSearchField} />
<Component {...pageProps} searchField={searchField} />
<BottomLink />
</NextUIProvider>
</ThemeProvider>
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"types": ["@emotion/react/types/css-prop"]
"types": ["@emotion/react/types/css-prop"],
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}
}

0 comments on commit d2295ee

Please sign in to comment.