Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
actual-vt-capstone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
danieljk
actual-vt-capstone
Commits
d2e3e44d
Unverified
Commit
d2e3e44d
authored
2 years ago
by
Jed Fox
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Move the “…” menu to the budget name (#459)
parent
be0078e4
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/desktop-client/src/components/SidebarWithData.js
+53
-3
53 additions, 3 deletions
packages/desktop-client/src/components/SidebarWithData.js
packages/loot-design/src/components/sidebar.js
+0
-57
0 additions, 57 deletions
packages/loot-design/src/components/sidebar.js
with
53 additions
and
60 deletions
packages/desktop-client/src/components/SidebarWithData.js
+
53
−
3
View file @
d2e3e44d
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
withRouter
}
from
'
react-router-dom
'
;
import
{
useDispatch
}
from
'
react-redux
'
;
import
{
withRouter
,
useHistory
}
from
'
react-router
'
;
import
{
bindActionCreators
}
from
'
redux
'
;
import
{
bindActionCreators
}
from
'
redux
'
;
import
*
as
actions
from
'
loot-core/src/client/actions
'
;
import
*
as
actions
from
'
loot-core/src/client/actions
'
;
import
{
closeBudget
}
from
'
loot-core/src/client/actions/budgets
'
;
import
Platform
from
'
loot-core/src/client/platform
'
;
import
*
as
queries
from
'
loot-core/src/client/queries
'
;
import
*
as
queries
from
'
loot-core/src/client/queries
'
;
import
{
send
}
from
'
loot-core/src/platform/client/fetch
'
;
import
{
send
}
from
'
loot-core/src/platform/client/fetch
'
;
import
{
import
{
Button
,
Button
,
Input
,
Input
,
InitialFocus
,
InitialFocus
,
Text
Text
,
Tooltip
,
Menu
}
from
'
loot-design/src/components/common
'
;
}
from
'
loot-design/src/components/common
'
;
import
{
Sidebar
}
from
'
loot-design/src/components/sidebar
'
;
import
{
Sidebar
}
from
'
loot-design/src/components/sidebar
'
;
import
{
styles
,
colors
}
from
'
loot-design/src/style
'
;
import
{
styles
,
colors
}
from
'
loot-design/src/style
'
;
import
ExpandArrow
from
'
loot-design/src/svg/ExpandArrow
'
;
function
EditableBudgetName
({
prefs
,
savePrefs
})
{
function
EditableBudgetName
({
prefs
,
savePrefs
})
{
let
dispatch
=
useDispatch
();
let
history
=
useHistory
();
const
[
editing
,
setEditing
]
=
useState
(
false
);
const
[
editing
,
setEditing
]
=
useState
(
false
);
const
[
menuOpen
,
setMenuOpen
]
=
useState
(
false
);
function
onMenuSelect
(
type
)
{
setMenuOpen
(
false
);
switch
(
type
)
{
case
'
rename
'
:
setEditing
(
true
);
break
;
case
'
settings
'
:
history
.
push
(
'
/settings
'
);
break
;
case
'
help
'
:
window
.
open
(
'
https://actualbudget.github.io/docs
'
,
'
_blank
'
);
break
;
case
'
close
'
:
dispatch
(
closeBudget
());
break
;
default
:
}
}
let
items
=
[
{
name
:
'
rename
'
,
text
:
'
Rename Budget
'
},
{
name
:
'
settings
'
,
text
:
'
Settings
'
},
...(
Platform
.
isBrowser
?
[{
name
:
'
help
'
,
text
:
'
Help
'
}]
:
[]),
{
name
:
'
close
'
,
text
:
'
Close File
'
}
];
if
(
editing
)
{
if
(
editing
)
{
return
(
return
(
...
@@ -53,11 +89,25 @@ function EditableBudgetName({ prefs, savePrefs }) {
...
@@ -53,11 +89,25 @@ function EditableBudgetName({ prefs, savePrefs }) {
marginLeft
:
-
5
,
marginLeft
:
-
5
,
flex
:
'
0 auto
'
flex
:
'
0 auto
'
}}
}}
onClick
=
{()
=>
set
Editing
(
true
)}
onClick
=
{()
=>
set
MenuOpen
(
true
)}
>
>
<
Text
style
=
{{
whiteSpace
:
'
nowrap
'
,
overflow
:
'
hidden
'
}}
>
<
Text
style
=
{{
whiteSpace
:
'
nowrap
'
,
overflow
:
'
hidden
'
}}
>
{
prefs
.
budgetName
||
'
A budget has no name
'
}
{
prefs
.
budgetName
||
'
A budget has no name
'
}
<
/Text
>
<
/Text
>
<
ExpandArrow
width
=
{
7
}
height
=
{
7
}
style
=
{{
color
:
'
inherit
'
,
marginLeft
:
5
}}
/
>
{
menuOpen
&&
(
<
Tooltip
position
=
"
bottom-left
"
style
=
{{
padding
:
0
}}
onClose
=
{()
=>
setMenuOpen
(
false
)}
>
<
Menu
onMenuSelect
=
{
onMenuSelect
}
items
=
{
items
}
/
>
<
/Tooltip
>
)}
<
/Button
>
<
/Button
>
);
);
}
}
...
...
This diff is collapsed.
Click to expand it.
packages/loot-design/src/components/sidebar.js
+
0
−
57
View file @
d2e3e44d
...
@@ -446,62 +446,6 @@ function ToggleButton({ style, onFloat }) {
...
@@ -446,62 +446,6 @@ function ToggleButton({ style, onFloat }) {
);
);
}
}
const
MenuButton
=
withRouter
(
function
MenuButton
({
history
})
{
let
dispatch
=
useDispatch
();
let
[
menuOpen
,
setMenuOpen
]
=
useState
(
false
);
function
onMenuSelect
(
type
)
{
setMenuOpen
(
false
);
switch
(
type
)
{
case
'
settings
'
:
history
.
push
(
'
/settings
'
);
break
;
case
'
help
'
:
window
.
open
(
'
https://actualbudget.github.io/docs
'
,
'
_blank
'
);
break
;
case
'
close
'
:
dispatch
(
closeBudget
());
break
;
default
:
}
}
let
items
=
[
{
name
:
'
settings
'
,
text
:
'
Settings
'
},
{
name
:
'
help
'
,
text
:
'
Help
'
},
{
name
:
'
close
'
,
text
:
'
Close File
'
}
];
return
(
<
Button
bare
style
=
{{
color
:
colors
.
n5
,
flexShrink
:
0
}}
activeStyle
=
{{
color
:
colors
.
p7
}}
onClick
=
{()
=>
setMenuOpen
(
true
)}
aria
-
label
=
"
Menu
"
>
<
DotsHorizontalTriple
width
=
{
15
}
height
=
{
15
}
style
=
{{
color
:
'
inherit
'
,
transform
:
'
rotateZ(0deg)
'
}}
/
>
{
menuOpen
&&
(
<
Tooltip
position
=
"
bottom-right
"
style
=
{{
padding
:
0
}}
onClose
=
{()
=>
setMenuOpen
(
false
)}
>
<
Menu
onMenuSelect
=
{
onMenuSelect
}
items
=
{
items
}
/
>
<
/Tooltip
>
)}
<
/Button
>
);
});
function
Tools
()
{
function
Tools
()
{
let
[
isOpen
,
setOpen
]
=
useState
(
false
);
let
[
isOpen
,
setOpen
]
=
useState
(
false
);
let
onToggle
=
useCallback
(()
=>
setOpen
(
open
=>
!
open
),
[]);
let
onToggle
=
useCallback
(()
=>
setOpen
(
open
=>
!
open
),
[]);
...
@@ -638,7 +582,6 @@ export function Sidebar({
...
@@ -638,7 +582,6 @@ export function Sidebar({
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'
row
'
}}
/
>
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'
row
'
}}
/
>
{
!
hasWindowButtons
&&
<
ToggleButton
onFloat
=
{
onFloat
}
/>
}
{
!
hasWindowButtons
&&
<
ToggleButton
onFloat
=
{
onFloat
}
/>
}
{
Platform
.
isBrowser
&&
<
MenuButton
/>
}
<
/View
>
<
/View
>
<
View
style
=
{{
overflow
:
'
auto
'
}}
>
<
View
style
=
{{
overflow
:
'
auto
'
}}
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment