-
Notifications
You must be signed in to change notification settings - Fork 2
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 #17 from aj-rom/seperate-neo-concerns
Separate neo concerns #8
- Loading branch information
Showing
20 changed files
with
368 additions
and
289 deletions.
There are no files selected for viewing
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,22 @@ | ||
env: | ||
browser: true | ||
es2021: true | ||
extends: | ||
- "eslint:recommended" | ||
- "next" | ||
parserOptions: | ||
ecmaVersion: 12 | ||
sourceType: module | ||
rules: | ||
camelcase: off | ||
linebreak-style: off | ||
object-curly-spacing: | ||
- error | ||
- "always" | ||
require-jsdoc: off | ||
semi: ["error", "never"] | ||
no-invalid-this: off | ||
max-len: | ||
- error | ||
- ignoreStrings: true |
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
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,11 +1,11 @@ | ||
import styles from './Error.module.css' | ||
|
||
export default function Error(props) { | ||
const { error } = props | ||
const { error } = props | ||
|
||
return ( | ||
<div className={styles.error}> | ||
{ error } | ||
</div> | ||
) | ||
} | ||
return ( | ||
<div className={styles.error}> | ||
{ error } | ||
</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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import footerStyles from "./Footer.module.css"; | ||
import footerStyles from './Footer.module.css' | ||
|
||
export default function Footer() { | ||
return ( | ||
<footer className={footerStyles.footer}> | ||
return ( | ||
<footer className={footerStyles.footer}> | ||
Made by <a href='https://github.com/aj-rom'>A.J. Romaniello</a> | <a href='https://github.com/aj-rom/neow-browser'>Source Code</a> | ||
<br/> | ||
<br/> | ||
API Services by <a href='https://github.com/SpaceRocks/'>The SpaceRocks Team</a> | ||
</footer> | ||
) | ||
} | ||
</footer> | ||
) | ||
} |
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,12 +1,11 @@ | ||
import styles from './Loading.module.css' | ||
|
||
export default function Loading() { | ||
return ( | ||
|
||
return ( | ||
|
||
<div id='loading' className={styles.center}> | ||
<div className={styles.loading}/> | ||
<p>Loading</p> | ||
</div> | ||
) | ||
} | ||
<div id='loading' className={styles.center}> | ||
<div className={styles.loading}/> | ||
<p>Loading</p> | ||
</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 |
---|---|---|
@@ -1,19 +1,18 @@ | ||
import Head from 'next/head' | ||
|
||
export default function Meta(props) { | ||
function getMeta() { | ||
const { meta } = props | ||
|
||
function getMeta() { | ||
const { meta } = props | ||
return Object.entries(meta).map( (arr, idx) => { | ||
return <meta key={idx} name={arr[0]} content={arr[1]}/> | ||
}) | ||
} | ||
|
||
return Object.entries(meta).map( (arr, idx) => { | ||
return <meta key={idx} name={arr[0]} content={arr[1]}/> | ||
}) | ||
} | ||
|
||
return ( | ||
<Head> | ||
<title>NeoW Browser - {props.title}</title> | ||
{getMeta()} | ||
</Head> | ||
) | ||
} | ||
return ( | ||
<Head> | ||
<title>NeoW Browser - {props.title}</title> | ||
{getMeta()} | ||
</Head> | ||
) | ||
} |
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 BootstrapTable from '../Table/Table' | ||
|
||
export default function CloseApproachTable(props) { | ||
function renderTableBody() { | ||
return props.data.map((e, idx) => { | ||
return ( | ||
<tr key={idx}> | ||
<td>{e.close_approach_date}</td> | ||
<td>{e.orbiting_body}</td> | ||
<td>{e.relative_velocity.kilometers_per_second}</td> | ||
<td>{e.miss_distance.lunar}</td> | ||
</tr> | ||
) | ||
}) | ||
} | ||
|
||
return ( | ||
<BootstrapTable> | ||
<thead> | ||
<tr> | ||
<th>Date</th> | ||
<th>Orbiting</th> | ||
<th>Relative Velocity (km/s)</th> | ||
<th>Miss Distance (lunar)</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{ renderTableBody() } | ||
</tbody> | ||
</BootstrapTable> | ||
) | ||
} |
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,47 @@ | ||
import BootstrapTable from '../Table/Table' | ||
|
||
export default function DiameterTable(props) { | ||
const { feet, meters, kilometers, miles } = props.diameter | ||
|
||
function getMin(unit) { | ||
return unit.estimated_diameter_min | ||
} | ||
|
||
function getMax(unit) { | ||
return unit.estimated_diameter_max | ||
} | ||
|
||
return ( | ||
<BootstrapTable> | ||
<thead> | ||
<tr> | ||
<th>Unit</th> | ||
<th>Min</th> | ||
<th>Max</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>ft</td> | ||
<td>{getMin(feet)}</td> | ||
<td>{getMax(feet)}</td> | ||
</tr> | ||
<tr> | ||
<td>meters</td> | ||
<td>{getMin(meters)}</td> | ||
<td>{getMax(meters)}</td> | ||
</tr> | ||
<tr> | ||
<td>km</td> | ||
<td>{getMin(kilometers)}</td> | ||
<td>{getMax(kilometers)}</td> | ||
</tr> | ||
<tr> | ||
<td>miles</td> | ||
<td>{getMin(miles)}</td> | ||
<td>{getMax(miles)}</td> | ||
</tr> | ||
</tbody> | ||
</BootstrapTable> | ||
) | ||
} |
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,85 +1,42 @@ | ||
import styles from './NEO.module.css' | ||
import BootstrapTable from "../Table/Table" | ||
import DiameterTable from './DiameterTable' | ||
import CloseApproachTable from './CloseApproachTable' | ||
|
||
export default function NEO(props) { | ||
const { data } = props | ||
const { | ||
absolute_magnitude_h, | ||
is_sentry_object, | ||
is_potentially_hazardous_asteroid, | ||
close_approach_data, | ||
estimated_diameter, | ||
} = data | ||
|
||
const { data } = props | ||
const diameter = data.estimated_diameter | ||
|
||
return ( | ||
<article className={styles.neo}> | ||
<header> | ||
<h5 className={styles.h6}>{data.name}</h5> | ||
<p> | ||
return ( | ||
<article className={styles.neo}> | ||
<header> | ||
<h5 className={styles.h6}>{data.name}</h5> | ||
<p> | ||
| <a href={data.links.self}>API Response</a> | | ||
</p> | ||
</header> | ||
<details> | ||
<summary>More Info</summary> | ||
<ul> | ||
<li><b>ID</b>: {data.id}</li> | ||
<li><b>Absolute Magnitude</b>: {data.absolute_magnitude_h}</li> | ||
<li><b>Sentry Object</b>: {data.is_sentry_object.toString()}</li> | ||
<li><b>Hazardous</b>: {data.is_potentially_hazardous_asteroid.toString()}</li> | ||
</ul> | ||
</p> | ||
</header> | ||
<details> | ||
<summary>More Info</summary> | ||
<ul> | ||
<li><b>ID</b>: {data.id}</li> | ||
<li><b>Absolute Magnitude</b>: {absolute_magnitude_h}</li> | ||
<li><b>Sentry Object</b>: {is_sentry_object.toString()}</li> | ||
<li> | ||
<b>Hazardous</b>: {is_potentially_hazardous_asteroid.toString()} | ||
</li> | ||
</ul> | ||
|
||
<h6 className={styles.h6}>Estimated Diameter</h6> | ||
<BootstrapTable striped bordered hover> | ||
<thead> | ||
<tr> | ||
<th>Unit</th> | ||
<th>Min</th> | ||
<th>Max</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>ft</td> | ||
<td>{diameter.feet.estimated_diameter_min}</td> | ||
<td>{diameter.feet.estimated_diameter_max}</td> | ||
</tr> | ||
<tr> | ||
<td>meters</td> | ||
<td>{diameter.meters.estimated_diameter_min}</td> | ||
<td>{diameter.meters.estimated_diameter_max}</td> | ||
</tr> | ||
<tr> | ||
<td>km</td> | ||
<td>{diameter.kilometers.estimated_diameter_min}</td> | ||
<td>{diameter.kilometers.estimated_diameter_max}</td> | ||
</tr> | ||
<tr> | ||
<td>miles</td> | ||
<td>{diameter.miles.estimated_diameter_min}</td> | ||
<td>{diameter.miles.estimated_diameter_max}</td> | ||
</tr> | ||
</tbody> | ||
</BootstrapTable> | ||
<h6 className={styles.h6}>Estimated Diameter</h6> | ||
<DiameterTable diameter={estimated_diameter}/> | ||
|
||
<h6 className={styles.h6}>Close Approach Data</h6> | ||
<BootstrapTable> | ||
<thead> | ||
<tr> | ||
<th>Date</th> | ||
<th>Orbiting</th> | ||
<th>Relative Velocity (km/s)</th> | ||
<th>Miss Distance (lunar)</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{data.close_approach_data.map((e, idx) => { | ||
return ( | ||
<tr key={idx}> | ||
<td>{e.close_approach_date}</td> | ||
<td>{e.orbiting_body}</td> | ||
<td>{e.relative_velocity.kilometers_per_second}</td> | ||
<td>{e.miss_distance.lunar}</td> | ||
</tr> | ||
) | ||
})} | ||
</tbody> | ||
</BootstrapTable> | ||
</details> | ||
</article> | ||
) | ||
} | ||
<h6 className={styles.h6}>Close Approach Data</h6> | ||
<CloseApproachTable data={close_approach_data}/> | ||
</details> | ||
</article> | ||
) | ||
} |
Oops, something went wrong.
22f0484
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.
Successfully deployed to the following URLs: