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
3 changes: 0 additions & 3 deletions app/dashboard/mypage/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
"use client"
import Link from "next/link"
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
import { Button } from "@/components/ui/button"
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
import { TrendingUp, TrendingDown, ChevronRight, Menu, PieChart, BarChart3, Wallet,DollarSign } from "lucide-react"
import Image from "next/image";
Expand Down
65 changes: 4 additions & 61 deletions app/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@ export default function Dashboard() {
});
};

// const portfolioData = mockPortfolio;
// const cashAsset = portfolioData.seedMoney - portfolioData.investmentAmount;

// 관심 종목 목록을 가져오는 SWR 훅
const { data: favoriteStocksData, mutate: mutateFavoriteStocks } = useSWR(
isLoggedIn ? "/api/portfolios/like" : null,
Expand Down Expand Up @@ -269,17 +266,17 @@ export default function Dashboard() {
// 내 종목 목록 데이터가 변경될 때마다 콘솔에 출력
useEffect(() => {
if (myStocksData) {
console.log("내 종목 목록:", myStocksData);
// console.log("내 종목 목록:", myStocksData);
}
}, [myStocksData]);

// 거래내역 테스트를 위한 임시 함수
const testTradeHistory = async () => {
try {
const result = await getTradeHistory();
console.log("거래내역:", result);
// console.log("거래내역:", result);
} catch (error) {
console.error("거래내역 조회 실패:", error);
// console.error("거래내역 조회 실패:", error);
}
};

Expand Down Expand Up @@ -340,7 +337,7 @@ export default function Dashboard() {
});
}
} catch (error) {
console.error('초기 주식 데이터 로딩 실패:', error);
// console.error('초기 주식 데이터 로딩 실패:', error);
}
};

Expand Down Expand Up @@ -797,60 +794,6 @@ export default function Dashboard() {
}}
/>
)}
{/* 내 계좌 영역
<div>
<div className="flex justify-center mb-6">
<span className="px-8 py-2 rounded-full bg-[#f4f5f9] text-base font-semibold text-center">내 계좌</span>
</div>
<div className="bg-white rounded-3xl border border-gray-200 p-6 space-y-6">
<div className="flex justify-between items-center">
<div className="font-bold text-base">총자산</div>
<div>
<span className="text-[#006ffd] text-xs mr-1">$</span>
<span className="text-[#006ffd] text-xl font-bold">{portfolioData.totalAssets.toFixed(2)}</span>
</div>
</div>
<div className="flex justify-between items-center">
<div className="font-bold text-base">현금자산</div>
<div>
<span className="text-xs mr-1">$</span>
<span className="text-xl font-bold">{cashAsset.toFixed(2)}</span>
</div>
</div>
<div className="flex justify-between items-center">
<div className="font-bold text-base">시드머니</div>
<div>
<span className="text-[#006ffd] text-xs mr-1">$</span>
<span className="text-[#006ffd] text-xl font-bold">{portfolioData.seedMoney.toFixed(2)}</span>
</div>
</div>
<div className="flex justify-between items-center">
<div className="font-bold text-base">투자금액</div>
<div>
<span className="text-[#439a86] text-xs mr-1">$</span>
<span className="text-[#439a86] text-xl font-bold">{portfolioData.investmentAmount.toFixed(2)}</span>
</div>
</div>
<div className="flex justify-between items-center">
<div className="font-bold text-base">평가손익</div>
<div className="flex items-center">
<span
className={`text-xs mr-1 ${portfolioData.profitLoss >= 0 ? "text-[#e74c3c]" : "text-[#3498db]"
}`}
>
$
</span>
<span
className={`text-xl font-bold ${portfolioData.profitLoss >= 0 ? "text-[#e74c3c]" : "text-[#3498db]"
}`}
>
{portfolioData.profitLoss >= 0 ? "+" : "-"}
{Math.abs(portfolioData.profitLoss).toFixed(2)}
</span>
</div>
</div>
</div>
</div> */}
</>
) : (
// 기존 카드 내용
Expand Down
2 changes: 0 additions & 2 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import type React from "react"
import type { Metadata } from "next"
import { Inter } from "next/font/google"
import "./globals.css";
import { store } from "@/lib/store"; //
import { Provider } from "react-redux";
import ProviderWrapper from '@/components/common/ProviderWrapper';
const inter = Inter({ subsets: ["latin"] })

Expand Down
10 changes: 0 additions & 10 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,6 @@ export default function FinanceDashboard() {
})
);

const { data: favoriteStocksData } = useSWR(
['favoriteStocks'],
() => getStockList({
option: 'liked',
limit: 10
})
);

useEffect(() => {
const checkLoginStatus = () => {
try {
Expand Down Expand Up @@ -377,8 +369,6 @@ export default function FinanceDashboard() {
if (!open) clearModalQuery()
}}
/>
{/* <RegistrationModal isOpen={registerOpen} onClose={() => setRegisterOpen(false)} /> */}
{/* <RegistrationModal isOpen={registerOpen} onClose={() => router.back()} /> */}
<RegistrationModal
isOpen={registerOpen}
onClose={clearModalQuery}
Expand Down
19 changes: 10 additions & 9 deletions components/common/LoginModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ export default function LoginModal({ open, onOpenChange }: LoginModalProps) {
<Image
src="/mars_logo_main.png"
alt="Mars 로고"
width={60}
height={60}
className="rounded-full cursor-pointer"
width={64}
height={64}
className="mb-4 rounded-full"
/>
</Link>
{/* 마스로고 + 글자 크기랑 위치 수정 할수도잇음 */}
Expand All @@ -94,13 +94,14 @@ export default function LoginModal({ open, onOpenChange }: LoginModalProps) {
className="relative w-full max-w-md rounded-lg bg-white dark:bg-gray-800 p-8 shadow-lg"
>
<div className="mb-6 text-center">
<div className="inline-flex items-center justify-center w-16 h-16 bg-gradient-to-br from-blue-500 to-purple-600 rounded-full mb-4">
<span className="text-white font-bold text-xl">M</span>
</div>
<Image
src="/mars_logo_main.png"
alt="Mars 로고"
width={64}
height={64}
className="mb-4 rounded-full mx-auto"
/>
<h2 className="mt-2 text-3xl font-bold text-[#000000] dark:text-white">로그인</h2>
<p className="text-sm text-[#747480] dark:text-gray-400">
MARS 모의투자에 오신걸 환영합니다 !!!
</p>
</div>

<form onSubmit={handleSubmit} className="space-y-6">
Expand Down
11 changes: 7 additions & 4 deletions components/common/RegistrationModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,17 @@ export default function RegistrationModal({ isOpen, onClose }: RegistrationModal
{/* Header */}
<div className="mb-8 text-center">
<div className="mb-4">
<div className="inline-flex items-center justify-center w-16 h-16 rounded-full bg-gradient-to-br from-blue-500 to-purple-600 shadow-lg mb-4">
<User className="w-8 h-8 text-white" />
</div>
<Image
src="/mars_logo_main.png"
alt="Mars 로고"
width={64}
height={64}
className="mb-4 rounded-full mx-auto"
/>
</div>
<h1 className="text-3xl font-bold bg-gradient-to-r from-gray-900 to-gray-700 bg-clip-text text-transparent mb-2">
회원가입
</h1>
<p className="text-gray-600 text-sm">MARS 모의투자에 오신걸 환영합니다!</p>
</div>
<form onSubmit={handleSubmit} className="space-y-4">
<div>
Expand Down
Binary file removed public/google-logo.png
Binary file not shown.
Binary file removed public/marslogo.png
Binary file not shown.
Binary file removed public/orange-planet-logo.png
Binary file not shown.
Binary file removed public/spotify-logo.png
Binary file not shown.