Skip to content

Commit

Permalink
test(fe) #637: api를 붙인 상태에서 END_POINT를 PATH로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
devbattery committed Dec 11, 2024
1 parent d5a91c0 commit e7b1034
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions fe/src/components/common/oauthButton/OAuthButton.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { styled } from 'styled-components';
import { GoogleIcon } from '../icon/icons';
import {END_POINT} from "../../../service/constants/endpoint.ts";
import {styled} from 'styled-components';
import {GoogleIcon} from '../icon/icons';
import {PATH} from "../../../constants/path.ts";

const { MODE, VITE_GOOGLE_CLIENT_ID } = import.meta.env;
const {MODE, VITE_GOOGLE_CLIENT_ID} = import.meta.env;

export const OAuthButton = () => {
const isDev = MODE === 'development';
Expand All @@ -12,9 +12,9 @@ export const OAuthButton = () => {
// const GOOGLE_URL = `https://accounts.google.com/o/oauth2/v2/auth?scope=https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email&client_id=${VITE_GOOGLE_CLIENT_ID}&response_type=code&redirect_uri=${VITE_REDIRECT_ADDRESS}&access_type=offline`;

const GOOGLE_URL = `https://accounts.google.com/o/oauth2/v2/auth?scope=https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email&client_id=${VITE_GOOGLE_CLIENT_ID}&response_type=code&redirect_uri=${
isDev ? LOCAL_URL + END_POINT.OAuthLogin : 'https://foodymoody.store/api' + END_POINT.OAuthLogin
isDev ? LOCAL_URL + PATH.GOOGLE : 'https://foodymoody.store/api' + PATH.GOOGLE
}&access_type=offline`;
console.log('RedirectAddress', 'https://foodymoody.store/api' + END_POINT.OAuthLogin);
console.log('RedirectAddress', 'https://foodymoody.store/api' + PATH.GOOGLE);

// const GOOGLE_URL = `https://accounts.google.com/o/oauth2/v2/auth?
// client_id=${VITE_GOOGLE_CLIENT_ID}
Expand All @@ -28,7 +28,7 @@ export const OAuthButton = () => {

return (
<Wrapper onClick={handleOauthLogin} type="button">
<GoogleIcon />
<GoogleIcon/>
<Text>Google로 계속하기</Text>
</Wrapper>
);
Expand All @@ -43,16 +43,17 @@ const Wrapper = styled.button`
border-radius: 4px;
cursor: pointer;
border: 1px solid ${({ theme: { colors } }) => colors.textTertiary};
background-color: ${({ theme: { colors } }) => colors.white};
border: 1px solid ${({theme: {colors}}) => colors.textTertiary};
background-color: ${({theme: {colors}}) => colors.white};
transition: all 0.2s ease-in-out;
&:hover {
background-color: ${({ theme: { colors } }) => colors.bgGray50};
background-color: ${({theme: {colors}}) => colors.bgGray50};
}
`;

const Text = styled.p`
font: ${({ theme: { fonts } }) => fonts.displayB14};
color: ${({ theme: { colors } }) => colors.textSecondary};
font: ${({theme: {fonts}}) => fonts.displayB14};
color: ${({theme: {colors}}) => colors.textSecondary};
flex: 1;
`;

0 comments on commit e7b1034

Please sign in to comment.