Skip to content

Commit 16ec592

Browse files
committed
Add rotation animation
1 parent 6775756 commit 16ec592

File tree

6 files changed

+49
-41
lines changed

6 files changed

+49
-41
lines changed

dash/dash-renderer/src/components/error/CallbackGraph/CallbackGraphContainer.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
background: #ffffff;
99
display: inline-block;
1010
/* shadow-1 */
11-
box-shadow:
12-
0px 6px 16px rgba(80, 103, 132, 0.165),
11+
box-shadow: 0px 6px 16px rgba(80, 103, 132, 0.165),
1312
0px 2px 6px rgba(80, 103, 132, 0.12),
1413
0px 0px 1px rgba(80, 103, 132, 0.32);
1514
}

dash/dash-renderer/src/components/error/FrontEnd/FrontEndError.css

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
}
125125

126126
.dash-be-error__str {
127-
background-color: #F5F6FA;
127+
background-color: #f5f6fa;
128128
min-width: 386px;
129129
width: 100%;
130130
overflow: auto;
@@ -177,8 +177,7 @@
177177
background-color: white;
178178
overflow: auto;
179179
border-radius: 6px;
180-
box-shadow:
181-
0px 0.7px 1.4px 0px rgba(0, 0, 0, 0.07),
180+
box-shadow: 0px 0.7px 1.4px 0px rgba(0, 0, 0, 0.07),
182181
0px 1.9px 4px 0px rgba(0, 0, 0, 0.05),
183182
0px 4.5px 10px 0px rgba(0, 0, 0, 0.05);
184183
}

dash/dash-renderer/src/components/error/icons/Collapse.svg

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 1 addition & 4 deletions
Loading

dash/dash-renderer/src/components/error/menu/DebugMenu.css

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@
2626
border-radius: 0px;
2727
letter-spacing: normal;
2828
gap: 6px;
29+
cursor: pointer;
30+
border: none;
31+
background: none;
32+
outline: none;
33+
display: flex;
34+
align-items: center;
2935
}
3036

3137
.dash-debug-menu__popup {
@@ -52,8 +58,7 @@
5258
align-self: flex-end;
5359
position: relative;
5460
/* Shadow/Small */
55-
box-shadow:
56-
0px 0.7px 1.4px 0px rgba(0, 0, 0, 0.07),
61+
box-shadow: 0px 0.7px 1.4px 0px rgba(0, 0, 0, 0.07),
5762
0px 1.9px 4px 0px rgba(0, 0, 0, 0.05),
5863
0px 4.5px 10px 0px rgba(0, 0, 0, 0.05);
5964
}
@@ -113,8 +118,8 @@
113118
transition: 0.3s;
114119
box-sizing: border-box;
115120
position: fixed;
116-
bottom: 8px;
117-
right: 8px;
121+
bottom: -1px;
122+
right: -1px;
118123
display: flex;
119124
color: black;
120125
flex-direction: row;
@@ -123,11 +128,10 @@
123128
justify-content: center;
124129
align-items: center;
125130
z-index: 10000;
126-
border-radius: 5px;
127-
padding: 5px;
131+
border-radius: 5px 0 0 0;
132+
padding: 15px 0;
128133
background-color: #f5f6fa;
129-
box-shadow:
130-
0px 0.8px 0.8px 0px rgba(0, 0, 0, 0.04),
134+
box-shadow: 0px 0.8px 0.8px 0px rgba(0, 0, 0, 0.04),
131135
0px 2.3px 2px 0px rgba(0, 0, 0, 0.03);
132136
border: 1px solid rgba(0, 24, 102, 0.1);
133137
}
@@ -153,6 +157,14 @@
153157
z-index: 1200;
154158
}
155159

160+
.dash-debug-menu__toggle {
161+
color: #7f4bc4;
162+
transition: 0.3s;
163+
}
164+
.dash-debug-menu__toggle--expanded {
165+
transform: rotate(180deg);
166+
}
167+
156168
.dash-debug-menu__status {
157169
display: flex;
158170
align-items: center;
@@ -162,7 +174,8 @@
162174
.dash-debug-menu__content {
163175
display: flex;
164176
align-items: stretch;
165-
margin: 10px;
177+
margin-left: 15px;
178+
transition: all 0.5s ease;
166179
}
167180

168181
.dash-debug-menu__version {
@@ -186,7 +199,6 @@
186199
justify-content: center;
187200
align-items: center;
188201
transition: background-color 0.2s;
189-
cursor: pointer;
190202
font-family: Verdana, sans-serif !important;
191203
font-weight: bold;
192204
color: black;
@@ -213,8 +225,7 @@
213225
right: 29px;
214226
z-index: 10002;
215227
cursor: pointer;
216-
box-shadow:
217-
0px 0px 1px rgba(0, 0, 0, 0.25),
228+
box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.25),
218229
0px 1px 3px rgba(162, 177, 198, 0.32);
219230
border-radius: 32px;
220231
background-color: white;

dash/dash-renderer/src/components/error/menu/DebugMenu.react.js

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import ClockIcon from '../icons/ClockIcon.svg';
99
import ErrorIcon from '../icons/ErrorIcon.svg';
1010
import GraphIcon from '../icons/GraphIcon.svg';
1111
import OffIcon from '../icons/OffIcon.svg';
12-
import Collapse from '../icons/Collapse.svg';
1312
import Expand from '../icons/Expand.svg';
1413
import {VersionInfo} from './VersionInfo.react';
1514
import {CallbackGraphContainer} from '../CallbackGraph/CallbackGraphContainer.react';
@@ -25,7 +24,7 @@ const isCollapsed = () => {
2524
// If localStorage is not available, default to false
2625
return false;
2726
}
28-
}
27+
};
2928

3029
const MenuContent = ({
3130
hotReload,
@@ -88,6 +87,10 @@ const MenuContent = ({
8887
Server
8988
<_StatusIcon className='dash-debug-menu__icon' />
9089
</div>
90+
<div
91+
className='dash-debug-menu__divider'
92+
style={{marginRight: 0}}
93+
/>
9194
</div>
9295
);
9396
};
@@ -104,16 +107,14 @@ const DebugMenu = ({error, hotReload, config, children}) => {
104107
};
105108

106109
const toggleCallbackGraph = () => {
107-
setPopup(popup == 'callbackGraph' ? null : 'callbackGraph')
110+
setPopup(popup == 'callbackGraph' ? null : 'callbackGraph');
108111
};
109112

110113
const errors = concat(error.frontEnd, error.backEnd);
111114

112115
const popupContent = (
113116
<div className='dash-debug-menu__popup'>
114-
{popup == 'callbackGraph' ? (
115-
<CallbackGraphContainer />
116-
) : undefined}
117+
{popup == 'callbackGraph' ? <CallbackGraphContainer /> : undefined}
117118
{popup == 'errors' && errCount > 0 ? (
118119
<FrontEndErrorContainer
119120
clickHandler={toggleErrors}
@@ -124,9 +125,7 @@ const DebugMenu = ({error, hotReload, config, children}) => {
124125
</div>
125126
);
126127

127-
const menuContent = (
128-
collapsed ?
129-
undefined :
128+
const menuContent = collapsed ? undefined : (
130129
<MenuContent
131130
popup={popup}
132131
errCount={errCount}
@@ -143,23 +142,30 @@ const DebugMenu = ({error, hotReload, config, children}) => {
143142
<div className={classes('dash-debug-menu__outer')}>
144143
{popupContent}
145144
{menuContent}
146-
<button onClick={
147-
() => {
145+
<button
146+
onClick={() => {
148147
setCollapsed(!collapsed);
149148
try {
150-
localStorage.setItem('dash_debug_menu_collapsed', !collapsed);
149+
localStorage.setItem(
150+
'dash_debug_menu_collapsed',
151+
!collapsed
152+
);
151153
} catch (e) {
152154
// If localStorage is not available, do nothing
153155
}
154-
}
155-
}>
156-
{collapsed ? <Expand/> : <Collapse/>}
156+
}}
157+
className={classes(
158+
'dash-debug-menu__toggle',
159+
collapsed ? 'collapsed' : 'expanded'
160+
)}
161+
>
162+
<Expand />
157163
</button>
158164
</div>
159165
{children}
160166
</div>
161167
);
162-
}
168+
};
163169

164170
DebugMenu.propTypes = {
165171
children: PropTypes.object,

0 commit comments

Comments
 (0)