Skip to content

Commit

Permalink
adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
carkom committed Jan 13, 2024
1 parent 65ec3fa commit fb5ed9f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
11 changes: 6 additions & 5 deletions packages/desktop-client/src/components/common/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ type MenuItem = {
style?: CSSProperties;
toggle?: boolean;
tooltip?: string;
isOn?: boolean;
};

type MenuProps<T extends MenuItem = MenuItem> = {
Expand Down Expand Up @@ -167,12 +166,12 @@ export function Menu<T extends MenuItem>({
onClick={() =>
!item.disabled &&
onMenuSelect &&
!item.toggle &&
item.toggle === undefined &&
onMenuSelect(item.name)
}
>
{/* Force it to line up evenly */}
{!item.toggle ? (
{item.toggle === undefined ? (
<>
<Text style={{ lineHeight: 0 }}>
{item.icon &&
Expand All @@ -196,11 +195,13 @@ export function Menu<T extends MenuItem>({
<View style={{ flex: 1 }} />
<Toggle
id={item.name}
checked={item.isOn}
checked={item.toggle}
onColor={theme.pageTextPositive}
style={{ marginLeft: 5, ...item.style }}
onChange={() =>
!item.disabled && item.toggle && onMenuSelect(item.name)
!item.disabled &&
item.toggle !== undefined &&
onMenuSelect(item.name)
}
/>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,22 +284,19 @@ export function ReportSidebar({
name: 'show-empty-rows',
text: 'Show Empty Rows',
tooltip: 'Show rows that are zero or blank',
isOn: showEmpty,
toggle: true,
toggle: showEmpty,
},
{
name: 'show-hidden-categories',
text: 'Show Off Budget',
tooltip: 'Show off budget accounts and hidden categories',
isOn: showOffBudgetHidden,
toggle: true,
toggle: showOffBudgetHidden,
},
{
name: 'show-uncategorized',
text: 'Show Uncategorized',
tooltip: 'Show uncategorized transactions',
isOn: showUncategorized,
toggle: true,
toggle: showUncategorized,
},
]}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const adjustTextSize = (
let source;
switch (type) {
case 'variable':
source = variableLookup.find(({ value }) => values > value).arr;
source = variableLookup.find(({ value }) => values >= value).arr;
break;
case 'donut':
source = donutLookup;
Expand Down

0 comments on commit fb5ed9f

Please sign in to comment.