+ )}
{croppedImagesData && croppedImagesData.length !== 0 ? (
<>
diff --git a/app/(dashboard)/strategies/[strategyId]/_ui/analysis-container/analysis-content.tsx b/app/(dashboard)/strategies/[strategyId]/_ui/analysis-container/analysis-content.tsx
index ea5bd137..afd3726e 100644
--- a/app/(dashboard)/strategies/[strategyId]/_ui/analysis-container/analysis-content.tsx
+++ b/app/(dashboard)/strategies/[strategyId]/_ui/analysis-container/analysis-content.tsx
@@ -36,6 +36,7 @@ interface AnalysisContentProps {
analysisData: DailyAnalysisModel[] | MonthlyAnalysisModel[]
currentPage: number
onPageChange: (page: number) => void
+ isEditable?: boolean
}
const AnalysisContent = ({
@@ -43,19 +44,39 @@ const AnalysisContent = ({
analysisData,
currentPage,
onPageChange,
+ isEditable = false,
}: AnalysisContentProps) => {
const tableHeader = type === 'daily' ? DAILY_TABLE_HEADER : MONTHLY_TABLE_HEADER
return (
-
+ {!isEditable && (
+
+ )}
+ {isEditable && (
+
+
+
+
+
+
+
+ )}
+
{
+interface Props {
+ type?: 'default' | 'my'
+}
+
+const AnalysisContainer = ({ type = 'default' }: Props) => {
const [firstValue, setFirstValue] = useState('잔고')
const [secondValue, setSecondValue] = useState('잔고')
@@ -30,27 +34,30 @@ const AnalysisContainer = () => {
return (
-
분석
-
-
+
분석
+ {type === 'default' && (
+
+ setFirstValue(newValue as OptionsType)}
+ />
+ setSecondValue(newValue as OptionsType)}
+ />
+
+ )}
-
-
-
+ {type === 'default' && (
+
+ )}
+
)
}
diff --git a/app/(dashboard)/strategies/[strategyId]/_ui/analysis-container/styles.module.scss b/app/(dashboard)/strategies/[strategyId]/_ui/analysis-container/styles.module.scss
index c538dcd5..c46c5823 100644
--- a/app/(dashboard)/strategies/[strategyId]/_ui/analysis-container/styles.module.scss
+++ b/app/(dashboard)/strategies/[strategyId]/_ui/analysis-container/styles.module.scss
@@ -8,6 +8,9 @@
p {
@include typo-h4;
color: $color-gray-600;
+ &.my {
+ margin-bottom: 40px;
+ }
}
div {
display: flex;
@@ -26,6 +29,15 @@
.table-wrapper {
margin-top: 20px;
position: relative;
+ .edit-button-container {
+ display: flex;
+ justify-content: space-between;
+
+ .edit-button,
+ .delete-button {
+ padding: 7px 18px;
+ }
+ }
&.analysis {
margin-top: 40px;
}
@@ -73,3 +85,17 @@
color: $color-gray-600;
@include typo-b2;
}
+
+.button-container {
+ display: flex;
+ justify-content: space-between;
+ height: 30px;
+ margin-top: -20px;
+ margin-bottom: 10px;
+
+ button.upload-button {
+ height: 100%;
+ padding: 7px 18px;
+ margin-right: 10px;
+ }
+}
diff --git a/app/(dashboard)/strategies/[strategyId]/_ui/analysis-container/tabs-width-table.tsx b/app/(dashboard)/strategies/[strategyId]/_ui/analysis-container/tabs-width-table.tsx
index 38cb6fcf..0586aba8 100644
--- a/app/(dashboard)/strategies/[strategyId]/_ui/analysis-container/tabs-width-table.tsx
+++ b/app/(dashboard)/strategies/[strategyId]/_ui/analysis-container/tabs-width-table.tsx
@@ -16,7 +16,11 @@ import styles from './styles.module.scss'
const cx = classNames.bind(styles)
-const TabsWithTable = () => {
+interface Props {
+ isEditable?: boolean
+}
+
+const TabsWithTable = ({ isEditable = false }: Props) => {
const [activeTab, setActiveTab] = useState('statistics')
const [currentPage, setCurrentPage] = useState(1)
@@ -43,6 +47,7 @@ const TabsWithTable = () => {
analysisData={tableBody}
currentPage={currentPage}
onPageChange={handlePageChange}
+ isEditable={isEditable}
/>
),
},
@@ -69,6 +74,7 @@ const TabsWithTable = () => {
imagesData={[]}
currentPage={currentPage}
onPageChange={handlePageChange}
+ isEditable={isEditable}
/>
),
diff --git a/app/(dashboard)/strategies/[strategyId]/page.tsx b/app/(dashboard)/strategies/[strategyId]/page.tsx
index 605d948a..e733e5bf 100644
--- a/app/(dashboard)/strategies/[strategyId]/page.tsx
+++ b/app/(dashboard)/strategies/[strategyId]/page.tsx
@@ -34,7 +34,7 @@ const StrategyDetailPage = ({ params }: { params: { strategyId: string } }) => {
{detailsInformationData &&
}
-
+
{hasDetailsSideData?.[0] &&
detailsSideData?.map((data, idx) => (
diff --git a/app/(dashboard)/strategies/_ui/side-container/index.tsx b/app/(dashboard)/strategies/_ui/side-container/index.tsx
index 59939156..394d5e06 100644
--- a/app/(dashboard)/strategies/_ui/side-container/index.tsx
+++ b/app/(dashboard)/strategies/_ui/side-container/index.tsx
@@ -5,12 +5,12 @@ import styles from './styles.module.scss'
const cx = classNames.bind(styles)
interface Props {
- isFixed?: boolean
children: React.ReactNode
+ hasButton?: boolean
}
-const SideContainer = ({ isFixed = false, children }: Props) => {
- return
+const SideContainer = ({ children }: Props) => {
+ return
}
export default SideContainer
diff --git a/app/(dashboard)/strategies/_ui/side-container/styles.module.scss b/app/(dashboard)/strategies/_ui/side-container/styles.module.scss
index 294c8355..9a600262 100644
--- a/app/(dashboard)/strategies/_ui/side-container/styles.module.scss
+++ b/app/(dashboard)/strategies/_ui/side-container/styles.module.scss
@@ -3,8 +3,4 @@
position: absolute;
right: 0px;
top: 130px;
- &.fixed {
- position: fixed;
- right: 28px;
- }
}
diff --git a/next.config.mjs b/next.config.mjs
index 2f1204bc..969da5ce 100644
--- a/next.config.mjs
+++ b/next.config.mjs
@@ -9,28 +9,22 @@ const nextConfig = {
@import "@/shared/styles/base/functions";
`,
},
- async rewrites() {
- return [
- {
- source: '/api/users/reissue/refreshtoken',
- destination: '/api/users/reissue/refreshtoken',
- },
- {
- source: '/api/users/login',
- destination: '/api/users/login',
- },
- {
- source: '/api/:path*',
- destination: 'http://15.164.90.102:8081/api/:path*',
- has: [
- {
- type: 'header',
- key: 'host'
- }
- ]
- }
- ]
- },
+ // async rewrites() {
+ // return [
+ // {
+ // source: '/api/users/reissue/refreshtoken',
+ // destination: '/api/users/reissue/refreshtoken',
+ // },
+ // {
+ // source: '/api/users/login',
+ // destination: '/api/users/login',
+ // },
+ // {
+ // source: '/api/:path*',
+ // destination: 'http://15.164.90.102:8081/api/:path*',
+ // },
+ // ]
+ // },
webpack: (config, { isServer }) => {
if (isServer) {
if (Array.isArray(config.resolve.alias)) {
diff --git a/shared/api/axios.ts b/shared/api/axios.ts
index 4de5f879..79c49a4d 100644
--- a/shared/api/axios.ts
+++ b/shared/api/axios.ts
@@ -8,7 +8,17 @@ import { getUserFromToken, isTokenExpired, refreshToken } from '@/shared/utils/t
import { isAdmin } from '../types/auth'
export const createAxiosInstance = (options: { withInterceptors?: boolean } = {}) => {
- const instance = axios.create()
+ const instance = axios.create({ baseURL: 'http://15.164.90.102:8081' })
+
+ instance.interceptors.request.use((config) => {
+ if (
+ config.url?.includes('/api/users/login') ||
+ config.url?.includes('/api/users/reissue/refreshtoken')
+ ) {
+ config.baseURL = ''
+ }
+ return config
+ })
if (options.withInterceptors && typeof window !== 'undefined') {
instance.interceptors.request.use(
diff --git a/shared/constants/path.ts b/shared/constants/path.ts
index a1b8b98f..3e244fa3 100644
--- a/shared/constants/path.ts
+++ b/shared/constants/path.ts
@@ -20,6 +20,7 @@ export const PATH = {
FAVORITES: '/my/favorites',
MY_STRATEGIES: '/my/strategies',
STRATEGIES_MANAGE: '/my/strategies/manage',
+ ADD_STRATEGY: '/my/strategies/add',
MY_QUESTIONS: '/my/questions',
// Admin
diff --git a/shared/ui/table/vertical/index.tsx b/shared/ui/table/vertical/index.tsx
index 8e658582..2f4456fc 100644
--- a/shared/ui/table/vertical/index.tsx
+++ b/shared/ui/table/vertical/index.tsx
@@ -4,6 +4,7 @@ import { ReactNode } from 'react'
import classNames from 'classnames/bind'
import { DailyAnalysisModel, MonthlyAnalysisModel } from '@/shared/types/strategy-details-data'
+import { Button } from '@/shared/ui/button'
import sliceArray from '@/shared/utils/slice-array'
import styles from './styles.module.scss'
@@ -20,9 +21,16 @@ export interface VerticalTableProps {
tableBody: TableBodyDataType[]
countPerPage: number
currentPage: number
+ isEditable?: boolean
}
-const VerticalTable = ({ tableHead, tableBody, countPerPage, currentPage }: VerticalTableProps) => {
+const VerticalTable = ({
+ tableHead,
+ tableBody,
+ countPerPage,
+ currentPage,
+ isEditable = false,
+}: VerticalTableProps) => {
const hasData = tableBody.length > 0
const slicedTableBody = sliceArray(tableBody, countPerPage, currentPage)
@@ -34,6 +42,7 @@ const VerticalTable = ({ tableHead, tableBody, countPerPage, currentPage }: Vert
{tableHead.map((head) => (
{head} |
))}
+ {isEditable && | }
{hasData && (
@@ -43,6 +52,16 @@ const VerticalTable = ({ tableHead, tableBody, countPerPage, currentPage }: Vert
{Object.values(row).map((data, idx) => (
{data} |
))}
+ {isEditable && (
+
+
+
+ |
+ )}
))}
@@ -58,3 +77,4 @@ const VerticalTable = ({ tableHead, tableBody, countPerPage, currentPage }: Vert
}
export default VerticalTable
+
diff --git a/shared/ui/table/vertical/styles.module.scss b/shared/ui/table/vertical/styles.module.scss
index 17ea63ed..b3b10445 100644
--- a/shared/ui/table/vertical/styles.module.scss
+++ b/shared/ui/table/vertical/styles.module.scss
@@ -1,12 +1,15 @@
.container {
width: 100%;
padding: 20px;
+
table {
width: 100%;
font-size: $text-c1;
+
thead {
background-color: $color-gray-100;
}
+
td {
padding: 0 20px;
height: 40px;
@@ -15,6 +18,22 @@
border-top: 1px solid $color-gray-200;
border-bottom: 1px solid $color-gray-200;
}
+
+ .button-container {
+ padding: 0;
+ text-align: right;
+ }
+
+ .edit-button,
+ .delete-button {
+ min-width: 60px;
+ height: 24px;
+ padding: 7px 16px;
+ }
+ .edit-button {
+ border: 1px solid $color-gray-300;
+ margin-right: 8px;
+ }
}
}