This commit is contained in:
frontend perkafean
2024-08-09 13:00:10 +00:00
parent 76741e304f
commit 6102db3f56
18 changed files with 271 additions and 141 deletions

View File

@@ -44,7 +44,7 @@ const SearchIcon = styled.svg`
export default function SearchInput({
shopId,
tableId,
tableCode,
autofocus,
onSearchChange,
}) {
@@ -73,15 +73,15 @@ export default function SearchInput({
//Start the timer
let url = "";
if (autofocus || songName != "") {
url = tableId
? `/${shopId}/${tableId}/search?query=${encodeURIComponent(songName)}`
url = tableCode
? `/${shopId}/${tableCode}/search?query=${encodeURIComponent(songName)}`
: `/${shopId}/search?query=${encodeURIComponent(songName)}`;
navigate(url);
}
if (autofocus) {
if (songName == "") {
if (tableId) navigate(`/${shopId}/${tableId}`);
if (tableCode) navigate(`/${shopId}/${tableCode}`);
else navigate(`/${shopId}`);
}
}