Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
chochohee committed Dec 23, 2024
2 parents 408a514 + 8f58230 commit edaedeb
Show file tree
Hide file tree
Showing 19 changed files with 77 additions and 57 deletions.
3 changes: 2 additions & 1 deletion src/app/account/modify-password/ModifyPassword.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
font-size: var(--h2-font-size);
font-weight: 600;
margin-bottom: 2rem;
color: #333;
color: var(--black-font-color);
}

.password-form {
background: var(--background-white);
padding: 2rem;
border-radius: 1rem;
filter: drop-shadow(6px 6px 9.4px rgba(0, 0, 0, 0.15));
color: var(--black-font-color);
}

.form-fieldset {
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/account/modify/route.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// /api/account/profile/route.js
// /api/account/modify/route.js

import { headers } from "next/headers";
import { db } from "@/lib/firebase";
Expand Down
2 changes: 2 additions & 0 deletions src/app/api/auth/update-email/route.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// api/auth/update-email/route.js

import { auth, db } from "@/lib/firebaseAdmin";
import { getFirestore, Timestamp } from "firebase-admin/firestore";

Expand Down
2 changes: 2 additions & 0 deletions src/app/api/comment/create/[postId]/route.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// api/comment/create/[postId]/route.js

import { headers } from "next/headers";
import {
doc,
Expand Down
2 changes: 2 additions & 0 deletions src/app/api/comment/delete/[postId]/route.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// api/comment/delete/[postId]/route.js

import { headers } from "next/headers";
import { doc, getDoc, updateDoc } from "firebase/firestore";

Expand Down
2 changes: 2 additions & 0 deletions src/app/api/comment/read/[postId]/route.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// api/comment/read/[postId]/route.js

import { headers } from "next/headers";
import { doc, getDoc } from "firebase/firestore";
import { db } from "@/lib/firebase";
Expand Down
2 changes: 2 additions & 0 deletions src/app/api/join/check-userid/route.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// api/join/check-userid/route.js

import { db } from "@/lib/firebase";
import { collection, query, where, getDocs } from "firebase/firestore";

Expand Down
2 changes: 2 additions & 0 deletions src/app/api/post/feeds/route.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//api/post/feeds/route.js

import { headers } from "next/headers";
import { NextResponse } from "next/server";
import { db } from "@/lib/firebase";
Expand Down
2 changes: 2 additions & 0 deletions src/app/api/post/spark/[postId]/route.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// api/post/spark/[postId]/route.js

import { headers } from "next/headers";
import {
doc,
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/post/update/[postId]/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export async function POST(request, { params }) {
moods.some((mood) => !moodIds.includes(mood))
) {
return new Response(
JSON.stringify({ error: "유효하지 않은 장르 또는 느낌입니���." }),
JSON.stringify({ error: "유효하지 않은 장르 또는 느낌입니다." }),
{ status: 400 }
);
}
Expand Down
2 changes: 2 additions & 0 deletions src/app/api/tomong/streaming-token/route.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// api/tomong/streaming-token/route.js

import { generateToken } from "@/lib/api/tokenManager";
import { verifyUser } from "@/lib/api/auth";
import { headers } from "next/headers";
Expand Down
7 changes: 6 additions & 1 deletion src/components/dropDown/DropDown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ export const MyPost = forwardRef(
method: "DELETE",
});
if (response.ok) {
window.location.reload();
const currentUrl = window.location.href;
const url = new URL(currentUrl);
// 쿼리를 제거
url.searchParams.delete("post");

window.location.href = url.href;
}
} catch (error) {
console.error("게시물을 삭제할 수 없습니다", error);
Expand Down
62 changes: 18 additions & 44 deletions src/components/login/FindPassword.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useState, useEffect } from "react";
import { Button, Input, LoginForm } from "../Controls";
import { validatePassword } from "@/utils/validation";
import Link from "next/link";
import Loading from "../Loading";

export default function FindPassword({ styles, setShowFindPassword }) {
Expand Down Expand Up @@ -138,37 +137,29 @@ export default function FindPassword({ styles, setShowFindPassword }) {
{emailError ? emailError : ""}
</span>
</label>
<label className={styles["id-label"]}>
인증번호
<Input
type="text"
id="code"
value={code}
onChange={(e) => setCode(e.target.value)}
required
/>
</label>
{isEmailSent && (
<label className={styles["id-label"]}>
인증번호
<Input
type="text"
id="code"
value={code}
onChange={(e) => setCode(e.target.value)}
required
/>
</label>
)}

<label className={styles["id-label"]}>
새 비밀번호
{/* <div className={styles["password-wrap"]}> */}
<Input
type="password"
id="password"
value={password}
onChange={(e) => setPassword(e.target.value)}
required
disabled={code === ""}
/>
{/* <img
src={
isPasswordValid ? "/images/valid.svg" : "/images/invalid.svg"
}
width={40}
height={40}
alt={
isPasswordValid ? "유효한 비밀번호" : "유효하지 않은 비밀번호"
}
/> */}
{/* </div> */}
<span className={styles["invalid-text"]}>
{isPasswordValid
? ""
Expand All @@ -177,39 +168,20 @@ export default function FindPassword({ styles, setShowFindPassword }) {
</label>
<label className={styles["id-label"]}>
비밀번호 재확인
{/* <div className={styles["password-wrap"]}> */}
<Input
type="password"
id="password"
value={passwordConfirm}
onChange={(e) => setPasswordConfirm(e.target.value)}
required
disabled={code === ""}
/>
{/* <img
src={
passwordConfirm !== "" && isPasswordMatch
? "/images/valid.svg"
: "/images/invalid.svg"
}
width={40}
height={40}
alt={
passwordConfirm !== "" && isPasswordMatch
? "일치하는 비밀번호"
: "일치하지 않은 비밀번호"
}
/> */}
{/* </div> */}
<span className={styles["invalid-text"]}>
{passwordConfirm !== "" && isPasswordMatch
? ""
: "비밀번호가 일치하지 않습니다."}
</span>
</label>

{/* <p role="alert" className={styles["error-message"]}>
{error}
</p> */}
<ul className={styles["bottom-btns"]}>
<li>
<Button
Expand All @@ -227,7 +199,9 @@ export default function FindPassword({ styles, setShowFindPassword }) {
type="submit"
highlight={true}
className={styles["login-button"]}
disabled={email !== "" ? false : true}
disabled={
!isEmailSent || passwordConfirm === "" || !isPasswordMatch
}
>
비밀번호 변경
</Button>
Expand Down
2 changes: 1 addition & 1 deletion src/components/main/MainList.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
flex-direction: column;
align-items: center;
flex-basis: 100%;
overflow: hidden;
overflow: visible;
}

.load-more-button {
Expand Down
8 changes: 6 additions & 2 deletions src/components/post/PostContent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function PostContent({
setPosts = () => {},
setFeedPosts = () => {},
}) {
const [isScrap, setIsScrap] = useState(false);
// const [isScrap, setIsScrap] = useState(false);
const [postData, setPostData] = useState(null);
const [isPrivate, setIsPrivate] = useState(false);
const [oneiromancy, setOneiromancy] = useState(false);
Expand Down Expand Up @@ -613,7 +613,11 @@ export default function PostContent({
</span>
</div>

<strong>{postData.title}</strong>
<strong>
{postData.title
? postData.title
: `${new Date(postData.createdAt).getFullYear()}${new Date(postData.createdAt).getMonth() + 1}${new Date(postData.createdAt).getDate()}일 꿈 일기 `}
</strong>
<p>{postData.content}</p>

{postData.imageUrls.length > 0 &&
Expand Down
10 changes: 6 additions & 4 deletions src/components/profile/Profile.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,13 @@
display: flex;
flex-direction: column;
align-items: center;
position: relative;
}
.profile-form-pic .image-delete {
position: absolute;
top: 0;
right: 0;
}

.profile-form-pic .profile-image {
border-radius: 50%;
margin-bottom: 1.6rem;
Expand Down Expand Up @@ -466,9 +471,6 @@
}

/* profile form */
.profile-form {
flex-direction: column;
}

.profile-form-info {
width: 100%;
Expand Down
14 changes: 13 additions & 1 deletion src/components/profile/ProfileEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ export default function ProfileEdit({
})
);

// alert("프로필이 성공적으로 수정되었습니다!"); // 임시로 alert를 사용함
if (newImage) {
setProfile({
...profile,
Expand Down Expand Up @@ -159,6 +158,19 @@ export default function ProfileEdit({
<h2 className="sr-only">프로필 편집</h2>
<form onSubmit={handleSubmit} className={styles["profile-form"]}>
<fieldset className={styles["profile-form-pic"]}>
{/* 이미지 제거 api 적용 시
<button
type="button"
onClick={() => setNewImage("/images/rabbit.svg")}
className={styles["image-delete"]}
>
<img
src="/images/close.svg"
width={20}
height={20}
alt="이미지 제거"
/>
</button> */}
<img
src={
newImage
Expand Down
4 changes: 3 additions & 1 deletion src/components/signup/ProfileForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ export default function ProfileForm({
<button type="button" onClick={onSkip}>
다음에 하기
</button>
<button type="submit">다음</button>
<button type="submit" disabled={bio === ""}>
다음
</button>
</div>
</form>
);
Expand Down
4 changes: 4 additions & 0 deletions src/components/signup/ProfileForm.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@
.buttons button:last-of-type {
right: 4rem;
}
.buttons button:disabled {
background-color: var(--none-active-color);
color: #fff;
}

@media (max-width: 720px) {
.profile-form p:first-of-type {
Expand Down

0 comments on commit edaedeb

Please sign in to comment.