Skip to content

armgit / ente

Public Imported from GitHub
0

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

fix default subtext color

Abhinav33273bc796cd
diff --git a/apps/photos/src/components/CaptionedText.tsx b/apps/photos/src/components/CaptionedText.tsx
index 9a407d41fc..02f07c28c2 100644
--- a/apps/photos/src/components/CaptionedText.tsx
+++ b/apps/photos/src/components/CaptionedText.tsx
@@ -8,34 +8,32 @@ interface Iprops {
color?: ButtonProps['color'];
}
+const getSubTextColor = (color: ButtonProps['color']) => {
+ switch (color) {
+ case 'critical':
+ return 'critical.main';
+ default:
+ return 'text.faint';
+ }
+};
+
export const CaptionedText = (props: Iprops) => {
return (
<VerticallyCenteredFlex gap={'4px'}>
<Typography> {props.mainText}</Typography>
- <Typography
- variant="small"
- sx={{
- color: (theme) =>
- theme.palette[props.color].main ?? 'text.faint',
- }}>
+ <Typography variant="small" color={getSubTextColor(props.color)}>
{'β€’'}
</Typography>
{props.subText ? (
<Typography
variant="small"
- sx={{
- color: (theme) =>
- theme.palette[props.color].main ?? 'text.faint',
- }}>
+ color={getSubTextColor(props.color)}>
{props.subText}
</Typography>
) : (
<Typography
variant="small"
- sx={{
- color: (theme) =>
- theme.palette[props.color].main ?? 'text.faint',
- }}>
+ color={getSubTextColor(props.color)}>
{props.subIcon}
</Typography>
)}