Skip to content

Commit

Permalink
Merge pull request #209 from googleinterns/home-page-styles
Browse files Browse the repository at this point in the history
Search view styles
  • Loading branch information
Cindyzhang977 authored Aug 7, 2020
2 parents 0370023 + efcb21d commit 018b1c8
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 11 deletions.
6 changes: 5 additions & 1 deletion frontend/src/RouteView.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ function RouteView({ loggedIn, userEmail }) {
<Row className={styles.row}>
<Col sm={4}>
<Row className={styles.row}>
<TripName tripObject={tripObject} setTripObject={setTripObject} />
<TripName
tripObject={tripObject}
setTripObject={setTripObject}
setIsSaved={setIsSaved}
/>
</Row>
<Row className={styles.routeListContainer}>
<Route places={attractions} onManualPlaceChange={onManualPlaceChange} />
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/SearchView.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import SavedTrips from './saved-trips/SavedTrips.js';
import Search from './search/Search.js';
import styles from './SearchView.module.css';
import traveler from './traveler.svg';

/**
* Creates Search View component, with saved trips rendered if user is logged in.
Expand All @@ -21,10 +22,9 @@ function SearchView({ loggedIn, tripIds }) {

return (
<div className={styles.container}>
<div>
<Search />
{savedTrips}
</div>
<Search />
{savedTrips}
<img src={traveler} className={styles.illustration} alt="traveler graphic" />
</div>
);
}
Expand Down
9 changes: 8 additions & 1 deletion frontend/src/SearchView.module.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
.container {
height: 100%;
margin: 15vh auto;
margin: auto;
margin-top: 15vh;
max-width: 1400px;
text-align: center;
}

.noTrips {
color: var(--gray);
height: 42vh;
margin-top: 32px;
text-align: center;
}

.illustration {
height: 220px;
}
2 changes: 1 addition & 1 deletion frontend/src/navbar/Navbar.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@

.gRoutesLogo {
height: 50px;
margin-left: 12px;
margin-left: 24px;
}
16 changes: 13 additions & 3 deletions frontend/src/saved-trips/SavedTrips.module.css
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
.container {
height: 42vh;
margin: auto;
margin-top: 48px;
width: 80%;
overflow-y: scroll;
}

.header {
color: var(--gray);
margin-bottom: 12px;
margin-bottom: 24px;
text-align: left;
}

.headerIcon {
color: var(--blue);
margin-right: 16px;
color: var(--yellow);
margin: 0 16px;
opacity: 0.8;
}

Expand All @@ -37,10 +40,17 @@
}

.listItem {
align-items: center;
display: flex;
font-weight: 500;
justify-content: space-between;
height: 60px;
}

.tripContainer {
border-radius: 10px;
box-shadow: 0 1px 2px #c7c7c7;
margin-bottom: 16px;
position: relative;
overflow: hidden;
}
1 change: 1 addition & 0 deletions frontend/src/traveler.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion frontend/src/trip-name/TripName.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ import styles from './TripName.module.css';
* Returns the trip name component that the user can edit and save.
* @param {object} tripObject json object with all trip data
* @param {function} setTripObject function to update tripObject
* @param {function} setIsSaved function to set saving status of trip
*/
function TripName({ tripObject, setTripObject }) {
function TripName({ tripObject, setTripObject, setIsSaved }) {
const [isEditing, setIsEditing] = useState(false);
const [name, setName] = useState(tripObject.tripName);

function handleSave(e) {
e.preventDefault();
setIsEditing(false);
setTripObject({ ...tripObject, tripName: name });
setIsSaved(false);
}

function handleChange(e) {
Expand Down

0 comments on commit 018b1c8

Please sign in to comment.