Skip to content

Commit

Permalink
UI verbiage updates
Browse files Browse the repository at this point in the history
  • Loading branch information
carkom committed Nov 30, 2023
1 parent 095c386 commit b01d37d
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,19 @@ export default function CategorySelector({

return (
<View>
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
<Button type="bare" onClick={() => setUncheckedHidden(state => !state)}>
<View
style={{
flexDirection: 'row',
alignItems: 'center',
marginBottom: 5,
flexShrink: 0,
}}
>
<Button
type="bare"
onClick={() => setUncheckedHidden(state => !state)}
style={{ padding: 8 }}
>
<View>
{uncheckedHidden ? (
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
Expand Down Expand Up @@ -91,13 +102,12 @@ export default function CategorySelector({
</View>
</View>

<ul
<View
style={{
listStyle: 'none',
marginLeft: 0,
paddingLeft: 0,
paddingRight: 10,
height: 320,
flexGrow: 1,
overflowY: 'auto',
}}
Expand Down Expand Up @@ -214,7 +224,8 @@ export default function CategorySelector({
</Fragment>
);
})}
</ul>
</View>
<View />
</View>
);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const balanceTypeOptions = [
{ description: 'Expense', format: 'totalDebts' },
{ description: 'Income', format: 'totalAssets' },
{ description: 'Payment', format: 'totalDebts' },
{ description: 'Deposit', format: 'totalAssets' },
{ description: 'Net', format: 'totalTotals' },
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export function ReportSidebar({
} else {
setTypeDisabled(['Net']);
if (['Net'].includes(balanceType)) {
setBalanceType('Expense');
setBalanceType('Payment');
}
}
if (graphType === 'BarGraph') {
Expand Down Expand Up @@ -129,7 +129,7 @@ export function ReportSidebar({
}
}
if (['Net'].includes(balanceType) && graphType !== 'TableGraph') {
setBalanceType('Expense');
setBalanceType('Payment');
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ function ReportSummary({
balanceTypeOp,
monthsCount,
}: ReportSummaryProps) {
let net = data.totalDebts > data.totalAssets ? 'EXPENSE' : 'INCOME';
let net =
Math.abs(data.totalDebts) > Math.abs(data.totalAssets)
? 'PAYMENT'
: 'DEPOSIT';
const average = amountToInteger(data[balanceTypeOp]) / monthsCount;
return (
<View
Expand Down Expand Up @@ -76,7 +79,7 @@ function ReportSummary({
{balanceTypeOp === 'totalDebts'
? 'TOTAL SPENDING'
: balanceTypeOp === 'totalAssets'
? 'TOTAL INCOME'
? 'TOTAL DEPOSITS'
: 'NET ' + net}
</Text>
<Text
Expand Down Expand Up @@ -113,7 +116,7 @@ function ReportSummary({
{balanceTypeOp === 'totalDebts'
? 'AVERAGE SPENDING'
: balanceTypeOp === 'totalAssets'
? 'AVERAGE INCOME'
? 'AVERAGE DEPOSIT'
: 'AVERAGE NET'}
</Text>
<Text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ export default function ReportTableHeader({
minWidth: 85,
...styles.tnum,
}}
value={'Assets'}
value={'Deposits'}
width="flex"
/>
<Cell
style={{
minWidth: 85,
...styles.tnum,
}}
value={'Debts'}
value={'Payments'}
width="flex"
/>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ export function ReportTopbar({
if (mode === 'total') {
setGraphType('BarGraph');
if (['Net'].includes(balanceType)) {
setBalanceType('Expense');
setBalanceType('Payment');
}
setTypeDisabled(['Month', 'Year'].includes(groupBy) ? [] : ['Net']);
} else {
setGraphType('StackedBarGraph');
setTypeDisabled(['Net']);
setBalanceType('Expense');
setBalanceType('Payment');
}
}}
style={{ marginRight: 15 }}
Expand All @@ -92,7 +92,7 @@ export function ReportTopbar({
onSelect={() => {
setGraphType('DonutGraph');
setTypeDisabled(['Net']);
setBalanceType('Expense');
setBalanceType('Payment');
}}
style={{ marginRight: 15 }}
disabled={mode === 'total' ? false : true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default function CustomReport() {
const [mode, setMode] = useState('total');
const [datePaused, setDatePaused] = useState('live');
const [groupBy, setGroupBy] = useState('Category');
const [balanceType, setBalanceType] = useState('Expense');
const [balanceType, setBalanceType] = useState('Payment');
const [showEmpty, setShowEmpty] = useState(false);
const [showOffBudgetHidden, setShowOffBudgetHidden] = useState(false);
const [showUncategorized, setShowUncategorized] = useState(false);
Expand Down

0 comments on commit b01d37d

Please sign in to comment.