-
Notifications
You must be signed in to change notification settings - Fork 0
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
Install React #11
Merged
Install React #11
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
8fdad93
feat: add nodejs to .tool-versions
mathcolo 731cec4
feat: add react, react-dom, react-router-dom
mathcolo e1a8035
remove stock typescript files
mathcolo 309b9ce
feat: add client-side home and help pages; test phoenix page
mathcolo fd84039
fix: add newline to end of .tool-versions
mathcolo 31a82b4
test: add test for Home
mathcolo 7abca47
refactor: rename PageController -> FrontendPageController
mathcolo 709e4df
put app.html.heex back
mathcolo 408d809
comment: avoid wildcard in router.ex
mathcolo 99b64d3
fix: remove phoenix page test
mathcolo ce3baf5
fix: @lemald feedback
mathcolo 51e0ebb
fix: override no-non-null-assertion
mathcolo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
elixir 1.16.1-otp-26 | ||
erlang 26.2.2 | ||
nodejs 20.14.0 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import "./phoenix.js"; | ||
import { App } from "./components/app.js"; | ||
import { createRoot } from "react-dom/client"; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const root = createRoot(document.getElementById("app")!); | ||
root.render(<App />); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Help } from "./help"; | ||
import { Home } from "./home"; | ||
import { ReactElement } from "react"; | ||
import { createBrowserRouter, RouterProvider } from "react-router-dom"; | ||
|
||
const router = createBrowserRouter([ | ||
{ | ||
path: "/", | ||
element: <Home />, | ||
}, | ||
{ | ||
path: "/help", | ||
element: <Help />, | ||
}, | ||
]); | ||
export const App = (): ReactElement => { | ||
return <RouterProvider router={router}></RouterProvider>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { ReactElement } from "react"; | ||
|
||
export const Help = (): ReactElement => { | ||
return ( | ||
<div className="w-1/2 m-10"> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod | ||
tempor incididunt ut labore et dolore magna aliqua. Orci eu lobortis | ||
elementum nibh tellus. In dictum non consectetur a erat nam at. At in | ||
tellus integer feugiat scelerisque varius. Pulvinar etiam non quam lacus | ||
suspendisse faucibus interdum posuere. Urna duis convallis convallis | ||
tellus id interdum velit laoreet. Sed turpis tincidunt id aliquet risus. | ||
Condimentum lacinia quis vel eros donec. Tincidunt augue interdum velit | ||
euismod. Metus aliquam eleifend mi in nulla posuere. At ultrices mi tempus | ||
imperdiet. Mattis pellentesque id nibh tortor id aliquet. Enim ut tellus | ||
elementum sagittis vitae et leo. Sed viverra tellus in hac. Sed sed risus | ||
pretium quam vulputate. Diam phasellus vestibulum lorem sed risus | ||
ultricies tristique nulla. Habitant morbi tristique senectus et netus et. | ||
Diam maecenas sed enim ut sem viverra aliquet. Nunc mi ipsum faucibus | ||
vitae aliquet nec. Dictum varius duis at consectetur lorem donec massa | ||
sapien faucibus. In dictum non consectetur a erat nam. Massa tempor nec | ||
feugiat nisl. Sagittis eu volutpat odio facilisis mauris sit amet. Massa | ||
placerat duis ultricies lacus sed turpis tincidunt id. Elit scelerisque | ||
mauris pellentesque pulvinar pellentesque habitant morbi tristique | ||
senectus. Tincidunt lobortis feugiat vivamus at augue eget arcu dictum. | ||
Sit amet luctus venenatis lectus magna. Et netus et malesuada fames ac | ||
turpis egestas. Pellentesque id nibh tortor id aliquet. Odio aenean sed | ||
adipiscing diam donec adipiscing. Viverra justo nec ultrices dui sapien. | ||
Venenatis lectus magna fringilla urna porttitor rhoncus dolor purus. Lacus | ||
suspendisse faucibus interdum posuere lorem. | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { ReactElement } from "react"; | ||
|
||
export const Home = (): ReactElement => { | ||
return ( | ||
<div className="text-3xl"> | ||
🪐 | ||
<span className="text-[#ED8B00]">O</span> | ||
<span className="text-[#DA291C]">r</span> | ||
<span className="text-[#003DA5]">b</span>it | ||
</div> | ||
); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Home } from "../../components/home"; | ||
import { render } from "@testing-library/react"; | ||
|
||
describe("home", () => { | ||
test("loads orbit placeholder", () => { | ||
const view = render(<Home />); | ||
expect(view.getByText(/🪐/)).toBeInTheDocument(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<noscript> | ||
You must enable JavaScript to view this page. | ||
</noscript> | ||
<div id="app"></div> | ||
<script src={~p"/assets/app.js"}> | ||
</script> |
2 changes: 1 addition & 1 deletion
2
lib/orbit_web/controllers/page_controller.ex → ...b/controllers/frontend_page_controller.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
defmodule OrbitWeb.FrontendPageHTML do | ||
use OrbitWeb, :html | ||
|
||
embed_templates "frontend_html/*" | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
praise: beautiful.
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.
This was all @skyqrose, I just brought it over to the react side. I agree, WD Sky!