File tree Expand file tree Collapse file tree 3 files changed +41
-20
lines changed
packages/desktop-client/src/components Expand file tree Collapse file tree 3 files changed +41
-20
lines changed Original file line number Diff line number Diff line change @@ -149,21 +149,29 @@ export function SyncButton({ style }: SyncButtonProps) {
149
149
return unlisten ;
150
150
} , [ ] ) ;
151
151
152
+ const mobileColor =
153
+ syncState === 'error'
154
+ ? colors . r7
155
+ : syncState === 'disabled' ||
156
+ syncState === 'offline' ||
157
+ syncState === 'local'
158
+ ? colors . n9
159
+ : style . color ;
160
+ const activeStyle = css (
161
+ // mobile
162
+ media ( `(max-width: ${ tokens . breakpoint_small } )` , {
163
+ color : mobileColor ,
164
+ } ) ,
165
+ ) ;
166
+
152
167
return (
153
168
< Button
154
169
type = "bare"
155
170
style = { css (
156
171
style ,
157
172
{
158
173
WebkitAppRegion : 'none' ,
159
- color :
160
- syncState === 'error'
161
- ? colors . r7
162
- : syncState === 'disabled' ||
163
- syncState === 'offline' ||
164
- syncState === 'local'
165
- ? colors . n9
166
- : null ,
174
+ color : mobileColor ,
167
175
} ,
168
176
media ( `(min-width: ${ tokens . breakpoint_small } )` , {
169
177
color :
@@ -176,6 +184,8 @@ export function SyncButton({ style }: SyncButtonProps) {
176
184
: null ,
177
185
} ) ,
178
186
) }
187
+ hoveredStyle = { activeStyle }
188
+ activeStyle = { activeStyle }
179
189
onClick = { sync }
180
190
>
181
191
{ syncState === 'error' ? (
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import Card from '../common/Card';
22
22
import Label from '../common/Label' ;
23
23
import Text from '../common/Text' ;
24
24
import View from '../common/View' ;
25
+ import { useServerURL } from '../ServerContext' ;
25
26
import CellValue from '../spreadsheet/CellValue' ;
26
27
import format from '../spreadsheet/format' ;
27
28
import NamespaceContext from '../spreadsheet/NamespaceContext' ;
@@ -1016,6 +1017,8 @@ function BudgetHeader({
1016
1017
onPrevMonth,
1017
1018
onNextMonth,
1018
1019
} ) {
1020
+ let serverURL = useServerURL ( ) ;
1021
+
1019
1022
// let [menuOpen, setMenuOpen] = useState(false);
1020
1023
1021
1024
// let onMenuSelect = type => {
@@ -1113,18 +1116,20 @@ function BudgetHeader({
1113
1116
/>
1114
1117
</ Button >
1115
1118
1116
- < SyncButton
1117
- style = { {
1118
- color : 'white' ,
1119
- position : 'absolute' ,
1120
- top : 0 ,
1121
- bottom : 0 ,
1122
- right : 0 ,
1123
- backgroundColor : 'transparent' ,
1124
- paddingLeft : 12 ,
1125
- paddingRight : 12 ,
1126
- } }
1127
- />
1119
+ { serverURL && (
1120
+ < SyncButton
1121
+ style = { {
1122
+ color : 'white' ,
1123
+ position : 'absolute' ,
1124
+ top : 0 ,
1125
+ bottom : 0 ,
1126
+ right : 0 ,
1127
+ backgroundColor : 'transparent' ,
1128
+ paddingLeft : 12 ,
1129
+ paddingRight : 12 ,
1130
+ } }
1131
+ />
1132
+ ) }
1128
1133
{ /* <Button
1129
1134
type="bare"
1130
1135
onClick={() => setMenuOpen(true)}
Original file line number Diff line number Diff line change
1
+ ---
2
+ category : Bugfix
3
+ authors : [MatissJanis]
4
+ ---
5
+
6
+ Mobile: hide sync button when sync is not active
You can’t perform that action at this time.
0 commit comments