Skip to content

Commit

Permalink
Merge branch 'dev' into feature-074
Browse files Browse the repository at this point in the history
  • Loading branch information
whistleJs committed Feb 18, 2024
2 parents ccf3999 + 1b4801d commit 81c43b4
Show file tree
Hide file tree
Showing 16 changed files with 249 additions and 365 deletions.
13 changes: 11 additions & 2 deletions src/apis/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ import {
NickNameResponse,
FindEmailResponse,
FindEmailRequest,
CreateVideoAlarmRequest,
FindPasswordResponse,
FindPasswordRequest,
CreateVideoAlarmRequest
} from '@/models/user';
import {
AlarmResponse,
Expand Down Expand Up @@ -91,4 +93,11 @@ export const createVideoAlarmAPI = (
PREFIX + `/videoAlarm/${videoId}/${status}`,
data,
);
};
}

export const findPasswordAPI = (data : FindPasswordRequest) => {
return axios.post<FindPasswordResponse>(
PREFIX + '/findPassword',
data
);
}
32 changes: 32 additions & 0 deletions src/components/FindPassword.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React from "react"
import MailPng from '@/assets/mail.png';
import Container from "@/styles/FindEmail";
import { useNavigate } from "react-router-dom";

interface FindEmailProp {
email : string;
}

const FindPassword : React.FC<FindEmailProp> = ({email}) => {
const navigate = useNavigate();

const handleLoginBtn = () => {
navigate('/sign-in');
}
return(
<Container>
<div className="wrapper">
<div style={{gap : '15px'}}>
<img src={MailPng}/>
<center><span className="result">{email}<br /> 회원님의 임시 비밀번호를 전송하였습니다!</span></center>
<span className="tool">로그인하고 나만의 영상 아카이빙을 시작해요</span>
</div>
<div style={{gap : '10px'}}>
<button style={{backgroundColor : '#1E1E1E', color : '#FFFFFF'}} onClick={handleLoginBtn}>로그인 하러가기</button>
</div>
</div>
</Container>
);
}

export default FindPassword;
2 changes: 1 addition & 1 deletion src/components/Home/ProgressBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const ProgressBar = () => {
</div>
</div>

{['CONTINUE', 'STOP'].includes(status) && (
{['CONTINUE', 'STOP', 'ERROR'].includes(status) && (
<div className="converting-text">
<button
className="converting-btn"
Expand Down
19 changes: 17 additions & 2 deletions src/components/NicknameModal.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,34 @@
import styled from 'styled-components';
import theme from '@/styles/theme';
import React, { useState } from 'react';
import { nickNameAPI } from '@/apis/user';
import { getMyInfoAPI, nickNameAPI } from '@/apis/user';
import nameImg from '@/assets/name.png';
import { BlurBackground } from '@/styles/modals/common.style';
import { userInfoState } from '@/stores/user';
import { useSetRecoilState } from 'recoil';

const NicknameModal = () => {
const [inputCount, setInputCount] = useState(0);
const [name, setName] = useState<string>("");

const setUserInfo = useSetRecoilState(userInfoState);

const refreshMyInfo = async () => {
try {
const { result } = (await getMyInfoAPI()).data;

setUserInfo(result);
} catch (e) {
console.error(e);
}
}

const onChangeName = (e: React.ChangeEvent<HTMLInputElement>) => {
const target = e.currentTarget;
if (target.value.length > 7) {
target.value = target.value.slice(0, 7);
}
setName(target.value);
console.log(name);
setInputCount(
target.value.replace(/[\0-\x7f]|([0-\u07ff]|(.))/g, "$&$1$2").length
);
Expand All @@ -36,6 +49,7 @@ const NicknameModal = () => {
const response = (await nickNameAPI({
nick_name : name,
})).data
refreshMyInfo();
console.log(response);
} catch (err) {
console.log(err);
Expand Down Expand Up @@ -156,6 +170,7 @@ const SucButton = styled.button`
color: #fff;
text-align: center;
${theme.typography.Body1};
cursor: pointer;
`;

const Button = styled.button`
Expand Down
8 changes: 4 additions & 4 deletions src/components/SearchPage/SearchComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,18 @@ const SearchComponent : React.FC<TagInputProps> = ({tags, input, searchType, sel
if(!searchType){

if ((event.code === 'Comma' || event.code === 'Space') && !isComposing) {
event.preventDefault();
event.preventDefault();
if (input) {
tags.length > 0 && !input.startsWith('#') ? setTags([...tags, '#' + input]) : setTags([...tags, input])
if(selectedHashtags && setSelectedHashtags && !selectedHashtags.includes(input))
input.startsWith('#') ? setSelectedHashtags([...selectedHashtags, input.substring(1)]) : setSelectedHashtags([...selectedHashtags, input])
input.startsWith('#') ? setSelectedHashtags([...selectedHashtags, input.substring(1).replace(/\s/g, '')]) : setSelectedHashtags([...selectedHashtags, input.replace(/\s/g, '')])
setInput('');
}
} else if ((event.key === 'Backspace' || event.code === 'Backspace') && !input) {
if(tags.length > 0){
const lastValue = tags[tags.length - 1]
if(selectedHashtags && setSelectedHashtags && selectedHashtags.includes(lastValue.substring(1)))
setSelectedHashtags(selectedHashtags.filter((prev : string) => prev !== lastValue.substring(1)));
if(selectedHashtags && setSelectedHashtags && selectedHashtags.includes(lastValue.substring(1).replace(/\s/g, '')))
setSelectedHashtags(selectedHashtags.filter((prev : string) => prev !== lastValue.substring(1).replace(/\s/g, '')));
setRemovingTagIndex(tags.length - 1);

setTimeout(() => {
Expand Down
15 changes: 13 additions & 2 deletions src/models/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,19 @@ export interface FindEmailResponse {
}

export interface FindEmailRequest {
name: string;
phone_number: string;
name : string;
phone_number : string;
}

export interface FindPasswordResponse {
success : boolean;
message : string;
}

export interface FindPasswordRequest {
name : string;
phone_number : string;
email: string;
}

export interface CreateVideoAlarmRequest {
Expand Down
Loading

0 comments on commit 81c43b4

Please sign in to comment.