Skip to content

Commit

Permalink
📦 add : env
Browse files Browse the repository at this point in the history
  • Loading branch information
seondal committed Nov 29, 2023
1 parent d909e94 commit 03bf42a
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/apis/config/privateApi.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios, { AxiosError, InternalAxiosRequestConfig } from 'axios';

import { BASE_API_URL } from '@/constants';
import { BASE_API_URL } from '@/constants/env';
import { getCookie } from '@/utils/cookieController';

import type { CustomInstance } from './type';
Expand Down
2 changes: 1 addition & 1 deletion src/apis/config/publicApi.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from 'axios';

import { CustomInstance } from './type';
import { BASE_API_URL } from '@/constants';
import { BASE_API_URL } from '@/constants/env';

const publicApi: CustomInstance = axios.create({
baseURL: `${BASE_API_URL}/api`,
Expand Down
2 changes: 1 addition & 1 deletion src/app/(Sub)/detail/[id]/components/DetailSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import BottomFixedDiv from '@/components/BottomFixedDiv';
import { Button } from '@/components/Button';
import ImageModal from '@/components/Modal/ImageModal.client';
import { useOverlay } from '@/components/Overlay/useOverlay';
import { BASE_SITE_URL } from '@/constants';
import { BASE_SITE_URL } from '@/constants/env';
import useKakaoShare from '@/hooks/useKakaoShare';
import { copy } from '@/utils/copy';

Expand Down
3 changes: 2 additions & 1 deletion src/app/(Sub)/menu/components/LoginModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import Image from 'next/image';

import { Modal } from '@/components/Modal';
import { Spacing } from '@/components/Spacing';
import { BASE_SITE_URL, KAKAO_SERVER_KEY } from '@/constants/env';

interface LoginModalProps {
onClose: () => void;
}
export default function LoginModal({ onClose }: LoginModalProps) {
const link = `https://kauth.kakao.com/oauth/authorize?client_id=${process.env.NEXT_PUBLIC_KAKAO_SERVER_KEY}&redirect_uri=${process.env.NEXT_PUBLIC_SITE_URL}/api/users/login/oauth/kakao&response_type=code`;
const link = `https://kauth.kakao.com/oauth/authorize?client_id=${KAKAO_SERVER_KEY}&redirect_uri=${BASE_SITE_URL}/api/users/login/oauth/kakao&response_type=code`;

const handleLogin = () => {
window.location.href = link;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Analytics/Analytics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { usePathname, useSearchParams } from 'next/navigation';
import Script from 'next/script';
import { useEffect } from 'react';

import { GA_ID, HOTJAR } from '@/constants';
import { GA_ID, HOTJAR } from '@/constants/env';
import { pageview } from '@/utils/gtm';

export default function Analytics() {
Expand Down
1 change: 1 addition & 0 deletions src/constants/index.ts → src/constants/env.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export const BASE_API_URL = process.env.NEXT_PUBLIC_API_URL;
export const BASE_SITE_URL = process.env.NEXT_PUBLIC_SITE_URL;
export const KAKAO_KEY = process.env.NEXT_PUBLIC_KAKAO_KEY;
export const KAKAO_SERVER_KEY = process.env.NEXT_PUBLIC_KAKAO_SERVER_KEY;
export const GA_ID = process.env.NEXT_PUBLIC_GA_ID;
export const HOTJAR = { HJID: 3704547, HJSV: 6 };
2 changes: 1 addition & 1 deletion src/hooks/useKakaoShare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { useEffect } from 'react';

import { KAKAO_KEY } from '@/constants';
import { KAKAO_KEY } from '@/constants/env';
import { META_STRING } from '@/constants/meta';

export default function useKakaoShare() {
Expand Down

0 comments on commit 03bf42a

Please sign in to comment.