Skip to content

Commit d2bbe6a

Browse files
authored
Spending Report: Mobile UI (#3209)
* SpendingMobile UI * notes
1 parent 2c1967d commit d2bbe6a

File tree

3 files changed

+70
-36
lines changed

3 files changed

+70
-36
lines changed

packages/desktop-client/src/components/reports/Header.jsx

+8-3
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,17 @@ export function Header({
8888
}
8989
value={end}
9090
options={allMonths.map(({ name, pretty }) => [name, pretty])}
91+
buttonStyle={{ marginRight: 10 }}
9192
/>
93+
{filters && (
94+
<FilterButton
95+
compact={isNarrowWidth}
96+
onApply={onApply}
97+
type="accounts"
98+
/>
99+
)}
92100
</View>
93101

94-
{!isNarrowWidth && filters && (
95-
<FilterButton onApply={onApply} type="accounts" />
96-
)}
97102
<View
98103
style={{
99104
flexDirection: 'row',

packages/desktop-client/src/components/reports/reports/Spending.tsx

+56-33
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ export function Spending() {
134134
>
135135
<View
136136
style={{
137-
flexDirection: 'row',
138-
alignItems: 'center',
137+
flexDirection: isNarrowWidth ? 'column' : 'row',
138+
alignItems: isNarrowWidth ? 'inherit' : 'center',
139139
padding: 20,
140-
paddingBottom: conditions.length > 0 ? 0 : 10,
140+
paddingBottom: 0,
141141
flexShrink: 0,
142142
}}
143143
>
@@ -146,6 +146,8 @@ export function Spending() {
146146
alignItems: 'center',
147147
flexDirection: 'row',
148148
marginRight: 5,
149+
marginBottom: 5,
150+
marginTop: 5,
149151
}}
150152
>
151153
<Text
@@ -175,6 +177,15 @@ export function Spending() {
175177
>
176178
to the:
177179
</Text>
180+
</View>
181+
<View
182+
style={{
183+
flexDirection: 'row',
184+
marginRight: 5,
185+
marginTop: 5,
186+
marginBottom: 5,
187+
}}
188+
>
178189
<ModeButton
179190
selected={['lastMonth', 'twoMonthsPrevious'].includes(mode)}
180191
style={{
@@ -211,42 +222,56 @@ export function Spending() {
211222
</ModeButton>
212223
)}
213224
</View>
225+
{!isNarrowWidth && (
226+
<>
227+
<View
228+
style={{
229+
width: 1,
230+
height: 30,
231+
backgroundColor: theme.pillBorderDark,
232+
marginRight: 10,
233+
}}
234+
/>{' '}
235+
</>
236+
)}
214237
<View
215238
style={{
216-
width: 1,
217-
height: 30,
218-
backgroundColor: theme.pillBorderDark,
219-
marginRight: 10,
220-
}}
221-
/>{' '}
222-
<FilterButton
223-
onApply={onApplyFilter}
224-
compact={false}
225-
hover={false}
226-
exclude={['date']}
227-
/>
228-
<View style={{ flex: 1 }} />
229-
<Tooltip
230-
placement="bottom start"
231-
content={<Text>Save compare and filter options</Text>}
232-
style={{
233-
...styles.tooltip,
234-
lineHeight: 1.5,
235-
padding: '6px 10px',
236-
marginLeft: 10,
239+
alignItems: 'center',
240+
flexDirection: 'row',
241+
marginBottom: 5,
242+
marginTop: 5,
243+
flex: 1,
237244
}}
238245
>
239-
<Button
240-
type="primary"
246+
<FilterButton
247+
onApply={onApplyFilter}
248+
compact={isNarrowWidth}
249+
hover={false}
250+
exclude={['date']}
251+
/>
252+
<View style={{ flex: 1 }} />
253+
<Tooltip
254+
placement="bottom start"
255+
content={<Text>Save compare and filter options</Text>}
241256
style={{
257+
...styles.tooltip,
258+
lineHeight: 1.5,
259+
padding: '6px 10px',
242260
marginLeft: 10,
243261
}}
244-
onClick={saveFilter}
245-
disabled={filterSaved ? true : false}
246262
>
247-
{filterSaved ? 'Saved' : 'Save'}
248-
</Button>
249-
</Tooltip>
263+
<Button
264+
type="primary"
265+
style={{
266+
marginLeft: 10,
267+
}}
268+
onClick={saveFilter}
269+
disabled={filterSaved ? true : false}
270+
>
271+
{filterSaved ? 'Saved' : 'Save'}
272+
</Button>
273+
</Tooltip>
274+
</View>
250275
</View>
251276
<View
252277
style={{
@@ -269,8 +294,6 @@ export function Spending() {
269294
flexShrink: 0,
270295
flexDirection: 'row',
271296
spacing: 2,
272-
justifyContent: 'flex-start',
273-
alignContent: 'flex-start',
274297
}}
275298
>
276299
<AppliedFilters

upcoming-release-notes/3209.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
category: Bugfix
3+
authors: [carkom]
4+
---
5+
6+
Adjusting UI so that spending report works on mobile.

0 commit comments

Comments
 (0)