-
-
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
✨ polishing report responsitivity #3636
Changes from all commits
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React, { type ReactNode } from 'react'; | ||
|
||
import { type CSSProperties } from '../../style'; | ||
|
||
import { View } from './View'; | ||
|
||
type SpaceBetweenProps = { | ||
direction?: 'horizontal' | 'vertical'; | ||
gap?: number; | ||
style?: CSSProperties; | ||
children: ReactNode; | ||
}; | ||
|
||
export const SpaceBetween = ({ | ||
direction = 'horizontal', | ||
gap = 15, | ||
style, | ||
children, | ||
}: SpaceBetweenProps) => { | ||
return ( | ||
<View | ||
style={{ | ||
flexWrap: 'wrap', | ||
flexDirection: direction === 'horizontal' ? 'row' : 'column', | ||
alignItems: 'center', | ||
gap, | ||
...style, | ||
}} | ||
> | ||
{children} | ||
</View> | ||
); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,8 +62,21 @@ export function FilterExpression<T extends RuleConditionEntity>({ | |
variant="bare" | ||
isDisabled={customName != null} | ||
onPress={() => setEditing(true)} | ||
style={{ | ||
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. |
||
maxWidth: 'calc(100% - 26px)', | ||
whiteSpace: 'nowrap', | ||
display: 'block', | ||
}} | ||
> | ||
<div style={{ paddingBlock: 1, paddingLeft: 5, paddingRight: 2 }}> | ||
<div | ||
style={{ | ||
paddingBlock: 1, | ||
paddingLeft: 5, | ||
paddingRight: 2, | ||
overflow: 'hidden', | ||
textOverflow: 'ellipsis', | ||
}} | ||
> | ||
{customName ? ( | ||
<Text style={{ color: theme.pageTextPositive }}>{customName}</Text> | ||
) : ( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,10 @@ import { Button } from '../common/Button2'; | |
export function FiltersButton({ onPress }: { onPress: () => void }) { | ||
return ( | ||
<Button variant="bare" onPress={onPress}> | ||
<SvgFilter style={{ width: 12, height: 12, marginRight: 5 }} /> Filter | ||
<SvgFilter | ||
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. Fix the the icon in "Filters" button becoming small when resizing browser |
||
style={{ width: 12, height: 12, marginRight: 5, flexShrink: 0 }} | ||
/>{' '} | ||
Filter | ||
</Button> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ import { useFeatureFlag } from '../../hooks/useFeatureFlag'; | |
import { useResponsive } from '../../ResponsiveProvider'; | ||
import { Button } from '../common/Button2'; | ||
import { Select } from '../common/Select'; | ||
import { SpaceBetween } from '../common/SpaceBetween'; | ||
import { View } from '../common/View'; | ||
import { AppliedFilters } from '../filters/AppliedFilters'; | ||
import { FilterButton } from '../filters/FiltersMenu'; | ||
|
@@ -66,82 +67,69 @@ export function Header({ | |
<View | ||
style={{ | ||
padding: 20, | ||
paddingTop: 0, | ||
paddingTop: 15, | ||
flexShrink: 0, | ||
}} | ||
> | ||
<View | ||
<SpaceBetween | ||
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. Various small re-alignments in cashflow & networth pages on small devices (i.e. mobile). To make the filters look slightly better on small resolutions. |
||
direction={isNarrowWidth ? 'vertical' : 'horizontal'} | ||
style={{ | ||
flexDirection: isNarrowWidth ? 'column' : 'row', | ||
alignItems: isNarrowWidth ? 'flex-start' : 'center', | ||
marginTop: 15, | ||
gap: 15, | ||
}} | ||
> | ||
{isDashboardsFeatureEnabled && mode && ( | ||
<Button | ||
variant={mode === 'static' ? 'normal' : 'primary'} | ||
onPress={() => { | ||
const newMode = mode === 'static' ? 'sliding-window' : 'static'; | ||
const [newStart, newEnd] = calculateTimeRange({ | ||
start, | ||
end, | ||
mode: newMode, | ||
}); | ||
<SpaceBetween gap={isNarrowWidth ? 5 : undefined}> | ||
{isDashboardsFeatureEnabled && mode && ( | ||
<Button | ||
variant={mode === 'static' ? 'normal' : 'primary'} | ||
onPress={() => { | ||
const newMode = mode === 'static' ? 'sliding-window' : 'static'; | ||
const [newStart, newEnd] = calculateTimeRange({ | ||
start, | ||
end, | ||
mode: newMode, | ||
}); | ||
|
||
onChangeDates(newStart, newEnd, newMode); | ||
}} | ||
> | ||
{mode === 'static' ? 'Static' : 'Live'} | ||
</Button> | ||
)} | ||
onChangeDates(newStart, newEnd, newMode); | ||
}} | ||
> | ||
{mode === 'static' ? 'Static' : 'Live'} | ||
</Button> | ||
)} | ||
|
||
<View | ||
style={{ | ||
flexDirection: 'row', | ||
alignItems: 'center', | ||
gap: 5, | ||
}} | ||
> | ||
<Select | ||
onChange={newValue => | ||
onChangeDates( | ||
...validateStart( | ||
allMonths[allMonths.length - 1].name, | ||
newValue, | ||
end, | ||
), | ||
) | ||
} | ||
value={start} | ||
defaultLabel={monthUtils.format(start, 'MMMM, yyyy')} | ||
options={allMonths.map(({ name, pretty }) => [name, pretty])} | ||
/> | ||
<View>to</View> | ||
<Select | ||
onChange={newValue => | ||
onChangeDates( | ||
...validateEnd( | ||
allMonths[allMonths.length - 1].name, | ||
start, | ||
newValue, | ||
), | ||
) | ||
} | ||
value={end} | ||
options={allMonths.map(({ name, pretty }) => [name, pretty])} | ||
style={{ marginRight: 10 }} | ||
/> | ||
</View> | ||
<SpaceBetween gap={5}> | ||
<Select | ||
onChange={newValue => | ||
onChangeDates( | ||
...validateStart( | ||
allMonths[allMonths.length - 1].name, | ||
newValue, | ||
end, | ||
), | ||
) | ||
} | ||
value={start} | ||
defaultLabel={monthUtils.format(start, 'MMMM, yyyy')} | ||
options={allMonths.map(({ name, pretty }) => [name, pretty])} | ||
/> | ||
<View>to</View> | ||
<Select | ||
onChange={newValue => | ||
onChangeDates( | ||
...validateEnd( | ||
allMonths[allMonths.length - 1].name, | ||
start, | ||
newValue, | ||
), | ||
) | ||
} | ||
value={end} | ||
options={allMonths.map(({ name, pretty }) => [name, pretty])} | ||
style={{ marginRight: 10 }} | ||
/> | ||
</SpaceBetween> | ||
</SpaceBetween> | ||
|
||
<View | ||
style={{ | ||
flexDirection: 'row', | ||
alignItems: 'center', | ||
gap: 15, | ||
flexWrap: 'wrap', | ||
}} | ||
> | ||
<SpaceBetween> | ||
{show1Month && ( | ||
<Button | ||
variant="bare" | ||
|
@@ -187,7 +175,7 @@ export function Header({ | |
exclude={undefined} | ||
/> | ||
)} | ||
</View> | ||
</SpaceBetween> | ||
|
||
{children ? ( | ||
<View | ||
|
@@ -202,7 +190,7 @@ export function Header({ | |
) : ( | ||
<View style={{ flex: 1 }} /> | ||
)} | ||
</View> | ||
</SpaceBetween> | ||
|
||
{filters && filters.length > 0 && ( | ||
<View style={{ marginTop: 5 }}> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ import { Button } from '../common/Button2'; | |
import { Menu } from '../common/Menu'; | ||
import { Popover } from '../common/Popover'; | ||
import { Select, type SelectOption } from '../common/Select'; | ||
import { SpaceBetween } from '../common/SpaceBetween'; | ||
import { Text } from '../common/Text'; | ||
import { Tooltip } from '../common/Tooltip'; | ||
import { View } from '../common/View'; | ||
|
@@ -177,16 +178,13 @@ export function ReportSidebar({ | |
<strong>Display</strong> | ||
</Text> | ||
</View> | ||
<View | ||
<SpaceBetween | ||
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. No user-facing update here. Just a small code improvement. |
||
gap={5} | ||
style={{ | ||
flexDirection: 'row', | ||
padding: 5, | ||
alignItems: 'center', | ||
}} | ||
> | ||
<Text style={{ width: 50, textAlign: 'right', marginRight: 5 }}> | ||
Mode: | ||
</Text> | ||
<Text style={{ width: 50, textAlign: 'right' }}>Mode:</Text> | ||
<ModeButton | ||
selected={customReportItems.mode === 'total'} | ||
onSelect={() => onChangeMode('total')} | ||
|
@@ -199,7 +197,7 @@ export function ReportSidebar({ | |
> | ||
Time | ||
</ModeButton> | ||
</View> | ||
</SpaceBetween> | ||
<View | ||
style={{ | ||
flexDirection: 'row', | ||
|
@@ -394,12 +392,11 @@ export function ReportSidebar({ | |
flexShrink: 0, | ||
}} | ||
/> | ||
<View | ||
<SpaceBetween | ||
gap={5} | ||
style={{ | ||
flexDirection: 'row', | ||
marginTop: 10, | ||
marginBottom: 5, | ||
alignItems: 'center', | ||
}} | ||
> | ||
<Text> | ||
|
@@ -430,7 +427,7 @@ export function ReportSidebar({ | |
> | ||
Static | ||
</ModeButton> | ||
</View> | ||
</SpaceBetween> | ||
{!customReportItems.isDateStatic ? ( | ||
<View | ||
style={{ | ||
|
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.
fix for the tiny icons