diff --git a/samples/musicfestival-frontend-react/package.json b/samples/musicfestival-frontend-react/package.json index 047af9a..f5cf8f9 100644 --- a/samples/musicfestival-frontend-react/package.json +++ b/samples/musicfestival-frontend-react/package.json @@ -9,7 +9,6 @@ "@graphql-codegen/typescript": "^2.7.3", "@graphql-codegen/typescript-operations": "^2.5.3", "@graphql-codegen/typescript-react-query": "^4.0.1", - "@mui/material": "^5.13.3", "@tanstack/react-query": "^4.6.0", "@testing-library/jest-dom": "^5.14.1", "@testing-library/react": "^13.0.0", diff --git a/samples/musicfestival-frontend-react/src/App.css b/samples/musicfestival-frontend-react/src/App.css index fcbabbc..08e241e 100644 --- a/samples/musicfestival-frontend-react/src/App.css +++ b/samples/musicfestival-frontend-react/src/App.css @@ -4089,14 +4089,18 @@ input.search-input::placeholder { color: #41FFF5; } -.autocomplete-block{ +.autocomplete{ position: relative; - bottom: 2.1em; - left: 1em; +} + +.autocomplete-block{ + position: absolute; background-color: #fff; height: auto; color: #000; min-width: 9em; + top: 40px; + right: 26px; } .autocomplete-block div{ diff --git a/samples/musicfestival-frontend-react/src/components/SearchButton.tsx b/samples/musicfestival-frontend-react/src/components/SearchButton.tsx index 40cf970..ac318a5 100644 --- a/samples/musicfestival-frontend-react/src/components/SearchButton.tsx +++ b/samples/musicfestival-frontend-react/src/components/SearchButton.tsx @@ -1,4 +1,3 @@ -import { Autocomplete, TextField } from "@mui/material"; import { useState } from "react"; import { useSearchParams } from "react-router-dom"; import { ArtistAutocompleteQuery, useArtistAutocompleteQuery } from "../generated"; @@ -31,7 +30,7 @@ function SearchButton(): JSX.Element { function onValueChange(event: any){ setSearchValue(event.target.value); - event.target.value != "" && event.target.value !== undefined ? setIsShown(true) : setIsShown(false); + event.target.value !== undefined ? setIsShown(true) : setIsShown(false); } function onAutoClick(event: any){ @@ -41,51 +40,39 @@ function SearchButton(): JSX.Element { return (
-
- {search(event, 'keypress')}} value={searchValue} onChange={onValueChange} /> +
+ {search(event, 'keypress')}} + value={searchValue} + onChange={onValueChange} + onFocus={() => setIsShown(true)} + onBlur={() => + setTimeout(() => { + setIsShown(false); + }, 150) + } /> {search(event, 'buttonclick')}}> - - {/* - theme.palette.getContrastText(theme.palette.background.paper), - }, - }} - id="custom-input-demo" - options={stringArr} - renderInput={(params) => ( -
- {search(event, 'keypress')}} value={searchValue} onChange={onValueChange} {...params.inputProps} /> - {search(event, 'buttonclick')}}> - - -
- )} - /> */} -
- { - autocompleteData?.ArtistDetailsPage?.autocomplete?.ArtistName?.map((name) => { - return( -
onAutoClick(event)}>{name}
- ) - }) - } - { - autocompleteData?.ArtistDetailsPage?.autocomplete?.StageName?.map((name) => { - return( -
onAutoClick(event)}>{name}
- ) - }) - } -
+
+ { + autocompleteData?.ArtistDetailsPage?.autocomplete?.ArtistName?.map((name) => { + return( +
onAutoClick(event)}>{name}
+ ) + }) + } + { + autocompleteData?.ArtistDetailsPage?.autocomplete?.StageName?.map((name) => { + return( +
onAutoClick(event)}>{name}
+ ) + }) + } +
);