Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | 2x | import React from "react";
import { Grid, Stack } from "@mui/material";
import { useCustomTheme } from "@theme/hooks/useCustomTheme";
type CampaignSearchProps = {
title: string;
searchBar: JSX.Element;
filters?: React.ReactNode;
watchList?: React.ReactNode;
transparent?: boolean;
};
const CampaignSearch = ({
searchBar,
filters,
watchList,
transparent = true,
}: CampaignSearchProps) => {
const { isDesktopView } = useCustomTheme();
return (
<Grid container alignItems="center" justifyContent="space-between">
<Stack direction="row" gap={2} alignItems="flex-end">
{filters && <Grid>{filters}</Grid>}
{isDesktopView && watchList}
</Stack>
{React.cloneElement(searchBar, {
transparent: transparent,
formSx: {
"@media (max-width: 600px)": {
width: "100%",
"& > div": {
width: "100%",
},
},
},
})}
</Grid>
);
};
export default CampaignSearch;
|