Skip to content
Snippets Groups Projects
Unverified Commit 1229b1e6 authored by Matiss Janis Aboltins's avatar Matiss Janis Aboltins Committed by GitHub
Browse files

Merge pull request #426 from j-f1/move-find-schedules

Move “Find schedules” to a button on the Schedules page
parents c2b68707 c8b605bc
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,10 @@ export default function Schedules() { ...@@ -27,6 +27,10 @@ export default function Schedules() {
history.push(`/schedule/edit`, { locationPtr: history.location }); history.push(`/schedule/edit`, { locationPtr: history.location });
} }
function onDiscover() {
history.push(`/schedule/discover`, { locationPtr: history.location });
}
async function onAction(name, id) { async function onAction(name, id) {
switch (name) { switch (name) {
case 'post-transaction': case 'post-transaction':
...@@ -70,7 +74,15 @@ export default function Schedules() { ...@@ -70,7 +74,15 @@ export default function Schedules() {
/> />
</View> </View>
<View style={{ alignItems: 'flex-end', margin: '20px 0', flexShrink: 0 }}> <View
style={{
flexDirection: 'row',
justifyContent: 'space-between',
margin: '20px 0',
flexShrink: 0
}}
>
<Button onClick={onDiscover}>Find schedules</Button>
<Button primary onClick={onAdd}> <Button primary onClick={onAdd}>
Add new schedule Add new schedule
</Button> </Button>
......
...@@ -438,7 +438,6 @@ function Tools() { ...@@ -438,7 +438,6 @@ function Tools() {
let items = [ let items = [
{ name: 'payees', text: 'Payees' }, { name: 'payees', text: 'Payees' },
{ name: 'rules', text: 'Rules' }, { name: 'rules', text: 'Rules' },
{ name: 'find-schedules', text: 'Find schedules' },
{ name: 'repair-splits', text: 'Repair split transactions' } { name: 'repair-splits', text: 'Repair split transactions' }
]; ];
...@@ -451,9 +450,6 @@ function Tools() { ...@@ -451,9 +450,6 @@ function Tools() {
case 'rules': case 'rules':
history.push('/rules'); history.push('/rules');
break; break;
case 'find-schedules':
history.push('/schedule/discover');
break;
case 'repair-splits': case 'repair-splits':
history.push('/tools/fix-splits', { locationPtr: history.location }); history.push('/tools/fix-splits', { locationPtr: history.location });
break; break;
...@@ -473,12 +469,9 @@ function Tools() { ...@@ -473,12 +469,9 @@ function Tools() {
onClick={onToggle} onClick={onToggle}
style={{ pointerEvents: isOpen ? 'none' : 'auto' }} style={{ pointerEvents: isOpen ? 'none' : 'auto' }}
forceHover={isOpen} forceHover={isOpen}
forceActive={[ forceActive={['/payees', '/rules', '/tools'].some(route =>
'/payees', location.pathname.startsWith(route)
'/rules', )}
'/tools',
'/schedule/discover'
].some(route => location.pathname.startsWith(route))}
button={ button={
<ChevronRight <ChevronRight
width={12} width={12}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment