-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix mobile balance modal colors #3492
Changes from 4 commits
2d8584c
a5fbd5a
1bc77b5
f0aab63
c89a594
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -10,6 +10,7 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { useFeatureFlag } from '../../hooks/useFeatureFlag'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { SvgArrowThinRight } from '../../icons/v1'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { useResponsive } from '../../ResponsiveProvider'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { type CSSProperties, theme, styles } from '../../style'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { Tooltip } from '../common/Tooltip'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { View } from '../common/View'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -61,16 +62,25 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type CellValueChildren = ComponentPropsWithoutRef<typeof CellValue>['children']; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type ChildrenWithClassName = ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
props: Parameters<CellValueChildren>[0] & { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
className: string; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
) => ReturnType<CellValueChildren>; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type BalanceWithCarryoverProps = Omit< | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ComponentPropsWithoutRef<typeof CellValue>, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'binding' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'children' | 'binding' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> & { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
children?: ChildrenWithClassName; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
carryover: Binding<'envelope-budget', 'carryover'>; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
balance: Binding<'envelope-budget', 'leftover'>; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
goal: Binding<'envelope-budget', 'goal'>; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
budgeted: Binding<'envelope-budget', 'budget'>; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
longGoal: Binding<'envelope-budget', 'long-goal'>; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
disabled?: boolean; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
isDisabled?: boolean; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CarryoverIndicator?: ComponentType<CarryoverIndicatorProps>; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -80,18 +90,19 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
goal, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
budgeted, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
longGoal, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
disabled, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
isDisabled, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CarryoverIndicator: CarryoverIndicatorComponent = CarryoverIndicator, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
children, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
...props | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}: BalanceWithCarryoverProps) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const { t } = useTranslation(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const { isNarrowWidth } = useResponsive(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const carryoverValue = useSheetValue(carryover); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const goalValue = useSheetValue(goal); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const budgetedValue = useSheetValue(budgeted); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const longGoalValue = useSheetValue(longGoal); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const isGoalTemplatesEnabled = useFeatureFlag('goalTemplatesEnabled'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const getBalanceStyle = useCallback( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const getBalanceAmountStyle = useCallback( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(balanceValue: number) => | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
makeBalanceAmountStyle( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
balanceValue, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -102,101 +113,113 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const format = useFormat(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const differenceToGoal = useCallback( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const getDifferenceToGoal = useCallback( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(balanceValue: number) => | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
longGoalValue === 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
? balanceValue - goalValue | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
: budgetedValue - goalValue, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[budgetedValue, goalValue, longGoalValue], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const getDefaultClassName = useCallback( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(balanceValue: number) => | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
String( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
css({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
...getBalanceAmountStyle(balanceValue), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
overflow: 'hidden', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
textOverflow: 'ellipsis', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
textAlign: 'right', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
...(!isDisabled && { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
cursor: 'pointer', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
':hover': { textDecoration: 'underline' }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[getBalanceAmountStyle, isDisabled], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+124
to
+139
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove unnecessary The Apply this diff to fix the issue: const getDefaultClassName = useCallback(
(balanceValue: number) =>
- String(
- css({
- ...getBalanceAmountStyle(balanceValue),
- overflow: 'hidden',
- textOverflow: 'ellipsis',
- textAlign: 'right',
- ...(!isDisabled && {
- cursor: 'pointer',
- }),
- ':hover': { textDecoration: 'underline' },
- }),
- ),
+ css({
+ ...getBalanceAmountStyle(balanceValue),
+ overflow: 'hidden',
+ textOverflow: 'ellipsis',
+ textAlign: 'right',
+ ...(!isDisabled && {
+ cursor: 'pointer',
+ }),
+ ':hover': { textDecoration: 'underline' },
+ }),
[getBalanceAmountStyle, isDisabled],
); This change ensures that the 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
return ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<CellValue binding={balance} type="financial" {...props}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{({ type, name, value: balanceValue }) => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{children ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
children({ type, name, value: balanceValue }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
) : ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Tooltip | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
content={ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<View style={{ padding: 10 }}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<span style={{ fontWeight: 'bold' }}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{differenceToGoal(balanceValue) === 0 ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<span style={{ color: theme.noticeText }}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{t('Fully funded')} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
) : differenceToGoal(balanceValue) > 0 ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<span style={{ color: theme.noticeText }}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{t('Overfunded ({{amount}})', { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
amount: format( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
differenceToGoal(balanceValue), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'financial', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
})} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
) : ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<span style={{ color: theme.errorText }}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{t('Underfunded ({{amount}})', { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
amount: format( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
differenceToGoal(balanceValue), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'financial', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
})} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<GoalTooltipRow> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<div>{t('Goal Type:')}</div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<div>{longGoalValue === 1 ? 'Long' : 'Template'}</div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</GoalTooltipRow> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<GoalTooltipRow> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<div>{t('Goal:')}</div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<div>{format(goalValue, 'financial')}</div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</GoalTooltipRow> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<GoalTooltipRow> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{longGoalValue !== 1 ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<div>{t('Budgeted:')}</div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<div>{format(budgetedValue, 'financial')}</div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
) : ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<div>{t('Balance:')}</div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<div>{format(balanceValue, type)}</div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</GoalTooltipRow> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</View> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
style={{ ...styles.tooltip, borderRadius: '0px 5px 5px 0px' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
placement="bottom" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
triggerProps={{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
delay: 750, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
isDisabled: !isGoalTemplatesEnabled || goalValue == null, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Tooltip | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
content={ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<View style={{ padding: 10 }}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<span style={{ fontWeight: 'bold' }}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{getDifferenceToGoal(balanceValue) === 0 ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<span style={{ color: theme.noticeText }}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{t('Fully funded')} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
) : getDifferenceToGoal(balanceValue) > 0 ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<span style={{ color: theme.noticeText }}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{t('Overfunded ({{amount}})', { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
amount: format( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
getDifferenceToGoal(balanceValue), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'financial', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
})} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
) : ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<span style={{ color: theme.errorText }}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{t('Underfunded ({{amount}})', { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
amount: format( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
getDifferenceToGoal(balanceValue), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'financial', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
})} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<GoalTooltipRow> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<div>{t('Goal Type:')}</div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<div>{longGoalValue === 1 ? t('Long') : t('Template')}</div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</GoalTooltipRow> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<GoalTooltipRow> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<div>{t('Goal:')}</div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<div>{format(goalValue, 'financial')}</div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</GoalTooltipRow> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<GoalTooltipRow> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{longGoalValue !== 1 ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<div>{t('Budgeted:')}</div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<div>{format(budgetedValue, 'financial')}</div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
) : ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<div>{t('Balance:')}</div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<div>{format(balanceValue, type)}</div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</GoalTooltipRow> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</View> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
style={{ ...styles.tooltip, borderRadius: '0px 5px 5px 0px' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
placement="bottom" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
triggerProps={{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
delay: 750, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
isDisabled: !isGoalTemplatesEnabled || goalValue == null || isNarrowWidth, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{children ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
children({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
name, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
value: balanceValue, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
className: getDefaultClassName(balanceValue), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
) : ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<CellValueText | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type={type} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
name={name} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
value={balanceValue} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
className={String( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
css({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
...getBalanceStyle(balanceValue), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
overflow: 'hidden', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
textOverflow: 'ellipsis', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
textAlign: 'right', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
...(!disabled && { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
cursor: 'pointer', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
':hover': { textDecoration: 'underline' }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
className={getDefaultClassName(balanceValue)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
/> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Tooltip> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Tooltip> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{carryoverValue && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<CarryoverIndicatorComponent | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
style={getBalanceStyle(balanceValue)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
style={getBalanceAmountStyle(balanceValue)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
/> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
category: Bugfix | ||
authors: [joel-jeremy] | ||
--- | ||
|
||
Fix mobile balance modal not properly coloring balance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unnecessary
String()
wrapping aroundcss()
.The
css()
function already returns a string representing the class name. Wrapping it withString()
is redundant.Apply this diff to simplify the code:
Committable suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
glamor's css function returns a StyleAttribute, not a string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joel-jeremy, thank you for the clarification. You're absolutely right—glamor's
css()
function returns aStyleAttribute
, not a string. My apologies for the oversight.(·•·)?
✏️ Learnings added