Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Meta
create-react-app
Commits
02968ecd
Commit
02968ecd
authored
7 years ago
by
Brian Vaughn
Committed by
Dan Abramov
7 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Cleaned up next/prev error arrow styles; arrows wrap around when clicked now (#2210)
parent
0d0536f9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/react-error-overlay/src/overlay.js
+7
-3
packages/react-error-overlay/src/overlay.js
packages/react-error-overlay/src/styles.js
+13
-18
packages/react-error-overlay/src/styles.js
with
20 additions
and
21 deletions
+20
-21
packages/react-error-overlay/src/overlay.js
+
7
-
3
View file @
02968ecd
...
@@ -110,10 +110,14 @@ function renderErrorByIndex(index: number) {
...
@@ -110,10 +110,14 @@ function renderErrorByIndex(index: number) {
}
}
function
switchError
(
offset
)
{
function
switchError
(
offset
)
{
const
nextView
=
currReferenceIndex
+
offset
;
let
nextView
=
currReferenceIndex
+
offset
;
if
(
nextView
<
0
||
nextView
>=
errorReferences
.
length
)
{
return
;
if
(
nextView
<
0
)
{
nextView
=
errorReferences
.
length
-
1
;
}
else
if
(
nextView
>=
errorReferences
.
length
)
{
nextView
=
0
;
}
}
renderErrorByIndex
(
nextView
);
renderErrorByIndex
(
nextView
);
}
}
...
...
This diff is collapsed.
Click to expand it.
packages/react-error-overlay/src/styles.js
+
13
-
18
View file @
02968ecd
...
@@ -2,8 +2,10 @@
...
@@ -2,8 +2,10 @@
const
black
=
'
#293238
'
,
const
black
=
'
#293238
'
,
darkGray
=
'
#878e91
'
,
darkGray
=
'
#878e91
'
,
red
=
'
#ce1126
'
,
red
=
'
#ce1126
'
,
redTransparent
=
'
rgba(206, 17, 38, 0.05)
'
,
lightRed
=
'
#fccfcf
'
,
lightRed
=
'
#fccfcf
'
,
yellow
=
'
#fbf5b4
'
,
yellow
=
'
#fbf5b4
'
,
yellowTransparent
=
'
rgba(251, 245, 180, 0.3)
'
,
white
=
'
#ffffff
'
;
white
=
'
#ffffff
'
;
const
iframeStyle
=
{
const
iframeStyle
=
{
...
@@ -122,7 +124,7 @@ const omittedFramesExpandedStyle = {
...
@@ -122,7 +124,7 @@ const omittedFramesExpandedStyle = {
'
margin-bottom
'
:
'
0.6em
'
,
'
margin-bottom
'
:
'
0.6em
'
,
};
};
const
p
rimaryP
reStyle
=
{
const
_
preStyle
=
{
display
:
'
block
'
,
display
:
'
block
'
,
padding
:
'
0.5em
'
,
padding
:
'
0.5em
'
,
'
margin-top
'
:
'
0.5em
'
,
'
margin-top
'
:
'
0.5em
'
,
...
@@ -130,18 +132,13 @@ const primaryPreStyle = {
...
@@ -130,18 +132,13 @@ const primaryPreStyle = {
'
overflow-x
'
:
'
auto
'
,
'
overflow-x
'
:
'
auto
'
,
'
white-space
'
:
'
pre-wrap
'
,
'
white-space
'
:
'
pre-wrap
'
,
'
border-radius
'
:
'
0.25rem
'
,
'
border-radius
'
:
'
0.25rem
'
,
'
background-color
'
:
'
rgba(206, 17, 38, .05)
'
,
};
const
secondaryPreStyle
=
{
display
:
'
block
'
,
padding
:
'
0.5em
'
,
'
margin-top
'
:
'
0.5em
'
,
'
margin-bottom
'
:
'
0.5em
'
,
'
overflow-x
'
:
'
auto
'
,
'
white-space
'
:
'
pre-wrap
'
,
'
border-radius
'
:
'
0.25rem
'
,
'
background-color
'
:
'
rgba(251, 245, 180,.3)
'
,
};
};
const
primaryPreStyle
=
Object
.
assign
({},
_preStyle
,
{
'
background-color
'
:
redTransparent
,
});
const
secondaryPreStyle
=
Object
.
assign
({},
_preStyle
,
{
'
background-color
'
:
yellowTransparent
,
});
const
toggleStyle
=
{
const
toggleStyle
=
{
'
margin-bottom
'
:
'
1.5em
'
,
'
margin-bottom
'
:
'
1.5em
'
,
...
@@ -162,11 +159,10 @@ const groupStyle = {
...
@@ -162,11 +159,10 @@ const groupStyle = {
};
};
const
_groupElemStyle
=
{
const
_groupElemStyle
=
{
'
background-color
'
:
'
inherit
'
,
'
background-color
'
:
redTransparent
,
'
border-
color
'
:
'
#ddd
'
,
color
:
red
,
'
border
-width
'
:
'
1px
'
,
border
:
'
none
'
,
'
border-radius
'
:
'
4px
'
,
'
border-radius
'
:
'
4px
'
,
'
border-style
'
:
'
solid
'
,
padding
:
'
3px 6px
'
,
padding
:
'
3px 6px
'
,
cursor
:
'
pointer
'
,
cursor
:
'
pointer
'
,
};
};
...
@@ -174,13 +170,12 @@ const _groupElemStyle = {
...
@@ -174,13 +170,12 @@ const _groupElemStyle = {
const
groupElemLeft
=
Object
.
assign
({},
_groupElemStyle
,
{
const
groupElemLeft
=
Object
.
assign
({},
_groupElemStyle
,
{
'
border-top-right-radius
'
:
'
0px
'
,
'
border-top-right-radius
'
:
'
0px
'
,
'
border-bottom-right-radius
'
:
'
0px
'
,
'
border-bottom-right-radius
'
:
'
0px
'
,
'
margin-right
'
:
'
0
px
'
,
'
margin-right
'
:
'
1
px
'
,
});
});
const
groupElemRight
=
Object
.
assign
({},
_groupElemStyle
,
{
const
groupElemRight
=
Object
.
assign
({},
_groupElemStyle
,
{
'
border-top-left-radius
'
:
'
0px
'
,
'
border-top-left-radius
'
:
'
0px
'
,
'
border-bottom-left-radius
'
:
'
0px
'
,
'
border-bottom-left-radius
'
:
'
0px
'
,
'
margin-right
'
:
'
-1px
'
,
});
});
const
footerStyle
=
{
const
footerStyle
=
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment