-
-
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 fix/escaping-in-templating
- Loading branch information
Showing
25 changed files
with
459 additions
and
276 deletions.
There are no files selected for viewing
Binary file modified
BIN
+2.68 KB
(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
+2.38 KB
(100%)
...edules.test.js-snapshots/Schedules-checks-the-page-visuals-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
+2.26 KB
(100%)
...edules.test.js-snapshots/Schedules-checks-the-page-visuals-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 modified
BIN
+2.71 KB
(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
+1.42 KB
(100%)
...new-schedule-posts-the-transaction-and-later-completes-it-10-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
+1.29 KB
(100%)
...new-schedule-posts-the-transaction-and-later-completes-it-11-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
+998 Bytes
(100%)
...new-schedule-posts-the-transaction-and-later-completes-it-12-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
+2.46 KB
(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
+2.34 KB
(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 modified
BIN
+2.68 KB
(100%)
...-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
+2.52 KB
(100%)
...-new-schedule-posts-the-transaction-and-later-completes-it-5-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
+2.34 KB
(100%)
...-new-schedule-posts-the-transaction-and-later-completes-it-6-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
+2.63 KB
(100%)
...-new-schedule-posts-the-transaction-and-later-completes-it-7-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
+2.48 KB
(100%)
...-new-schedule-posts-the-transaction-and-later-completes-it-8-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
+2.25 KB
(100%)
...-new-schedule-posts-the-transaction-and-later-completes-it-9-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
85 changes: 85 additions & 0 deletions
85
packages/desktop-client/src/components/settings/Upcoming.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,85 @@ | ||
import React, { useState } from 'react'; | ||
import { Trans } from 'react-i18next'; | ||
import { useLocation } from 'react-router-dom'; | ||
|
||
import { Column } from 'glamor/jsxstyle'; | ||
|
||
import { type SyncedPrefs } from 'loot-core/types/prefs'; | ||
|
||
import { useSyncedPref } from '../../hooks/useSyncedPref'; | ||
import { type CSSProperties, theme } from '../../style'; | ||
import { Button } from '../common/Button2'; | ||
import { Select } from '../common/Select'; | ||
import { Text } from '../common/Text'; | ||
import { View } from '../common/View'; | ||
|
||
import { Setting } from './UI'; | ||
|
||
const options: { | ||
value: SyncedPrefs['upcomingScheduledTransactionLength']; | ||
label: string; | ||
}[] = [ | ||
{ value: '1', label: '1 Day' }, | ||
{ value: '7', label: '1 Week' }, | ||
{ value: '14', label: '2 Weeks' }, | ||
{ value: '30', label: '1 Month' }, | ||
]; | ||
|
||
export function UpcomingLengthSettings() { | ||
const [_upcomingLength, setUpcomingLength] = useSyncedPref( | ||
'upcomingScheduledTransactionLength', | ||
); | ||
const upcomingLength = _upcomingLength || '7'; | ||
|
||
const selectButtonStyle: CSSProperties = { | ||
':hover': { | ||
backgroundColor: theme.buttonNormalBackgroundHover, | ||
}, | ||
}; | ||
|
||
const location = useLocation(); | ||
const [expanded, setExpanded] = useState(location.hash === '#upcomingLength'); | ||
|
||
return expanded ? ( | ||
<Setting | ||
primaryAction={ | ||
<View style={{ flexDirection: 'row', gap: '1em' }}> | ||
<Column title="Upcoming Length"> | ||
<Select | ||
options={options.map(x => [x.value || '7', x.label])} | ||
value={upcomingLength} | ||
onChange={newValue => setUpcomingLength(newValue)} | ||
style={selectButtonStyle} | ||
/> | ||
</Column> | ||
</View> | ||
} | ||
> | ||
<View style={{ flexDirection: 'row', gap: 20 }}> | ||
<Text> | ||
<strong>Upcoming Length</strong> does not affect how budget data is | ||
stored, and can be changed at any time. | ||
</Text> | ||
<Button | ||
onPress={() => setExpanded(false)} | ||
aria-label="Close upcoming length settings" | ||
> | ||
Close | ||
</Button> | ||
</View> | ||
</Setting> | ||
) : ( | ||
<View> | ||
<Button | ||
aria-label="Edit upcoming length settings" | ||
variant="primary" | ||
onPress={() => setExpanded(true)} | ||
> | ||
<Trans> | ||
Edit Upcoming Length ( | ||
{options.find(x => x.value === upcomingLength)?.label ?? '1 Week'}) | ||
</Trans> | ||
</Button> | ||
</View> | ||
); | ||
} |
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
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.