Skip to content
Snippets Groups Projects
Unverified Commit 96964224 authored by Matiss Janis Aboltins's avatar Matiss Janis Aboltins Committed by GitHub
Browse files

:bug: fix budget tooltip showing if panel is not collapsed (#2887)

parent 0ed5e3eb
No related branches found
No related tags found
No related merge requests found
...@@ -200,6 +200,7 @@ export function BudgetSummary({ month }: BudgetSummaryProps) { ...@@ -200,6 +200,7 @@ export function BudgetSummary({ month }: BudgetSummaryProps) {
prevMonthName={prevMonthName} prevMonthName={prevMonthName}
month={month} month={month}
onBudgetAction={onBudgetAction} onBudgetAction={onBudgetAction}
isCollapsed
/> />
</View> </View>
) : ( ) : (
......
...@@ -19,6 +19,7 @@ type ToBudgetProps = { ...@@ -19,6 +19,7 @@ type ToBudgetProps = {
prevMonthName: string; prevMonthName: string;
style?: CSSProperties; style?: CSSProperties;
amountStyle?: CSSProperties; amountStyle?: CSSProperties;
isCollapsed?: boolean;
}; };
export function ToBudget({ export function ToBudget({
month, month,
...@@ -26,6 +27,7 @@ export function ToBudget({ ...@@ -26,6 +27,7 @@ export function ToBudget({
onBudgetAction, onBudgetAction,
style, style,
amountStyle, amountStyle,
isCollapsed = false,
}: ToBudgetProps) { }: ToBudgetProps) {
const [menuOpen, setMenuOpen] = useState<string | null>(null); const [menuOpen, setMenuOpen] = useState<string | null>(null);
const triggerRef = useRef(null); const triggerRef = useRef(null);
...@@ -34,6 +36,7 @@ export function ToBudget({ ...@@ -34,6 +36,7 @@ export function ToBudget({
value: 0, value: 0,
}); });
const availableValue = parseInt(sheetValue); const availableValue = parseInt(sheetValue);
const isMenuOpen = Boolean(menuOpen);
return ( return (
<> <>
...@@ -43,13 +46,14 @@ export function ToBudget({ ...@@ -43,13 +46,14 @@ export function ToBudget({
prevMonthName={prevMonthName} prevMonthName={prevMonthName}
style={style} style={style}
amountStyle={amountStyle} amountStyle={amountStyle}
isTotalsListTooltipDisabled={!isCollapsed || isMenuOpen}
/> />
</View> </View>
<Popover <Popover
triggerRef={triggerRef} triggerRef={triggerRef}
placement="bottom" placement="bottom"
isOpen={!!menuOpen} isOpen={isMenuOpen}
onOpenChange={() => setMenuOpen(null)} onOpenChange={() => setMenuOpen(null)}
style={{ width: 200 }} style={{ width: 200 }}
> >
......
...@@ -20,6 +20,7 @@ type ToBudgetAmountProps = { ...@@ -20,6 +20,7 @@ type ToBudgetAmountProps = {
style?: CSSProperties; style?: CSSProperties;
amountStyle?: CSSProperties; amountStyle?: CSSProperties;
onClick: () => void; onClick: () => void;
isTotalsListTooltipDisabled?: boolean;
}; };
export function ToBudgetAmount({ export function ToBudgetAmount({
...@@ -27,6 +28,7 @@ export function ToBudgetAmount({ ...@@ -27,6 +28,7 @@ export function ToBudgetAmount({
style, style,
amountStyle, amountStyle,
onClick, onClick,
isTotalsListTooltipDisabled = false,
}: ToBudgetAmountProps) { }: ToBudgetAmountProps) {
const sheetName = useSheetName(rolloverBudget.toBudget); const sheetName = useSheetName(rolloverBudget.toBudget);
const sheetValue = useSheetValue({ const sheetValue = useSheetValue({
...@@ -52,7 +54,8 @@ export function ToBudgetAmount({ ...@@ -52,7 +54,8 @@ export function ToBudgetAmount({
/> />
} }
placement="bottom" placement="bottom"
triggerProps={{ delay: 0 }} offset={3}
triggerProps={{ isDisabled: isTotalsListTooltipDisabled }}
> >
<PrivacyFilter blurIntensity={7}> <PrivacyFilter blurIntensity={7}>
<Block <Block
......
---
category: Bugfix
authors: [MatissJanis]
---
Fix budget tooltip showing on hover if the panel is not collapsed (the tooltip should show only if panel is collapsed).
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment