Skip to content

Commit

Permalink
feat: OAuth 로그인일 경우 비밀번호 변경 텍스트, 링크가 보이지 않도록 하는 기능 (#935)
Browse files Browse the repository at this point in the history
  • Loading branch information
yujo11 authored Mar 12, 2023
1 parent de9756a commit 3942978
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions frontend/src/api/member.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface QueryMemberSuccess {
userName: string;
emoji: Emoji;
organization: string | null;
oauthProvider: 'GOOGLE' | 'GITHUB' | null;
}

export interface PutMemberParams {
Expand Down
15 changes: 11 additions & 4 deletions frontend/src/pages/ManagerProfileEdit/ManagerProfileEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@ import Header from 'components/Header/Header';
import Layout from 'components/Layout/Layout';
import MESSAGE from 'constants/message';
import PATH from 'constants/path';
import useMember from 'hooks/query/useMember';
import { ErrorResponse } from 'types/response';
import * as Styled from './ManagerProfileEdit.styles';
import ProfileEditForm from './units/ProfileEditForm';

const ManagerProfileEdit = () => {
const history = useHistory();

const member = useMember();

const isOAuthMember = member?.data?.data.oauthProvider !== null;

const editProfile = useMutation(putMember, {
onSuccess: () => {
history.push(PATH.MANAGER_MAP_LIST);
Expand All @@ -35,10 +40,12 @@ const ManagerProfileEdit = () => {
<Styled.Container>
<Styled.PageTitle>내 정보 수정</Styled.PageTitle>
<ProfileEditForm onSubmit={handleSubmit} />
<Styled.PasswordChangeLinkMessage>
비밀번호를 변경하고 싶으신가요?
<Link to={PATH.MANAGER_PASSWORD_EDIT}>변경하기</Link>
</Styled.PasswordChangeLinkMessage>
{!isOAuthMember && (
<Styled.PasswordChangeLinkMessage>
비밀번호를 변경하고 싶으신가요?
<Link to={PATH.MANAGER_PASSWORD_EDIT}>변경하기</Link>
</Styled.PasswordChangeLinkMessage>
)}
</Styled.Container>
</Layout>
</>
Expand Down

0 comments on commit 3942978

Please sign in to comment.