diff --git a/components/Preview.tsx b/components/Preview.tsx index 1abaaea..8090744 100644 --- a/components/Preview.tsx +++ b/components/Preview.tsx @@ -13,7 +13,7 @@ import Options from '../components/Options' import Error from '../components/Error' import Info from '../components/Info' import Savings from '../components/WrapUp' -import Loading from './Loading' +import Loading from '../components/Loading' import Success from '../components/Success' import Confirm from '../components/Confirm' import * as constants from '../utils/constants' diff --git a/components/BigSearch.tsx b/components/Search.tsx similarity index 55% rename from components/BigSearch.tsx rename to components/Search.tsx index 4576df9..651ed61 100644 --- a/components/BigSearch.tsx +++ b/components/Search.tsx @@ -5,7 +5,74 @@ interface SearchBoxProps { onSearch: (query: string) => void } -const BigSearch: React.FC = ({ onSearch }) => { +export const SearchBox: React.FC = ({ onSearch }) => { + const [query, setQuery] = useState("") + + const handleInputChange = (event: React.ChangeEvent) => { + setQuery(event.target.value.toLowerCase()) + } + + const handleInputInvalid = (event: React.ChangeEvent) => { + event.target.setCustomValidity("Please enter a valid .eth name") + } + + const handleInput = (event: React.ChangeEvent) => { + event.target.setCustomValidity("") + } + + const handleFormSubmit = (event: React.FormEvent) => { + event.preventDefault() + onSearch(query) + } + + return ( +
+
+ + +
+
+ ) +} + +export const BigSearch: React.FC = ({ onSearch }) => { const [query, setQuery] = useState("") const handleInputChange = (event: React.ChangeEvent) => { @@ -88,4 +155,3 @@ const BigSearch: React.FC = ({ onSearch }) => { ); }; -export default BigSearch diff --git a/components/SearchBox.tsx b/components/SearchBox.tsx deleted file mode 100644 index 14c4b4d..0000000 --- a/components/SearchBox.tsx +++ /dev/null @@ -1,74 +0,0 @@ -import React, { useState } from "react" - -interface SearchBoxProps { - onSearch: (query: string) => void -} - -const SearchBox: React.FC = ({ onSearch }) => { - const [query, setQuery] = useState("") - - const handleInputChange = (event: React.ChangeEvent) => { - setQuery(event.target.value.toLowerCase()) - } - - const handleInputInvalid = (event: React.ChangeEvent) => { - event.target.setCustomValidity("Please enter a valid .eth name") - } - - const handleInput = (event: React.ChangeEvent) => { - event.target.setCustomValidity("") - } - - const handleFormSubmit = (event: React.FormEvent) => { - event.preventDefault() - onSearch(query) - } - - return ( -
-
- - -
-
- ) -} - -export default SearchBox diff --git a/components/Stealth.tsx b/components/Stealth.tsx index f35b7ff..b4863b1 100644 --- a/components/Stealth.tsx +++ b/components/Stealth.tsx @@ -10,7 +10,7 @@ import Help from '../components/Help' import Salt from '../components/Salt' import PayTo from '../components/PayTo' import Error from '../components/Error' -import Loading from './Loading' +import Loading from '../components/Loading' import Success from '../components/Success' import * as constants from '../utils/constants' import { KEYGEN } from '../utils/keygen' diff --git a/pages/account.tsx b/pages/account.tsx index cf8afa6..f3b0fb0 100644 --- a/pages/account.tsx +++ b/pages/account.tsx @@ -25,7 +25,7 @@ import Gateway from '../components/Gateway' import List from '../components/List' import Ticker from '../components/Ticker' import Loading from '../components/Loading' -import SearchBox from '../components/SearchBox' +import { SearchBox } from '../components/Search' import Confirm from '../components/Confirm' import Export from '../components/Export' import * as constants from '../utils/constants' diff --git a/pages/index.tsx b/pages/index.tsx index 785d183..4fc3ac7 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -18,7 +18,7 @@ import Error from '../components/Error' import List from '../components/List' import GasTicker from '../components/Ticker' import Loading from '../components/Loading' -import BigSearch from '../components/BigSearch' +import { BigSearch } from '../components/Search' import * as constants from '../utils/constants' import * as verifier from '../utils/verifier' import * as ensContent from '../utils/contenthash'