-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from linz/convert_to_typescript
Convert to typescript
- Loading branch information
Showing
19 changed files
with
25,888 additions
and
11,348 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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,33 +1,33 @@ | ||
.App { | ||
text-align: center; | ||
text-align: center; | ||
} | ||
|
||
.App-logo { | ||
animation: App-logo-spin infinite 20s linear; | ||
height: 40vmin; | ||
pointer-events: none; | ||
animation: App-logo-spin infinite 20s linear; | ||
height: 40vmin; | ||
pointer-events: none; | ||
} | ||
|
||
.App-header { | ||
background-color: #282c34; | ||
min-height: 100vh; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: calc(10px + 2vmin); | ||
color: white; | ||
background-color: #282c34; | ||
min-height: 100vh; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: calc(10px + 2vmin); | ||
color: white; | ||
} | ||
|
||
.App-link { | ||
color: #61dafb; | ||
color: #61dafb; | ||
} | ||
|
||
@keyframes App-logo-spin { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} |
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 React from 'react'; | ||
import {render, screen} from '@testing-library/react'; | ||
import App from './App'; | ||
|
||
test('renders landing page', () => { | ||
render(<App/>); | ||
const landingPageText = screen.getByText(/Welcome to LandOnLite/i); | ||
expect(landingPageText).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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import React from "react"; | ||
import {BrowserRouter, Link, Route, Routes} from "react-router-dom"; | ||
import TitleSearch from "./TitleSearch"; | ||
import {TitlePage} from "./components/TitlePage"; | ||
|
||
|
||
function App() { | ||
return ( | ||
<div style={{margin: "15px"}}> | ||
<BrowserRouter> | ||
<Routes> | ||
<Route path="/" element={<Home/>}/> | ||
<Route path="/titles/:titleNo" element={<TitlePageWrapper/>}/> | ||
</Routes> | ||
</BrowserRouter> | ||
</div> | ||
); | ||
} | ||
|
||
export function Home() { | ||
return ( | ||
<div style={{position: "relative"}}> | ||
<div style={{ | ||
position: "fixed", | ||
top: "40%", | ||
left: "50%", | ||
transform: "translate(-50%, -50%)", | ||
border: "1px solid #dee2e6", | ||
padding: "50px" | ||
}}> | ||
<h3>Welcome to LandOnLite</h3> | ||
<p>You can enter a title number (e.g. "1") to view it.</p> | ||
<TitleSearch/> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export function TitlePageWrapper() { | ||
return ( | ||
<div> | ||
<div> | ||
<Link style={{marginRight: "10px"}} to="/">< Home</Link> | ||
<TitleSearch/> | ||
</div> | ||
<hr/> | ||
<TitlePage/> | ||
</div> | ||
); | ||
} | ||
|
||
export default App; |
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,30 @@ | ||
import React, {useState} from 'react'; | ||
import {Button, Col, Form, Input, Row} from "reactstrap"; | ||
import {useNavigate} from "react-router"; | ||
|
||
export default function TitleSearch() { | ||
|
||
const [value, setValue] = useState('') | ||
const navigate = useNavigate() | ||
|
||
function handleChange(e: any) { | ||
setValue(e.target.value) | ||
} | ||
|
||
function handleSubmit() { | ||
navigate(`/titles/${value}`); | ||
} | ||
|
||
return ( | ||
<div style={{display: "inline-block"}}> | ||
<Form onSubmit={handleSubmit}> | ||
<Row className="row-cols-lg-auto g-3 align-items-center"> | ||
<Col><Input type="text" value={value} onChange={handleChange} | ||
placeholder="Enter a title number"/></Col> | ||
<Col><Button color="primary" type="submit" value="Submit">Go</Button></Col> | ||
</Row> | ||
|
||
</Form> | ||
</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,9 @@ | ||
import React from 'react'; | ||
import {render, screen} from '@testing-library/react'; | ||
import {TitlePage} from "./TitlePage"; | ||
|
||
test('renders landing page', () => { | ||
render(<TitlePage/>); | ||
const titleText = screen.getByText(/Title #/i); | ||
expect(titleText).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 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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", | ||
margin: 0; | ||
padding: 0; | ||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", | ||
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", | ||
sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
} | ||
|
||
code { | ||
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", | ||
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", | ||
monospace; | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.