-
Notifications
You must be signed in to change notification settings - Fork 9
chore(angular-react): Migrate ErrorMessage component to React #256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
ac699d0
23386d4
eb9c9fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,171 @@ | ||
| .errorSection { | ||
| height: 300px; | ||
| margin: 200px; | ||
| } | ||
|
|
||
| @media only screen and (max-width: 768px) { | ||
| .errorSection { | ||
| height: 0; | ||
| display: block; | ||
| position: relative; | ||
| margin: 30vh 0; | ||
| } | ||
| } | ||
|
|
||
| .errorSection p { | ||
| text-align: center; | ||
| padding: 0 25px; | ||
| } | ||
|
|
||
| .strong { | ||
| margin-top: 25px; | ||
| font-weight: bold; | ||
| } | ||
|
|
||
| .skull { | ||
| width: 200px; | ||
| height: 200px; | ||
| position: relative; | ||
| top: 0; | ||
| left: 0; | ||
| right: 0; | ||
| bottom: 0; | ||
| margin: auto; | ||
| } | ||
|
|
||
| .head { | ||
| width: 100%; | ||
| height: 75%; | ||
| border-radius: 15% / 20%; | ||
| position: absolute; | ||
| top: 0; | ||
| left: 0; | ||
| background-color: #b92b27; | ||
| } | ||
|
|
||
| .head::before, | ||
| .head::after { | ||
| content: ""; | ||
| position: absolute; | ||
| border-radius: 50%; | ||
| width: 20%; | ||
| height: 30%; | ||
| bottom: 10%; | ||
| background-color: #f5f5f5; | ||
| } | ||
|
|
||
| @media only screen and (max-width: 768px) { | ||
| .head::before, | ||
| .head::after { | ||
| background-color: #fff; | ||
| } | ||
| } | ||
|
|
||
| .head::before { | ||
| left: 10%; | ||
| } | ||
|
|
||
| .head::after { | ||
| right: 10%; | ||
| } | ||
|
|
||
| .crack { | ||
| width: 10%; | ||
| height: 10%; | ||
| position: absolute; | ||
| top: 0; | ||
| right: 25%; | ||
| transform: skew(-15deg); | ||
| background-color: #f5f5f5; | ||
| } | ||
|
|
||
| @media only screen and (max-width: 768px) { | ||
| .crack { | ||
| background-color: #fff; | ||
| } | ||
| } | ||
|
|
||
| .crack::before { | ||
| content: ""; | ||
| position: absolute; | ||
| top: 100%; | ||
| left: 13.33px; | ||
| border-right: 10px solid transparent; | ||
| border-left: 5px solid transparent; | ||
| border-top: 25px solid #f5f5f5; | ||
| } | ||
|
|
||
| @media only screen and (max-width: 768px) { | ||
| .crack::before { | ||
| border-top: 25px solid #fff; | ||
| } | ||
| } | ||
|
|
||
| .mouth { | ||
| width: 40%; | ||
| height: 25%; | ||
| position: absolute; | ||
| top: 75%; | ||
| left: 30%; | ||
| border-radius: 0 0 20px 20px; | ||
| background-color: #b92b27; | ||
| } | ||
|
|
||
| .mouth::before { | ||
| content: ""; | ||
| position: absolute; | ||
| width: 15%; | ||
| height: 50%; | ||
| border-radius: 50% / 30%; | ||
| left: 42.5%; | ||
| top: -25%; | ||
| background-color: #f5f5f5; | ||
| } | ||
|
|
||
| @media only screen and (max-width: 768px) { | ||
| .mouth::before { | ||
| background-color: #fff; | ||
| } | ||
| } | ||
|
|
||
| .teeth { | ||
| position: absolute; | ||
| bottom: 0; | ||
| left: 45%; | ||
| width: 10%; | ||
| height: 50%; | ||
| margin-bottom: -5%; | ||
| border-radius: 50% / 20%; | ||
| background-color: #f5f5f5; | ||
| } | ||
|
|
||
| @media only screen and (max-width: 768px) { | ||
| .teeth { | ||
| background-color: #fff; | ||
| } | ||
| } | ||
|
|
||
| .teeth::before, | ||
| .teeth::after { | ||
| content: ""; | ||
| position: absolute; | ||
| width: 100%; | ||
| height: 100%; | ||
| border-radius: 50% / 20%; | ||
| background-color: #f5f5f5; | ||
| } | ||
|
|
||
| @media only screen and (max-width: 768px) { | ||
| .teeth::before, | ||
| .teeth::after { | ||
| background-color: #fff; | ||
| } | ||
| } | ||
|
|
||
| .teeth::before { | ||
| left: -250%; | ||
| } | ||
|
|
||
| .teeth::after { | ||
| right: -250%; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import React from 'react'; | ||
| import styles from './ErrorMessage.module.css'; | ||
|
|
||
| interface ErrorMessageProps { | ||
| message: string; | ||
| } | ||
|
|
||
| export const ErrorMessage: React.FC<ErrorMessageProps> = ({ message }) => { | ||
| return ( | ||
| <div className={styles.errorSection}> | ||
| <div className={styles.skull}> | ||
| <div className={styles.head}> | ||
| <div className={styles.crack}></div> | ||
| </div> | ||
| <div className={styles.mouth}> | ||
| <div className={styles.teeth}></div> | ||
| </div> | ||
| </div> | ||
| <p className={styles.strong}>{message}</p> | ||
| <p>If you are offline viewing, you'll need to visit this page with a network connection first before it can work offline.</p> | ||
| </div> | ||
| ); | ||
| }; | ||
|
Comment on lines
+1
to
+23
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 React component added to a pure Angular project — cannot be compiled or used The new Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is intentional — per the Angular-to-React migration playbook, we create the React component alongside the existing Angular component without removing the Angular source. The React file is a standalone migration artifact placed at the designated target path ( |
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 Hardcoded day-theme colors break night and amoledblack theme support
The CSS file hardcodes the day-theme colors (
#b92b27for the skull head/mouth,#f5f5f5for eye sockets/crack/teeth). The existing Angular component's styling is driven by the theme mixin insrc/app/shared/scss/_themes.scss:124-182, which applies different colors per theme — e.g., night theme uses#00c0ffas$secondary-link-colorand#263238as$wrapper-background-color. This CSS loses support for the night and amoledblack themes entirely, meaning the skull would render with incorrect colors (day-theme red on a dark background) when those themes are active.Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed — added all missing
background-colorandborder-topproperties from the default (day) theme (_themes.scsslines 124-181). Inlined values:\n\n-.head/.mouth:#b92b27(secondary-color)\n- Eye sockets, crack, teeth, mouth::before:#f5f5f5(wrapper-background)\n- Mobile overrides:#fff(wrapper-mobile-background)\n-.crack::beforeborder-top:25px solid($skull-size/8)\n\nSee commit eb9c9fd.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acknowledged — this is a known limitation documented in the PR description. The user's instructions explicitly state "Do NOT introduce any new dependencies on other app files — this is a leaf node," so integrating with the Angular theme mixin (
_themes.scss) is out of scope. The day-theme colors are inlined as a baseline. Night/amoledblack theme support can be added in a follow-up once a React-compatible theming system is established.