Add loading element to searchPage #34
This commit is contained in:
2 files changed
+43
-2
No files matched your search
@@ -2,7 +2,8 @@
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
import TextField from "@mui/material/TextField";
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
import InputAdornment from "@mui/material/InputAdornment";
|
||||
|
||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||
|
||||
@@ -170,6 +171,46 @@ const SearchPage = () => {
|
||||
inputProps={{
|
||||
className: "search-searchbar-input",
|
||||
}}
|
||||
InputProps={{
|
||||
style: {
|
||||
border: "100px !important",
|
||||
},
|
||||
startAdornment: (
|
||||
<InputAdornment position="start">
|
||||
<div
|
||||
style={{
|
||||
position: "relative",
|
||||
display: "inline-flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
}}
|
||||
>
|
||||
<CircularProgress
|
||||
style={{
|
||||
position: "absolute",
|
||||
transition:
|
||||
"opacity 250ms",
|
||||
opacity:
|
||||
Boolean(
|
||||
searchTerm,
|
||||
) &&
|
||||
(movies.isLoading ||
|
||||
series.isLoading ||
|
||||
audio.isLoading ||
|
||||
musicAlbum.isLoading ||
|
||||
musicArtists.isLoading ||
|
||||
person.isLoading ||
|
||||
book.isLoading)
|
||||
? 1
|
||||
: 0,
|
||||
}}
|
||||
size={35}
|
||||
/>
|
||||
<MdiMagnify />
|
||||
</div>
|
||||
</InputAdornment>
|
||||
),
|
||||
}}
|
||||
value={searchTerm}
|
||||
onChange={(e) => setSearchTerm(e.target.value)}
|
||||
/>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
border-radius: 100px !important;
|
||||
background: rgb(255 255 255 / 0.09);
|
||||
border: none !important;
|
||||
.MuiInputBase-root.MuiOutlinedInput-root.MuiInputBase-colorPrimary.MuiInputBase-formControl.MuiInputBase-hiddenLabel.css-187yyed-MuiInputBase-root-MuiOutlinedInput-root {
|
||||
.MuiInputBase-root {
|
||||
border-radius: 100px !important;
|
||||
}
|
||||
&-input {
|
||||
|
||||
Reference in new issue
Block a user