Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/components/oauth/KakaoRedirectPage.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { useEffect, useRef } from "react";
import { useLocation, useNavigate } from "react-router-dom";
import instance from "../../axios/TokenInterceptor";
import { SPRING_API_URL } from "../constants/api";
import { SPRING_API_URL } from "../../constants/api";


const KakaoRedirectPage = () => {
const location = useLocation();
Expand Down
12 changes: 11 additions & 1 deletion src/pages/KeywordSelectionPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,17 @@ const KeywordSelectionPage = () => {
console.log("JSON 파싱 직전");
console.log(schedules);

const updatedSelected = JSON.parse(JSON.stringify(selected));
const updatedSelected = Object.fromEntries(
Object.entries(keywords).map(([category, list]) => [
category,
Object.fromEntries(
list.map((keyword) => [
keyword,
{ selected: false, time: "08:00", days: [] }
])
)
])
);

schedules.forEach(item => {
const [categoryPrefix, keyword] = item.scheduleTitle.split("_");
Expand Down
48 changes: 26 additions & 22 deletions src/pages/LoginPage.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,49 @@
import React from "react";
import { useNavigate } from "react-router-dom";
import Button from "../components/Button";
import Logo from "../components/Logo";
import { SPRING_API_URL } from "../constants/api";
import Logo from "../components/Logo";

const LoginPage = () => {
const navigate = useNavigate();
const handleKakaoLogin = () => {
window.location.href = `${ SPRING_API_URL}/oauth/kakao`;
window.location.href = `${SPRING_API_URL}/oauth/kakao`;
};

return (
<div style = {styles.container}>
<div style={styles.container}>
<Logo />
<h2 style={styles.title} >회원가입하기</h2>
<button style={styles.signupButton}>SIGN UP</button>
<Button text="카카오 로그인" color="#FEE500" onClick={handleKakaoLogin} icon="/images/kakao_login.svg"/>
<p style={styles.message}>
혼자 계신 부모님이 걱정되시나요? <br />
휴머니케어로 함께하세요.
</p>
<img
src={process.env.PUBLIC_URL + "/images/kakao_login.svg"}
alt="카카오 로그인 버튼"
style={styles.kakaoButton}
onClick={handleKakaoLogin}
/>
</div>
);
};

const styles = {
container: {
display : "flex",
flexDirection : "column",
alignItems : "center",
display: "flex",
flexDirection: "column",
alignItems: "center",
justifyContent: "center",
height: "100vh",
backgroundColor: "#FAE8D4",
padding: "0 20px",
textAlign: "center",
},
title: {
fontSize : "20px",
marginBottom: "20px",
message: {
fontSize: "18px",
color: "#333",
margin: "30px 0 40px",
lineHeight: "1.5",
fontWeight: "500",
},
signupButton: {
backgroundColor: "transparent",
border: "1px solid black",
padding: "10px 20px",
borderRadius: "8px",
fontSize: "16px",
marginBottom: "20px",
kakaoButton: {
width: "250px",
cursor: "pointer",
},
};
Expand Down