Commit 02968ecd authored by Brian Vaughn's avatar Brian Vaughn Committed by Dan Abramov
Browse files

Cleaned up next/prev error arrow styles; arrows wrap around when clicked now (#2210)

parent 0d0536f9
Showing with 20 additions and 21 deletions
+20 -21
...@@ -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);
} }
......
...@@ -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 primaryPreStyle = { 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': '0px', 'margin-right': '1px',
}); });
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 = {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment