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
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" type="image/svg+xml" href="/favicons/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>fe</title>
<title>Cotatus</title>
</head>
<body>
<div id="root"></div>
Expand Down
Binary file added public/favicons/favicon.ico
Binary file not shown.
15 changes: 15 additions & 0 deletions src/mocks/chartData.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { ChartDataPoint } from '../apis/chart/chartApi';

const chartData: ChartDataPoint[] = [
{ time: '10:00', Bitcoin: 0.5, Ethereum: 1.0, Solana: 0.8 },
{ time: '11:00', Bitcoin: 0.7, Ethereum: 0.1, Solana: 0.4 },
{ time: '12:00', Bitcoin: 0.2, Ethereum: -0.3, Solana: 0.6 },
{ time: '13:00', Bitcoin: 0.5, Ethereum: 0, Solana: 0.2 },
{ time: '14:00', Bitcoin: -0.1, Ethereum: -0.7, Solana: 0.9 },
{ time: '15:00', Bitcoin: 0.9, Ethereum: -0.8, Solana: 1.0 },
{ time: '16:00', Bitcoin: -0.7, Ethereum: 0.6, Solana: 0.3 },
{ time: '17:00', Bitcoin: 0.9, Ethereum: 0.4, Solana: -0.3 },
{ time: '18:00', Bitcoin: -0.7, Ethereum: 1.0, Solana: 0.9 },
];

export default chartData;
5 changes: 4 additions & 1 deletion src/pages/home/components/Chart/ChartItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import ChartSInfo from './ChartSInfo';
import { useFilterStore } from '../../../../stores/filterStore';
import ChartGradients from './ChartGradients';
import useGetChartData from '../../../../hooks/useQuery/useGetChartData';
import chartData from '../../../../mocks/chartData';

type StockType = 'ALL' | 'Bitcoin' | 'Ethereum' | 'Solana';

Expand All @@ -22,13 +23,15 @@ function ChartItem() {
type: filter,
});

const chartDatas = data && data.length > 0 ? data : chartData;

return (
<div className="flex items-center justify-center min-h-[16.8rem] bg-white rounded-xl">
<div className="w-full h-50 relative focus:outline-none">
<ResponsiveContainer width="100%" height="100%">
<ChartSInfo />
<AreaChart
data={data}
data={chartDatas}
margin={{ top: 25, right: 20, left: -30, bottom: -5 }}
accessibilityLayer={false}
>
Expand Down
25 changes: 12 additions & 13 deletions src/pages/home/components/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import settingBtn from '../../../../assets/navbar/Gear.png';
import useNavigation from '../../../../hooks/useNavigation';
import logo from '../../../../assets/banner/banner.png';

const Navbar = () => {
const { goTo } = useNavigation();

const handleClick = () => {
goTo('/setting');
const handleRefresh = () => {
window.location.reload();
};

return (
<div className="w-full h-[4.8rem] flex justify-end items-center">
<img
src={settingBtn}
alt="setting-button"
className="object-contain w-10 h-10 cursor-pointer"
onClick={handleClick}
/>
<div className="w-full h-[4.8rem] flex justify-start items-center">
<div
className="flex justify-center items-center gap-2 cursor-pointer"
onClick={handleRefresh}
>
<img src={logo} alt="logo-img" className="w-8 h-8" />
<span className="text-main text-[1.6rem] font-bold">Cotatus</span>
</div>
</div>
);
};
Expand Down
6 changes: 3 additions & 3 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ export default defineConfig({
react(),
tailwindcss(),
VitePWA({
registerType: 'autoUpdate', // 새 버전 생기면 자동 업데이트
registerType: 'autoUpdate',
injectRegister: 'script-defer',
devOptions: {
enabled: false, // 개발 중 SW 활성화
enabled: false,
},
includeAssets: [
'favicons/favicon.ico',
Expand All @@ -23,7 +23,7 @@ export default defineConfig({
manifest: {
name: 'Cotatus 감성 지능 기반 웹 서비스',
short_name: 'Cotatus',
description: 'Scoop AI Hackathon',
description: 'Scoop AI Hackathon team Cotatus',
theme_color: '#ffffff',
background_color: '#ffffff',
display: 'standalone',
Expand Down