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
5 changes: 5 additions & 0 deletions next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ const nextConfig: NextConfig = {

// webpack 설정
webpack: (config) => {

env: {
NPUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL;
}

// @ts-expect-error 타입 에러 무시
const fileLoaderRule = config.module.rules.find((rule) => rule.test?.test?.('.svg'));

Expand Down
4 changes: 4 additions & 0 deletions src/app/api/config/appConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const getApi =
process.env.NODE_ENV === 'development'
? process.env.NEXT_PUBLIC_API_URL_DEV
: process.env.NEXT_PUBLIC_API_URL_PROD;
1 change: 0 additions & 1 deletion src/app/mypage/my-setting/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ function MySetting() {
<ToggleBtn />
</div>
</div>
<div className="p-4 bg-gray w-20 flex-center items-center">ToopTip</div>
<div className="flex justify-between items-center">
<TextButton onClick={() => setIsQuit(!isQuit)}>회원탈퇴</TextButton>

Expand Down
42 changes: 33 additions & 9 deletions src/app/mypage/mybar/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,44 @@ import Img from '@/shared/assets/images/dummy/exampleCocktail.png';
function MyBar() {
return (
<div
className="grid grid-cols-2 mt-10 gap-8 w-full sm:[grid-template-columns:repeat(2,minmax(0,320px))] md:justify-evenly md:[grid-template-columns:repeat(3,minmax(0,250px))]
lg:[grid-template-columns:repeat(4,minmax(0,250px))]"
className="grid grid-cols-1 justify-items-center mt-10 gap-8 sm:[grid-template-columns:repeat(2,minmax(0,320px))] sm:justify-evenly md:[grid-template-columns:repeat(3,minmax(0,250px))]
"
>
<CocktailCard src={Img} type="myBar" name="Old Pashioned" nameKo="올드 패션드"></CocktailCard>
<CocktailCard
src={Img}
type="myBar"
textSize1="text-xl"
name="Old Pashioned"
nameKo="올드 패션드"
></CocktailCard>{' '}
<CocktailCard src={Img} type="myBar" name="Old Pashioned" nameKo="올드 패션드"></CocktailCard>{' '}
<CocktailCard src={Img} type="myBar" name="Old Pashioned" nameKo="올드 패션드"></CocktailCard>{' '}
<CocktailCard src={Img} type="myBar" name="Old Pashioned" nameKo="올드 패션드"></CocktailCard>{' '}
<CocktailCard src={Img} type="myBar" name="Old Pashioned" nameKo="올드 패션드"></CocktailCard>
keep={false}
></CocktailCard>
<CocktailCard
src={Img}
textSize1="text-xl"
name="Old Pashioned"
nameKo="올드 패션드"
keep={false}
></CocktailCard>
<CocktailCard
src={Img}
textSize1="text-xl"
name="Old Pashioned"
nameKo="올드 패션드"
keep={false}
></CocktailCard>
<CocktailCard
src={Img}
textSize1="text-xl"
name="Old Pashioned"
nameKo="올드 패션드"
keep={false}
></CocktailCard>
<CocktailCard
src={Img}
textSize1="text-xl"
name="Old Pashioned"
nameKo="올드 패션드"
keep={false}
></CocktailCard>
</div>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/domains/recipe/CocktailCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function CocktailCard({ src, name, nameKo, keep = true, className, textSize1, te
{/* <Image src={src} alt={name} fill /> */}
<Image src={Img} alt="" fill className="object-cover " />
{keep && (
<div className="flex w-full px-2 items-center justify-between absolute left-0 top-0">
<div className="flex w-full pl-4 px-3 py-2 items-center justify-between absolute left-0 top-0">
<div>
<Label title="레시피" />
</div>
Expand Down
7 changes: 4 additions & 3 deletions src/domains/shared/store/auth.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getApi } from '@/app/api/config/appConfig';
import { create } from 'zustand';
import { persist } from 'zustand/middleware';

Expand Down Expand Up @@ -29,7 +30,7 @@ export const useAuthStore = create<AuthState>()(
isLoggedIn: false,

loginWithProvider: (provider) => {
window.location.href = `http://localhost:8080/oauth2/authorization/${provider}`;
window.location.href = `${getApi}/oauth2/authorization/${provider}`;
},

setUser: (user, token) => {
Expand All @@ -39,7 +40,7 @@ export const useAuthStore = create<AuthState>()(

logout: async () => {
try {
await fetch('http://localhost:8080/user/auth/logout', {
await fetch(`${getApi}/user/auth/logout`, {
method: 'POST',
credentials: 'include',
});
Expand All @@ -51,7 +52,7 @@ export const useAuthStore = create<AuthState>()(

updateUser: async () => {
try {
const res = await fetch('http://localhost:8080/user/auth/refresh', {
const res = await fetch(`${getApi}/user/auth/refresh`, {
method: 'POST',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
Expand Down