-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c13de02
commit db36c01
Showing
21 changed files
with
4,149 additions
and
1,642 deletions.
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
Binary file not shown.
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
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,25 +1,22 @@ | ||
import logo from './logo.svg'; | ||
import './App.css'; | ||
import React from "react"; | ||
import College from "./College"; | ||
import CollegeShow from "./CollegeShow"; | ||
import { Switch, Route, Redirect } from "react-router"; | ||
|
||
function App() { | ||
return ( | ||
<div className="App"> | ||
<header className="App-header"> | ||
<img src={logo} className="App-logo" alt="logo" /> | ||
<p> | ||
Edit <code>src/App.js</code> and save to reload. | ||
</p> | ||
<a | ||
className="App-link" | ||
href="https://reactjs.org" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Learn React | ||
</a> | ||
</header> | ||
</div> | ||
); | ||
<Switch> | ||
<Route path='/colleges'> | ||
<College/> | ||
</Route> | ||
<Route path='colleges/:name'> | ||
<CollegeShow/> | ||
</Route> | ||
<Route path='/'> | ||
<Redirect to='/colleges'/> | ||
</Route> | ||
</Switch> | ||
) | ||
} | ||
|
||
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,42 @@ | ||
import React from 'react' | ||
import Grid from "@material-ui/core/Grid"; | ||
import CollegeSelect from "./CollegeSelect"; | ||
import CollegePreview from "./CollegePreview"; | ||
import Typography from "@material-ui/core/Typography"; | ||
import { makeStyles } from "@material-ui/core/styles"; | ||
|
||
const useStyles = makeStyles((theme) => ({ | ||
root: { | ||
flexGrow: 1, | ||
textAlign: "center", | ||
}, | ||
})); | ||
|
||
function College() { | ||
const classes = useStyles(); | ||
const [results, setResults] = React.useState({results: []}); | ||
|
||
|
||
return ( | ||
<Grid container className={classes.root} spacing={2}> | ||
<Grid item xs={12}> | ||
<Typography gutterBottom variant='h2' component='h1'> | ||
Select Colleges | ||
</Typography> | ||
<Grid container justify='center' spacing={2}> | ||
<CollegeSelect setResults={setResults} /> | ||
</Grid> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<Typography gutterBottom variant='h2' component='h1'> | ||
Results : | ||
</Typography> | ||
<Grid container justify='center' spacing={2}> | ||
<CollegePreview results={results} /> | ||
</Grid> | ||
</Grid> | ||
</Grid> | ||
); | ||
} | ||
|
||
export default College |
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,93 @@ | ||
import React from "react"; | ||
import Card from "@material-ui/core/Card"; | ||
import Grid from "@material-ui/core/Grid"; | ||
import { useHistory } from "react-router-dom"; | ||
import Typography from "@material-ui/core/Typography"; | ||
import { makeStyles } from "@material-ui/core/styles"; | ||
import CardContent from "@material-ui/core/CardContent"; | ||
|
||
const useStyles = makeStyles((theme) => ({ | ||
grid: { | ||
display: "flex", | ||
padding: theme.spacing(6), | ||
justifyContent: "center", | ||
alignItems: "center", | ||
textAlign: "center", | ||
}, | ||
media: { | ||
justifyContent: "center", | ||
alignItems: "center", | ||
textAlign: "center", | ||
}, | ||
})); | ||
|
||
export default function CollegePreview({results}) { | ||
const classes = useStyles(); | ||
const history = useHistory(); | ||
|
||
if (!results) { | ||
return (<div>No Results</div>) | ||
} | ||
|
||
// const handleClick = (college) => { | ||
// const name = college.name.split(" ").join("") | ||
// history.push(`/colleges/${name}`) | ||
// }; | ||
//debugger | ||
const content = results.results.map((college) => | ||
{ | ||
const{ admission_rate, | ||
avg_tuition, | ||
city, | ||
schoolname, | ||
state, | ||
student_pop, | ||
url} = college | ||
|
||
return ( | ||
<Grid spacing={4} className={classes.grid}> | ||
<Card className={classes.media}> | ||
<CardContent> | ||
<Typography gutterBottom variant='h5' component='h2'> | ||
{schoolname} | ||
</Typography> | ||
<Typography variant='body1' color='textSecondary' component='p'> | ||
College Location State : {state} | ||
</Typography> | ||
<Typography variant='body1' color='textSecondary' component='p'> | ||
College Location City : {city} | ||
</Typography> | ||
<Typography variant='body1' color='textSecondary' component='p'> | ||
College Admision Rate : {admission_rate} | ||
</Typography> | ||
<Typography variant='body1' color='textSecondary' component='p'> | ||
College Average Tuition Cost : {avg_tuition} | ||
</Typography> | ||
<Typography variant='body1' color='textSecondary' component='p'> | ||
College Student Population : {student_pop} | ||
</Typography> | ||
<Typography variant='body1' color='textSecondary' component='p'> | ||
College URL : {url} | ||
</Typography> | ||
</CardContent> | ||
</Card> | ||
</Grid> | ||
); | ||
} | ||
); | ||
|
||
|
||
|
||
|
||
return content; | ||
|
||
} | ||
|
||
|
||
{ | ||
/* <CardActions> | ||
<Button onClick={() => handleClick(college)} size='small' color='primary'> | ||
Learn More | ||
</Button> | ||
</CardActions> */ | ||
} |
Oops, something went wrong.