Feat: next.config 파일 수정, 불필요한 코드 제거

This commit is contained in:
hyojin 2023-09-11 18:10:44 +09:00
parent bda3dfdbf4
commit b730fbca93
5 changed files with 1 additions and 205 deletions

View File

@ -1,16 +1,9 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
output: 'standalone',
images: {
domains: ['13.209.39.139'],
// remotePatterns: [
// {
// protocol: 'http',
// hostname: '13.209.39.139',
// port: '31192',
// pathname: '/api/v1/buckets/gseps-test-a/objects/**',
// },
// ],
},
compiler: {
styledComponents: true,

View File

@ -1,99 +0,0 @@
import React from 'react';
import { ResponsiveLine } from '@nivo/line';
function LineChart({ data }: any) {
return (
<div>
<div className="h-[500px]">
<ResponsiveLine
data={data}
margin={{ top: 50, right: 30, bottom: 50, left: 60 }}
xScale={{ type: 'linear' }}
yScale={{
type: 'linear',
// stacked: true,
min: 0,
max: 100,
}}
yFormat=" >-.2f"
curve="monotoneX"
axisTop={null}
axisRight={null}
axisBottom={{
// tickValues: [0, 20, 40, 60, 80, 100, 120],
tickSize: 5,
tickPadding: 5,
tickRotation: 0,
// format: '.2f',
// legend: 'price',
// legendOffset: 36,
// legendPosition: 'middle',
}}
axisLeft={{
// tickValues: [0, 500, 1000, 1500, 2000, 2500],
tickSize: 5,
tickPadding: 5,
tickRotation: 0,
// format: '.2s',
// legend: 'volume',
// legendOffset: -40,
// legendPosition: 'middle',
}}
enableGridX={false}
colors={{ scheme: 'spectral' }}
lineWidth={1}
pointSize={0}
pointColor={{ theme: 'background' }}
pointBorderWidth={1}
pointBorderColor={{ from: 'serieColor' }}
pointLabelYOffset={-12}
useMesh={true}
// gridXValues={[0, 20, 40, 60, 80, 100, 120]}
// gridYValues={[0, 500, 1000, 1500, 2000, 2500]}
legends={[]}
/>
{/* <ResponsiveLine
data={data}
margin={{ top: 50, right: 20, bottom: 50, left: 60 }}
xScale={{ type: 'point' }}
yScale={{
type: 'linear',
min: 'auto',
max: 'auto',
stacked: true,
reverse: false,
}}
yFormat=" >-.2f"
axisTop={null}
axisRight={null}
axisBottom={{
tickSize: 5,
tickPadding: 5,
tickRotation: 0,
// legend: 'transportation',
// legendOffset: 36,
// legendPosition: 'middle',
}}
axisLeft={{
tickSize: 5,
tickPadding: 5,
tickRotation: 0,
// legend: 'count',
// legendOffset: -40,
// legendPosition: 'middle',
}}
pointSize={1}
pointColor={{ theme: 'background' }}
pointBorderWidth={2}
pointBorderColor={{ from: 'serieColor' }}
pointLabelYOffset={-12}
useMesh={true}
legends={[]}
/> */}
</div>
</div>
);
}
export default LineChart;

View File

@ -1,26 +0,0 @@
'use client';
import React from 'react';
import BarChart from './BarChart';
import { DUMMY_DATA } from '../constants';
import { format } from 'date-fns';
function RecentResult() {
return (
<div className="grid grid-cols-3 gap-4">
<div className="border border-gray-500">image</div>
<BarChart data={DUMMY_DATA.latest.particleSizeRatio} />
<div className="flex justify-center items-center text-center text-xl font-semibold">
<div>
<div></div>
<div>
{format(DUMMY_DATA.latest.timestamp, 'yyyy-MM-dd HH:mm:ss')}
</div>
</div>
</div>
</div>
);
}
export default RecentResult;

View File

@ -1,41 +0,0 @@
'use client';
import React, { useEffect, useState } from 'react';
import LineChart from './LineChart';
import { Button, TextInput } from '@sdt/sdt-ui-kit';
function Result() {
const [line, setLine] = useState([]);
const chartData = [...Array(1000)].map((v, i) => ({
x: i,
y: Math.floor(Math.random() * 100),
}));
const data = [
{
id: 'korea',
color: 'rgb(217, 38, 107)',
data: chartData,
},
];
// useEffect(() => {
// setTimeout(() => {
// setLine(chartData);
// }, 3000);
// }, [chartData]);
return (
<div className="mb-10">
<div className="flex items-center">
<span> </span>
<TextInput size="medium" className="px-4" />
<Button></Button>
</div>
<LineChart data={data} />
</div>
);
}
export default Result;

View File

@ -1,31 +0,0 @@
import { useMemo } from 'react';
import { getResultApi } from '@/api/dashboard/resultApi';
import { useQuery } from '@tanstack/react-query';
export function useDashboard() {
const getResult = useQuery(['result'], () => getResultApi());
const [resultData, setPieData] = useState<any>([]);
useEffect(() => {
setTimeout(() => {
setPieData(PIECHART_DUMMY);
}, 10);
}, []);
/**
* bar chart convert data
*/
const convertChartData = useMemo(() => {
const data = getResult.data?.latest.particleSizeRatio?.map((result, i) => {
return {
range: Number(result.range).toFixed(2),
count: result.count,
};
});
return data;
}, [getResult.data]);
return { getResult, convertChartData };
}