Skip to content

Commit 874e071

Browse files
authored
Merge pull request #46 from hack4impact-calpoly/41-mobile-frontend-mainpage
41 mobile frontend mainpage
2 parents 6d5214d + 6a098f4 commit 874e071

File tree

8 files changed

+279
-121
lines changed

8 files changed

+279
-121
lines changed

public/produce.jpg

-493 KB
Loading

public/produce_2.jpg

2.15 MB
Loading

src/app/page.tsx

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,31 @@ export default function Home() {
2121
<ReferralForm />
2222
</Suspense>
2323
</div>
24-
<div className={styles.heroImage}>
25-
<Image src="/produce.jpg" alt="Fresh Produce" width={600} height={600} layout="intrinsic" />
24+
<div className={styles.heroImageWrapper}>
25+
<Image
26+
src="/produce.jpg"
27+
alt="Fresh Produce"
28+
fill
29+
className={styles.heroImage}
30+
style={{ objectFit: "cover" }}
31+
/>
2632
</div>
2733
</section>
2834

2935
{/* Why Refer & Referral History */}
3036
<section className={styles.referralSection}>
3137
<div className={styles.leftSection}>
38+
<div className={styles.produceImageWrapper}>
39+
<Image
40+
src="/produce_2.jpg"
41+
alt="Fresh Produce"
42+
fill
43+
className={styles.produceImage}
44+
style={{ objectFit: "cover" }}
45+
/>
46+
</div>
47+
</div>
48+
<div className={styles.rightSection}>
3249
<h2>Why Should I Refer?</h2>
3350
<p>
3451
Each new member brings fresh ideas, helps us offer more events, and keeps our shelves stocked with an even
@@ -40,9 +57,6 @@ export default function Home() {
4057
bottles of wine, engraved bricks, and more.
4158
</p>
4259
</div>
43-
<div className={styles.rightSection}>
44-
<h2 className={styles.referralHistoryTitle}>Referral History</h2>
45-
</div>
4660
</section>
4761
</main>
4862
);
Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
/* Header.module.css */
21
.header {
32
width: 100%;
4-
height: 8vw; /* Adjust height as needed */
3+
height: 8vw;
54
background-color: white;
65
display: flex;
76
align-items: center;
8-
justify-content: flex-start; /* Align logo to the left */
9-
/* padding: 0 30px; Adjust horizontal padding as needed */
7+
justify-content: flex-start;
108
padding: 5vh;
119
padding-bottom: 5vh;
12-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); /* Optional, for a subtle shadow */
10+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
1311
}
1412

1513
.logoContainer {
@@ -19,6 +17,29 @@
1917

2018
.logo {
2119
height: 4vw;
22-
min-height: 60px; /* Adjust logo size as needed */
20+
min-height: 60px;
2321
width: auto;
2422
}
23+
24+
@media (max-width: 768px) {
25+
.header {
26+
background-image: linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)), url("/produce.jpg");
27+
height: auto;
28+
background-size: 100% auto;
29+
background-repeat: no-repeat;
30+
background-position: center;
31+
background-color: unset;
32+
padding: 60px 20px;
33+
box-shadow: none;
34+
}
35+
36+
.logo {
37+
height: auto;
38+
max-height: 50px;
39+
width: auto;
40+
}
41+
42+
.logoContainer {
43+
width: 100%;
44+
}
45+
}

src/components/Header/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const Header: React.FC = () => {
88
<div className={styles.logoContainer}>
99
{/* <img src="/logo.jpg" alt="Logo" className={styles.logo} /> */}
1010
<Image
11-
src="/logo.jpg"
11+
src="/assets/logo.png"
1212
alt="Logo"
1313
className={styles.logo}
1414
width={120} // Adjust based on your needs

src/components/ReferralForm/ReferralForm.module.css

Lines changed: 107 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
/* Container styling */
22
.container {
33
width: 100%;
4-
max-width: 800px; /* Adjusted max-width to fit more input fields */
5-
/* padding: 0.2rem; */
4+
max-width: 800px;
65
border: none;
76
border-radius: 1rem;
8-
box-sizing: border-box; /* Ensure padding is included in the container size */
7+
box-sizing: border-box;
98
display: flex;
109
flex-direction: column;
1110
justify-content: center;
12-
align-items: flex-start; /* Align items to the start */
11+
align-items: flex-start;
1312
}
1413

1514
/* Title styling */
@@ -25,17 +24,17 @@
2524
.form {
2625
display: flex;
2726
flex-direction: column;
28-
gap: 1.25rem;
27+
gap: 1.75rem;
2928
width: 100%;
3029
}
3130

3231
/* Input group layout */
33-
.inputGroup {
32+
.referrerEmail {
3433
display: flex;
3534
flex-direction: row;
36-
gap: 0.5rem; /* Reduced gap between input fields */
37-
align-items: flex-start; /* Align items to the left */
38-
margin-left: -0.4rem; /* Remove left margin */
35+
gap: 0.5rem;
36+
align-items: flex-start;
37+
width: 100%;
3938
}
4039

4140
/* Label styling */
@@ -48,12 +47,9 @@
4847

4948
/* Input field styling */
5049
.input {
51-
display: flex;
52-
width: 30%; /* Adjusted width to fit more input fields */
50+
flex: 1;
51+
min-width: 0; /* This ensures inputs can shrink below their content size */
5352
padding: 12px 18px;
54-
align-items: center;
55-
gap: 10px;
56-
flex-shrink: 0;
5753
border-radius: 8px;
5854
border: 2px solid var(--brown, #523018);
5955
background: #fff;
@@ -79,6 +75,7 @@
7975
background-color 0.2s,
8076
transform 0.1s;
8177
text-align: center;
78+
align-self: flex-end;
8279
}
8380

8481
/* Button hover and active effects */
@@ -105,37 +102,34 @@
105102
cursor: pointer;
106103
}
107104

108-
/* Delete button */
105+
/* Prospect container styling */
109106
.prospectContainer {
110107
position: relative;
111-
/* padding: 1px; */
112-
border: none;
113-
border-radius: 0px;
114-
margin-bottom: 1vh;
115108
display: flex;
116-
flex-direction: row; /* Changed to row to align input fields horizontally */
117-
gap: 0.2rem; /* Reduced gap between input fields */
118-
align-items: center; /* Align items to the center */
119-
/*margin-left: -0.5rem; /* Remove left margin */
109+
width: 100%;
110+
margin-bottom: 1vh;
120111
box-sizing: border-box;
112+
gap: 0.5rem;
121113
}
122114

123115
/* Scrollable prospect list */
124116
.prospectList {
117+
width: 100%;
125118
height: 15vh;
126-
max-height: 15vh; /* Adjust height as needed */
119+
max-height: 15vh;
127120
overflow-y: auto;
128121
}
129122

130123
.crossButton {
124+
display: flex;
131125
background: none;
132126
border: none;
133127
font-size: 18px;
134128
color: red;
135129
cursor: pointer;
136-
margin-top: 0.5rem; /* Add margin to the top of the delete button */
137-
margin-right: 0.5rem; /* Add margin to the right of the delete button */
138-
align-self: flex-start; /* Align the delete button to the start */
130+
/* margin-right: 10px; */
131+
margin-bottom: 0.75rem;
132+
align-self: flex-end;
139133
}
140134

141135
.crossButton:hover {
@@ -147,3 +141,89 @@
147141
font-weight: bold;
148142
margin-top: 10px;
149143
}
144+
145+
.inputFields {
146+
display: flex;
147+
flex-direction: column;
148+
width: 100%;
149+
gap: 0.5rem;
150+
}
151+
152+
.nameRow {
153+
display: flex;
154+
gap: 0.5rem;
155+
width: 100%;
156+
flex-wrap: wrap;
157+
}
158+
159+
/* .nameRow input {
160+
flex: 1;
161+
min-width: 120px;
162+
} */
163+
164+
.emailRow {
165+
display: flex;
166+
width: 100%;
167+
}
168+
169+
.emailRow input {
170+
width: 100%;
171+
}
172+
173+
/* Confirmation popup styling */
174+
.confirmationPopup {
175+
position: fixed;
176+
top: 0;
177+
left: 0;
178+
width: 100%;
179+
height: 100%;
180+
background-color: rgba(0, 0, 0, 0.5);
181+
display: flex;
182+
justify-content: center;
183+
align-items: center;
184+
z-index: 1000;
185+
}
186+
187+
.confirmationContent {
188+
background-color: white;
189+
padding: 20px;
190+
border-radius: 8px;
191+
text-align: center;
192+
}
193+
194+
.closeButton {
195+
margin-top: 10px;
196+
padding: 8px 16px;
197+
background-color: #831002;
198+
color: white;
199+
border: none;
200+
border-radius: 4px;
201+
cursor: pointer;
202+
}
203+
204+
/* When larger than mobile view */
205+
@media (min-width: 768px) {
206+
.inputFields {
207+
flex-direction: row;
208+
/* gap: 15px; */
209+
}
210+
211+
.nameRow {
212+
width: 60%;
213+
}
214+
215+
.emailRow {
216+
width: 40%;
217+
}
218+
219+
/* .crossButton {
220+
margin-bottom: 0;
221+
align-self: center;
222+
} */
223+
}
224+
225+
@media (max-width: 480px) {
226+
.nameRow {
227+
flex-direction: column;
228+
}
229+
}

src/components/ReferralForm/ReferralForm.tsx

Lines changed: 38 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export default function ReferralForm() {
134134
</div>
135135
)}
136136
<form onSubmit={handleSubmit} className={styles.form}>
137-
<div className={styles.inputGroup}>
137+
<div className={styles.referrerEmail}>
138138
<label htmlFor="yourEmail" className={styles.label}></label>
139139
<input
140140
id="yourEmail"
@@ -149,45 +149,52 @@ export default function ReferralForm() {
149149
<div className={styles.prospectList}>
150150
{prospects.map((prospect, index) => (
151151
<div key={index} className={styles.prospectContainer}>
152-
<label htmlFor={`prospectFirstName${index}`} className={styles.label}></label>
153-
<input
154-
id={`prospectFirstName${index}`}
155-
type="text"
156-
value={prospect.firstName}
157-
onChange={(e) => handleProspectChange(index, "firstName", e.target.value)}
158-
placeholder="Prospect's First Name"
159-
className={styles.input}
160-
/>
161-
<label htmlFor={`prospectLastName${index}`} className={styles.label}></label>
162-
<input
163-
id={`prospectLastName${index}`}
164-
type="text"
165-
value={prospect.lastName}
166-
onChange={(e) => handleProspectChange(index, "lastName", e.target.value)}
167-
placeholder="Prospect's Last Name"
168-
className={styles.input}
169-
/>
170-
<label htmlFor={`prospectEmail${index}`} className={styles.label}></label>
171-
<input
172-
id={`prospectEmail${index}`}
173-
type="email"
174-
value={prospect.email}
175-
onChange={(e) => handleProspectChange(index, "email", e.target.value)}
176-
placeholder="Prospect's Email Address"
177-
className={styles.input}
178-
/>
179152
<button type="button" onClick={() => deleteProspect(index)} className={styles.crossButton}>
180153
<Image src="/trash.png" alt="Delete" width={18} height={18} />
181154
</button>
155+
<div className={styles.inputFields}>
156+
<div className={styles.nameRow}>
157+
<label htmlFor={`prospectFirstName${index}`} className={styles.label}></label>
158+
<input
159+
id={`prospectFirstName${index}`}
160+
type="text"
161+
value={prospect.firstName}
162+
onChange={(e) => handleProspectChange(index, "firstName", e.target.value)}
163+
placeholder="Enter First Name"
164+
className={styles.input}
165+
/>
166+
<label htmlFor={`prospectLastName${index}`} className={styles.label}></label>
167+
<input
168+
id={`prospectLastName${index}`}
169+
type="text"
170+
value={prospect.lastName}
171+
onChange={(e) => handleProspectChange(index, "lastName", e.target.value)}
172+
placeholder="Enter Last Name"
173+
className={styles.input}
174+
/>
175+
</div>
176+
<div className={styles.emailRow}>
177+
<label htmlFor={`prospectEmail${index}`} className={styles.label}></label>
178+
<input
179+
id={`prospectEmail${index}`}
180+
type="email"
181+
value={prospect.email}
182+
onChange={(e) => handleProspectChange(index, "email", e.target.value)}
183+
placeholder="Enter Referee Email Address"
184+
className={styles.input}
185+
/>
186+
</div>
187+
</div>
182188
</div>
183189
))}
184190
</div>
185-
<button type="button" onClick={addProspect} className={styles.plusBox}>
186-
+
187-
</button>
188191
<button type="submit" className={styles.button}>
189192
Invite
190193
</button>
194+
<button type="button" onClick={addProspect} className={styles.plusBox}>
195+
+
196+
</button>
197+
191198
{errorMessage && <p className={styles.error}>{errorMessage}</p>}
192199
<input type="hidden" name="referrerEmail" value={referrerEmail} />
193200
<input type="hidden" name="referrerFirstName" value={referrerFirstName} />

0 commit comments

Comments
 (0)