Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

update CaptionedText to support button type color

Abhinav4492154ba5dd
diff --git a/apps/photos/src/components/CaptionedText.tsx b/apps/photos/src/components/CaptionedText.tsx
index f5e8073b17..9a407d41fc 100644
--- a/apps/photos/src/components/CaptionedText.tsx
+++ b/apps/photos/src/components/CaptionedText.tsx
@@ -1,25 +1,41 @@
-import { Typography } from '@mui/material';
+import { ButtonProps, Typography } from '@mui/material';
import { VerticallyCenteredFlex } from './Container';
interface Iprops {
mainText: string;
subText?: string;
subIcon?: React.ReactNode;
+ color?: ButtonProps['color'];
}
export const CaptionedText = (props: Iprops) => {
return (
<VerticallyCenteredFlex gap={'4px'}>
<Typography> {props.mainText}</Typography>
- <Typography color="text.faint" variant="small">
+ <Typography
+ variant="small"
+ sx={{
+ color: (theme) =>
+ theme.palette[props.color].main ?? 'text.faint',
+ }}>
{'β€’'}
</Typography>
{props.subText ? (
- <Typography variant="small" color="text.faint">
+ <Typography
+ variant="small"
+ sx={{
+ color: (theme) =>
+ theme.palette[props.color].main ?? 'text.faint',
+ }}>
{props.subText}
</Typography>
) : (
- <Typography variant="small" color="text.faint">
+ <Typography
+ variant="small"
+ sx={{
+ color: (theme) =>
+ theme.palette[props.color].main ?? 'text.faint',
+ }}>
{props.subIcon}
</Typography>
)}