Unverified Commit cb3ce210 authored by Akira Tsuboi's avatar Akira Tsuboi Committed by GitHub

Fix file path overflowing in error popup (#27575)



## Bug

- [x] Related issues linked using `fixes #number`

fixes #27170

### Before
![before](https://user-images.githubusercontent.com/29579847/127415669-8eecf6e3-aba0-408f-9af5-0014da7bb3ad.png)

### After
![after](https://user-images.githubusercontent.com/29579847/127415724-c5082e06-6a68-4f80-828b-ed8ef939b9fb.png)
parent ac58857d
...@@ -63,6 +63,7 @@ export const CodeFrame: React.FC<CodeFrameProps> = function CodeFrame({ ...@@ -63,6 +63,7 @@ export const CodeFrame: React.FC<CodeFrameProps> = function CodeFrame({
// TODO: make the caret absolute // TODO: make the caret absolute
return ( return (
<div data-nextjs-codeframe> <div data-nextjs-codeframe>
<div>
<p <p
role="link" role="link"
onClick={open} onClick={open}
...@@ -86,7 +87,7 @@ export const CodeFrame: React.FC<CodeFrameProps> = function CodeFrame({ ...@@ -86,7 +87,7 @@ export const CodeFrame: React.FC<CodeFrameProps> = function CodeFrame({
<line x1="10" y1="14" x2="21" y2="3"></line> <line x1="10" y1="14" x2="21" y2="3"></line>
</svg> </svg>
</p> </p>
<hr /> </div>
<pre> <pre>
{decoded.map((entry, index) => ( {decoded.map((entry, index) => (
<span <span
......
...@@ -2,6 +2,7 @@ import { noop as css } from '../../helpers/noop-template' ...@@ -2,6 +2,7 @@ import { noop as css } from '../../helpers/noop-template'
const styles = css` const styles = css`
[data-nextjs-codeframe] { [data-nextjs-codeframe] {
overflow: auto;
border-radius: var(--size-gap-half); border-radius: var(--size-gap-half);
background-color: var(--color-ansi-bg); background-color: var(--color-ansi-bg);
color: var(--color-ansi-fg); color: var(--color-ansi-fg);
...@@ -21,31 +22,31 @@ const styles = css` ...@@ -21,31 +22,31 @@ const styles = css`
padding: calc(var(--size-gap) + var(--size-gap-half)) padding: calc(var(--size-gap) + var(--size-gap-half))
calc(var(--size-gap-double) + var(--size-gap-half)); calc(var(--size-gap-double) + var(--size-gap-half));
} }
[data-nextjs-codeframe] > hr { [data-nextjs-codeframe] > div {
margin: 0; display: inline-block;
padding: 0; width: auto;
min-width: 100%;
border: none; border-bottom: 1px solid var(--color-ansi-bright-black);
border-style: solid;
border-width: 0;
border-bottom-width: 1px;
border-color: var(--color-ansi-bright-black);
} }
[data-nextjs-codeframe] > div > p {
[data-nextjs-codeframe] > p {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
cursor: pointer; cursor: pointer;
margin: 0;
} }
[data-nextjs-codeframe] > p:hover { [data-nextjs-codeframe] > div > p:hover {
text-decoration: underline dotted; text-decoration: underline dotted;
} }
[data-nextjs-codeframe] > p > svg { [data-nextjs-codeframe] div > p > svg {
width: auto; width: auto;
height: 1em; height: 1em;
margin-left: 8px; margin-left: 8px;
} }
[data-nextjs-codeframe] div > pre {
overflow: hidden;
display: inline-block;
}
` `
export { styles } export { styles }
Markdown is supported
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