Skip to content

Commit 76d0b92

Browse files
committed
account page adjusted
1 parent bb856f7 commit 76d0b92

File tree

6 files changed

+82
-21
lines changed

6 files changed

+82
-21
lines changed

public/styles/delete-checkin.css

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ body {
1616
background-color: #ffffff;
1717
margin-top: 6em;
1818
height: 320px;
19+
width: 650px;
1920
border-radius: 6px;
2021
padding: 1em;
2122
box-sizing: border-box;

public/styles/settings.css

+12-9
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ button:hover {
125125
}
126126

127127
.settings-section#password-section {
128-
display: inline-block;
128+
/* display: inline-block; */
129+
display: grid;
130+
grid-template-columns: 1fr 1fr;
129131
margin-left: 16px;
130132
}
131133

@@ -135,6 +137,7 @@ button:hover {
135137
font-size: 18px;
136138
color: #000000;
137139
font-weight: 600;
140+
margin-bottom: 60px;
138141
}
139142

140143
.password-form{
@@ -144,7 +147,7 @@ button:hover {
144147
}
145148

146149
.form-group#password {
147-
margin-left: 30px;
150+
margin-left: 24px;
148151
}
149152

150153
.form-group#password input {
@@ -157,14 +160,13 @@ button:hover {
157160
}
158161

159162
.form-group#new-password input {
160-
width: 250px;
163+
width: 236px;
161164
border: 1px solid #e2e2e2;
162165
}
163166

164-
/* .btn.password-btn {
165-
display: flex;
166-
justify-content: center;
167-
} */
167+
.btn__password-container {
168+
margin-right: 90px;
169+
}
168170

169171
.settings-section#delete-section {
170172
display: inline-block;
@@ -179,7 +181,7 @@ button:hover {
179181
font-weight: 600;
180182
}
181183

182-
h4.delete-account {
184+
h3.delete-account {
183185
margin-left: 16px;
184186
}
185187

@@ -192,10 +194,11 @@ h4.delete-account {
192194
display: flex;
193195
flex-wrap: wrap;
194196
padding: 1em;
197+
margin-left: 165px;
195198
}
196199

200+
197201
#delete-password.form-control {
198-
display: inline-block;
199202
width: 250px;
200203
background-color: #ffffff;
201204
border: 1px solid #e2e2e2;

utils/demo.js

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// const logInForm = document.querySelector(".log-in-form");
2+
// logInForm.addEventListener("submit", async (e) => {
3+
// e.preventDefault();
4+
// const formData = new FormData(logInForm);
5+
// const email = formData.get("email");
6+
// const password = formData.get("password");
7+
// const body = { email, password };
8+
// try {
9+
// const res = await fetch(`${process.env.BACKEND_URL}/users/token`, {
10+
// method: "POST",
11+
// body: JSON.stringify(body),
12+
// headers: {
13+
// "Content-Type": "application/json",
14+
// },
15+
// });
16+
// if (!res.ok) {
17+
// throw res;
18+
// }
19+
// const {
20+
// token,
21+
// user: { id },
22+
// } = await res.json();
23+
24+
// localStorage.setItem("TAPPDIN_ACCESS_TOKEN", token);
25+
// localStorage.setItem("TAPPDIN_CURRENT_USER_ID", id);
26+
27+
// window.location.href = "/";
28+
// } catch (err) {
29+
// if (err.status >= 400 && err.status < 600) {
30+
// const errorJSON = await err.json();
31+
// const errorsContainer = document.querySelector(".errors-container");
32+
// let errorsHtml = [
33+
// `
34+
// <div class="alert alert-danger">
35+
// Something went wrong. Please try again.
36+
// </div>
37+
// `,
38+
// ];
39+
// const { errors } = errorJSON;
40+
// if (errors && Array.isArray(errors)) {
41+
// errorsHtml = errors.map(
42+
// (message) => `
43+
// <div class="alert alert-danger">
44+
// ${message}
45+
// </div>
46+
// `
47+
// );
48+
// }
49+
// errorsContainer.innerHTML = errorsHtml.join("");
50+
// } else {
51+
// alert(
52+
// "Something went wrong. Please check your internet connection and try again!"
53+
// );
54+
// }
55+
// }
56+
// });

views/checkin.pug

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
1-
//-
1+
//-
22
mixin checkin(checkin)
33
.checkin
4-
head
4+
head
55
link(rel="stylesheet" type="text/css" href="/styles/checkin.css")
66
img.checkin__profile-picture(src=checkin.User.photo)
77
.checkin__main
88
p #[a(href=`/users/${checkin.User.id}`) #{checkin.User.firstName} #{checkin.User.lastName}] drank #[a(href=`/beers/${checkin.Beer.id}`) #{checkin.Beer.name}] from #[a(href=`/breweries/${checkin.Beer.Brewery.id}`) #{checkin.Beer.Brewery.name}]
99
.checkin__rating
10-
p Rating:
10+
p Rating:
1111
span.checkin__rating-val=checkin.displayRating
1212
//-created from the script
1313
if checkin.comment
1414
p=checkin.comment
15-
else
15+
else
1616
p No comment
1717
div.checkin__other-info
1818
span.checkin__date=checkin.createdAt
19-
if checkin.isSessionUser
20-
span.checkin__delete #[a(href=`/checkins/${checkin.id}/delete`) Delete checkin]
19+
if checkin.isSessionUser
20+
span.checkin__delete #[a(href=`/checkins/${checkin.id}/delete`) Delete check-in]
2121
img.checkin__profile-picture(src=checkin.Beer.Brewery.image)
22-

views/log-in.pug

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ block content
1212
p.log-in__quote Drink Responsibly
1313
form(class="log-in-form" method="post" action="/users/log-in")
1414
include form-elements.pug
15-
button.btn.btn-primary(type='submit') Log In
16-
button.btn.btn-demo(type='submit') Demo
15+
button.btn.btn-primary#login(type='submit') Log In
16+
button.btn.btn-primary#demo(type='submit') Demo
1717
a(href='/sign-up') Don't have an account? Sign up here.
18-
//- script(src="js/log-in.js")
18+
//- script(src="js/demo.js")
1919
2020
//- include footer

views/settings.pug

+4-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ block content
4848
.form-group#new-password
4949
label(for='new-password') New Password
5050
input#new-password.form-control(type="password" name='newPassword')
51-
button.btn.password-btn(type="submit") Change Password
51+
.btn__password-container
52+
button.btn.password-btn(type="submit") Change Password
5253
//- .settings-section#social-section
5354
//- p.social__section-title Social Connections
5455
//- ul.social-connect
@@ -69,4 +70,5 @@ block content
6970
.form-group#delete
7071
label(for='confirmDeletePassword') Confirm Password
7172
input#delete-password.form-control(type='password' name='confirmDeletePassword')
72-
button.btn.delete-account-btn Delete Account
73+
.btn__delete-container
74+
button.btn.delete-account-btn Delete Account

0 commit comments

Comments
 (0)