Skip to content
Snippets Groups Projects
Unverified Commit 3bda1160 authored by Jed Fox's avatar Jed Fox
Browse files

move “Find schedules” to a button on the Schedules page

parent aa1baf83
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,10 @@ export default function Schedules() {
history.push(`/schedule/edit`, { locationPtr: history.location });
}
function onDiscover() {
history.push(`/schedule/discover`, { locationPtr: history.location });
}
async function onAction(name, id) {
switch (name) {
case 'post-transaction':
......@@ -70,7 +74,15 @@ export default function Schedules() {
/>
</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}>
Add new schedule
</Button>
......
......@@ -439,7 +439,6 @@ function Tools() {
let items = [
{ name: 'payees', text: 'Payees' },
{ name: 'rules', text: 'Rules' },
{ name: 'find-schedules', text: 'Find schedules' },
{ name: 'repair-splits', text: 'Repair split transactions' }
];
......@@ -452,9 +451,6 @@ function Tools() {
case 'rules':
history.push('/rules');
break;
case 'find-schedules':
history.push('/schedule/discover');
break;
case 'repair-splits':
history.push('/tools/fix-splits', { locationPtr: history.location });
break;
......@@ -474,12 +470,9 @@ function Tools() {
onClick={onToggle}
style={{ pointerEvents: isOpen ? 'none' : 'auto' }}
forceHover={isOpen}
forceActive={[
'/payees',
'/rules',
'/tools',
'/schedule/discover'
].some(route => location.pathname.startsWith(route))}
forceActive={['/payees', '/rules', '/tools'].some(route =>
location.pathname.startsWith(route)
)}
button={
<ChevronRight
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