Skip to content

Commit 018b1c8

Browse files
Merge pull request #209 from googleinterns/home-page-styles
Search view styles
2 parents 0370023 + efcb21d commit 018b1c8

File tree

7 files changed

+35
-11
lines changed

7 files changed

+35
-11
lines changed

frontend/src/RouteView.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,11 @@ function RouteView({ loggedIn, userEmail }) {
9797
<Row className={styles.row}>
9898
<Col sm={4}>
9999
<Row className={styles.row}>
100-
<TripName tripObject={tripObject} setTripObject={setTripObject} />
100+
<TripName
101+
tripObject={tripObject}
102+
setTripObject={setTripObject}
103+
setIsSaved={setIsSaved}
104+
/>
101105
</Row>
102106
<Row className={styles.routeListContainer}>
103107
<Route places={attractions} onManualPlaceChange={onManualPlaceChange} />

frontend/src/SearchView.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import SavedTrips from './saved-trips/SavedTrips.js';
33
import Search from './search/Search.js';
44
import styles from './SearchView.module.css';
5+
import traveler from './traveler.svg';
56

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

2223
return (
2324
<div className={styles.container}>
24-
<div>
25-
<Search />
26-
{savedTrips}
27-
</div>
25+
<Search />
26+
{savedTrips}
27+
<img src={traveler} className={styles.illustration} alt="traveler graphic" />
2828
</div>
2929
);
3030
}

frontend/src/SearchView.module.css

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
.container {
22
height: 100%;
3-
margin: 15vh auto;
3+
margin: auto;
4+
margin-top: 15vh;
45
max-width: 1400px;
6+
text-align: center;
57
}
68

79
.noTrips {
810
color: var(--gray);
11+
height: 42vh;
912
margin-top: 32px;
1013
text-align: center;
1114
}
15+
16+
.illustration {
17+
height: 220px;
18+
}

frontend/src/navbar/Navbar.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@
2525

2626
.gRoutesLogo {
2727
height: 50px;
28-
margin-left: 12px;
28+
margin-left: 24px;
2929
}

frontend/src/saved-trips/SavedTrips.module.css

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
.container {
2+
height: 42vh;
23
margin: auto;
34
margin-top: 48px;
45
width: 80%;
6+
overflow-y: scroll;
57
}
68

79
.header {
810
color: var(--gray);
9-
margin-bottom: 12px;
11+
margin-bottom: 24px;
12+
text-align: left;
1013
}
1114

1215
.headerIcon {
13-
color: var(--blue);
14-
margin-right: 16px;
16+
color: var(--yellow);
17+
margin: 0 16px;
1518
opacity: 0.8;
1619
}
1720

@@ -37,10 +40,17 @@
3740
}
3841

3942
.listItem {
43+
align-items: center;
4044
display: flex;
45+
font-weight: 500;
4146
justify-content: space-between;
47+
height: 60px;
4248
}
4349

4450
.tripContainer {
51+
border-radius: 10px;
52+
box-shadow: 0 1px 2px #c7c7c7;
53+
margin-bottom: 16px;
4554
position: relative;
55+
overflow: hidden;
4656
}

frontend/src/traveler.svg

Lines changed: 1 addition & 0 deletions
Loading

frontend/src/trip-name/TripName.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,17 @@ import styles from './TripName.module.css';
1010
* Returns the trip name component that the user can edit and save.
1111
* @param {object} tripObject json object with all trip data
1212
* @param {function} setTripObject function to update tripObject
13+
* @param {function} setIsSaved function to set saving status of trip
1314
*/
14-
function TripName({ tripObject, setTripObject }) {
15+
function TripName({ tripObject, setTripObject, setIsSaved }) {
1516
const [isEditing, setIsEditing] = useState(false);
1617
const [name, setName] = useState(tripObject.tripName);
1718

1819
function handleSave(e) {
1920
e.preventDefault();
2021
setIsEditing(false);
2122
setTripObject({ ...tripObject, tripName: name });
23+
setIsSaved(false);
2224
}
2325

2426
function handleChange(e) {

0 commit comments

Comments
 (0)