-
-
Notifications
You must be signed in to change notification settings - Fork 43
Add React Router support with 404 page #59
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,31 @@ | ||||||||||||||||||||||||||||||||||||||||||||
| #root { | ||||||||||||||||||||||||||||||||||||||||||||
| max-width: 1280px; | ||||||||||||||||||||||||||||||||||||||||||||
| margin: 0 auto; | ||||||||||||||||||||||||||||||||||||||||||||
| padding: 2rem; | ||||||||||||||||||||||||||||||||||||||||||||
| width: 100%; | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| .home-container, | ||||||||||||||||||||||||||||||||||||||||||||
| .notfound-container { | ||||||||||||||||||||||||||||||||||||||||||||
| min-height: 100vh; | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| display: flex; | ||||||||||||||||||||||||||||||||||||||||||||
| flex-direction: column; | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| justify-content: center; | ||||||||||||||||||||||||||||||||||||||||||||
| align-items: center; | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| text-align: center; | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+5
to
+16
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. Fix stylelint violations in the route container block. Line 9, Line 12, and Line 15 have empty lines before declarations ( Proposed fix .home-container,
.notfound-container {
min-height: 100vh;
-
display: flex;
flex-direction: column;
-
justify-content: center;
align-items: center;
-
text-align: center;
}As per coding guidelines, " 📝 Committable suggestion
Suggested change
🧰 Tools🪛 Stylelint (17.11.0)[error] 9-9: Expected no empty line before declaration (declaration-empty-line-before) (declaration-empty-line-before) [error] 12-12: Expected no empty line before declaration (declaration-empty-line-before) (declaration-empty-line-before) [error] 15-15: Expected no empty line before declaration (declaration-empty-line-before) (declaration-empty-line-before) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| h1 { | ||||||||||||||||||||||||||||||||||||||||||||
| font-size: 4rem; | ||||||||||||||||||||||||||||||||||||||||||||
| margin-bottom: 20px; | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| a { | ||||||||||||||||||||||||||||||||||||||||||||
| color: #4ea1ff; | ||||||||||||||||||||||||||||||||||||||||||||
| text-decoration: none; | ||||||||||||||||||||||||||||||||||||||||||||
| font-size: 18px; | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| a:hover { | ||||||||||||||||||||||||||||||||||||||||||||
| text-decoration: underline; | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+18
to
31
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. 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win Scope typography/link rules to route containers to prevent global style bleed. These global selectors can unintentionally restyle headings/links in unrelated views. Proposed refactor-h1 {
+.home-container h1,
+.notfound-container h1 {
font-size: 4rem;
margin-bottom: 20px;
}
-a {
+.home-container a,
+.notfound-container a {
color: `#4ea1ff`;
text-decoration: none;
font-size: 18px;
}
-a:hover {
+.home-container a:hover,
+.notfound-container a:hover {
text-decoration: underline;
}As per coding guidelines, " 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,28 @@ | ||
| import './App.css' | ||
| import { Routes, Route } from 'react-router-dom' | ||
|
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. 🧩 Analysis chain🏁 Script executed: cat -n src/App.tsxRepository: AOSSIE-Org/OrgExplorer Length of output: 694 Use React Router Using Suggested fix-import { Routes, Route } from 'react-router-dom'
+import { Routes, Route, Link } from 'react-router-dom'
@@
- <a href="/">Go Back Home</a>
+ <Link to="/">Go Back Home</Link>Also externalize hardcoded strings to i18n resources. Also applies to: 13-13 (and strings on lines 5, 12) 🤖 Prompt for AI Agents |
||
|
|
||
| function App() { | ||
| function Home() { | ||
| return ( | ||
| <h1>Hello, OrgExplorer!</h1> | ||
|
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. Externalize user-facing strings to i18n resources. These hardcoded strings should come from localization resources to meet the repo’s i18n requirement. As per coding guidelines, "User-visible strings should be externalized to resource files (i18n)". Also applies to: 12-13 🤖 Prompt for AI Agents |
||
| ) | ||
| } | ||
|
|
||
| function NotFoundPage() { | ||
| return ( | ||
| <div> | ||
| <h1>404 - Page Not Found</h1> | ||
| <a href="/">Go Back Home</a> | ||
| </div> | ||
| ) | ||
| } | ||
|
|
||
| function App() { | ||
| return ( | ||
| <> | ||
| <h1>Hello, OrgExplorer!</h1> | ||
| </> | ||
| <Routes> | ||
| <Route path="/" element={<Home />} /> | ||
|
|
||
| <Route path="*" element={<NotFoundPage />} /> | ||
| </Routes> | ||
| ) | ||
| } | ||
|
|
||
| export default App | ||
| export default App | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,11 @@ | ||
| :root { | ||
| font-family: system-ui, Avenir, Helvetica, Arial, sans-serif; | ||
| line-height: 1.5; | ||
| font-weight: 400; | ||
|
|
||
| color-scheme: light dark; | ||
| color: rgba(255, 255, 255, 0.87); | ||
| background-color: #242424; | ||
|
|
||
| font-synthesis: none; | ||
| text-rendering: optimizeLegibility; | ||
| -webkit-font-smoothing: antialiased; | ||
| -moz-osx-font-smoothing: grayscale; | ||
| * { | ||
| margin: 0; | ||
| padding: 0; | ||
| box-sizing: border-box; | ||
| } | ||
|
|
||
| body { | ||
| font-family: Arial, sans-serif; | ||
| background-color: #111; | ||
| color: white; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,14 @@ | ||
| import { StrictMode } from 'react' | ||
| import { createRoot } from 'react-dom/client' | ||
| import { BrowserRouter } from 'react-router-dom' | ||
|
|
||
| import './index.css' | ||
| import App from './App.tsx' | ||
|
|
||
| createRoot(document.getElementById('root')!).render( | ||
| <StrictMode> | ||
| <App /> | ||
| <BrowserRouter> | ||
| <App /> | ||
| </BrowserRouter> | ||
| </StrictMode>, | ||
| ) | ||
| ) |
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.
Use dynamic viewport height to avoid mobile clipping/jump.
min-height: 100vhcan produce layout jumps on mobile browser UI changes. Add100dvhwith fallback.Proposed fix
.home-container, .notfound-container { - min-height: 100vh; + min-height: 100vh; + min-height: 100dvh;As per coding guidelines, "
**/*.css: ...adhere to best practices recommended by lighthouse or similar tools for performance."📝 Committable suggestion
🤖 Prompt for AI Agents