text color changed

This commit is contained in:
amit
2024-11-09 11:46:21 +05:30
parent 1c6199d2de
commit 36243d8b62

View File

@@ -1,11 +1,17 @@
import styled from "styled-components"; import styled from "styled-components";
import { Stack } from "@mui/material"; import { Stack } from "@mui/material";
import { useThemeMode } from "../../context/theme-provider";
interface LoaderProps { interface LoaderProps {
text: string; text: string;
} }
export const Loader: React.FC<LoaderProps> = ({ text }) => { export const Loader: React.FC<LoaderProps> = ({ text }) => {
const { darkMode } = useThemeMode();
return ( return (
<Stack direction="column" sx={{ margin: "30px 0px", alignItems: "center" }}> <Stack direction="column" sx={{ margin: "30px 0px", alignItems: "center" }}>
<DotsContainer> <DotsContainer>
@@ -14,18 +20,23 @@ export const Loader: React.FC<LoaderProps> = ({ text }) => {
<Dot /> <Dot />
<Dot /> <Dot />
</DotsContainer> </DotsContainer>
<StyledParagraph>{text}</StyledParagraph> <StyledParagraph darkMode={darkMode}>{text}</StyledParagraph>
</Stack> </Stack>
); );
}; };
const StyledParagraph = styled.p` interface StyledParagraphProps {
darkMode: boolean;
}
const StyledParagraph = styled.p<StyledParagraphProps>`
font-size: medium; font-size: medium;
font-weight: 700; font-weight: 700;
font-family: inherit; font-family: inherit;
color: #333; color: ${({ darkMode }) => (darkMode ? 'white' : 'black')};
margin-top: 20px; margin-top: 20px;
flex:wrap;
`; `;
const DotsContainer = styled.div` const DotsContainer = styled.div`