-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into goalProgressBar
- Loading branch information
Showing
40 changed files
with
604 additions
and
264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+201 Bytes
(100%)
...edules.test.js-snapshots/Schedules-checks-the-page-visuals-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+350 Bytes
(100%)
...-new-schedule-posts-the-transaction-and-later-completes-it-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+331 Bytes
(100%)
...-new-schedule-posts-the-transaction-and-later-completes-it-2-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+169 Bytes
(100%)
...-new-schedule-posts-the-transaction-and-later-completes-it-3-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+107 KB
...-new-schedule-posts-the-transaction-and-later-completes-it-4-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-7 Bytes
(100%)
...js-snapshots/Transactions-creates-a-split-test-transaction-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
packages/desktop-client/src/components/budget/BudgetMonthCountContext.js
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
packages/desktop-client/src/components/budget/BudgetMonthCountContext.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React, { | ||
createContext, | ||
type Dispatch, | ||
type ReactNode, | ||
type SetStateAction, | ||
useContext, | ||
useState, | ||
} from 'react'; | ||
|
||
type BudgetMonthCountContextValue = { | ||
displayMax: number; | ||
setDisplayMax: Dispatch<SetStateAction<number>>; | ||
}; | ||
|
||
let BudgetMonthCountContext = createContext<BudgetMonthCountContextValue>(null); | ||
|
||
type BudgetMonthCountProviderProps = { | ||
children: ReactNode; | ||
}; | ||
|
||
export function BudgetMonthCountProvider({ | ||
children, | ||
}: BudgetMonthCountProviderProps) { | ||
let [displayMax, setDisplayMax] = useState(1); | ||
|
||
return ( | ||
<BudgetMonthCountContext.Provider value={{ displayMax, setDisplayMax }}> | ||
{children} | ||
</BudgetMonthCountContext.Provider> | ||
); | ||
} | ||
|
||
export function useBudgetMonthCount() { | ||
return useContext(BudgetMonthCountContext); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import React, { type ReactNode, type ComponentProps } from 'react'; | ||
import { NavLink, useMatch, useNavigate } from 'react-router-dom'; | ||
|
||
import { css } from 'glamor'; | ||
|
||
import { type CSSProperties, styles } from '../../style'; | ||
|
||
import Button from './Button'; | ||
|
||
type ButtonLinkProps = ComponentProps<typeof Button> & { | ||
to: string; | ||
activeStyle?: CSSProperties; | ||
}; | ||
|
||
type AnchorLinkProps = { | ||
to: string; | ||
style?: CSSProperties; | ||
activeStyle?: CSSProperties; | ||
children?: ReactNode; | ||
}; | ||
|
||
const ButtonLink = ({ | ||
to, | ||
style, | ||
activeStyle, | ||
onClick, | ||
...props | ||
}: ButtonLinkProps) => { | ||
const navigate = useNavigate(); | ||
const match = useMatch({ path: to }); | ||
|
||
const handleClick = e => { | ||
onClick?.(e); | ||
navigate(to); | ||
}; | ||
|
||
return ( | ||
<Button | ||
style={{ | ||
...style, | ||
...(match ? activeStyle : {}), | ||
}} | ||
activeStyle={activeStyle} | ||
{...props} | ||
onClick={handleClick} | ||
/> | ||
); | ||
}; | ||
|
||
const AnchorLink = ({ to, style, activeStyle, children }: AnchorLinkProps) => { | ||
const match = useMatch({ path: to }); | ||
|
||
return ( | ||
<NavLink | ||
to={to} | ||
className={`${css([ | ||
styles.smallText, | ||
style, | ||
match ? activeStyle : null, | ||
])}`} | ||
> | ||
{children} | ||
</NavLink> | ||
); | ||
}; | ||
|
||
type LinkProps = | ||
| ({ | ||
variant: 'button'; | ||
} & ButtonLinkProps) | ||
| ({ variant?: 'anchor' } & AnchorLinkProps); | ||
|
||
export default function Link({ variant = 'anchor', ...props }: LinkProps) { | ||
switch (variant) { | ||
case 'anchor': | ||
return <AnchorLink {...props} />; | ||
|
||
case 'button': | ||
return <ButtonLink {...props} />; | ||
|
||
default: | ||
throw new Error(`Unrecognised link type: ${variant}`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.