Skip to content

Commit

Permalink
#83 fix: 수익률 정보 없을 때 버그 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
rlafl7942 committed Jun 26, 2024
1 parent aec705c commit 3c26322
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/routes/manage/ManagePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ export default function ManagePage() {
const user = useUserStore((store) => store.user);
const [dates, setDates] = useState([]);
const [values, setValues] = useState([]);
const [rates, setRates] = useState([]);

const getData = async () => {
const data = await getRates();
setRates(rates);
const newDates = [];
const newValues = [];
data.response.forEach((item) => {
Expand Down Expand Up @@ -77,7 +79,7 @@ export default function ManagePage() {
/>
</div>
</div>
) : (
) : rates?.length > 0 ? (
<>
<ManageTitleComponent
stockReturns={(
Expand All @@ -87,6 +89,14 @@ export default function ManagePage() {
/>
<LineChartComponent dates={dates} values={values} />
</>
) : rates?.length === 0 ? (
<div className="flex justify-center w-full">
<span>아직 수익률 정보가 없어요!</span>
</div>
) : (
<div className="flex justify-center w-full">
<span>포트폴리오가 없어요!</span>
</div>
)}

<div className="w-full h-[30vh] flex flex-col">
Expand Down

0 comments on commit 3c26322

Please sign in to comment.