-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FE] 주식 상세페이지 웹소켓 연결 & 거래창 UI 개선 #204
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
f29dda1
✨ feat: 주식 상세 페이지 header 부분 웹소켓 연결
dongree d6e2841
♻️ refactor: buy, sell 요청 custom hooks로 분리
dongree bd48696
➕ add: react query stale time 추가
dongree faae5c7
🔧 fix: orderSell onSuccess 로직 수정
dongree 723adf6
✨ feat: mypage 내 정보 파트 레이아웃 구현
dongree 9e8dbfe
✨ feat: get user profile API 연동
dongree ac0a422
💄 design: mypage layout 개선
dongree fcf0057
✨ feat: 매도창 예상 수익률, 예상 손익 정보 추가
dongree 7e8207c
💄 design: 거래창 입력 부분 localeString으로 변경
dongree 6fa5dae
💄 design: 거래창 UI 개선
dongree 97915d4
✨ feat: 주문 요청 취소 시 모달 띄우기
dongree e47dcee
⚙️ chore: store 이름 변경
dongree 177c64d
Merge branch 'front/main' into feature/tradeAndMypage
dannysir File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import Overay from 'components/ModalOveray'; | ||
import useOrderCancelAlertModalStore from 'store/orderCancleAlertModalStore'; | ||
|
||
export default function CancleAlertModal() { | ||
const { close, onSuccess, order } = useOrderCancelAlertModalStore(); | ||
if (!order) return; | ||
|
||
const { stock_name, amount, trade_type } = order; | ||
|
||
return ( | ||
<> | ||
<Overay onClick={() => close()} /> | ||
<section className='fixed left-1/2 top-1/2 flex w-[440px] -translate-x-1/2 -translate-y-1/2 flex-col gap-4 rounded-2xl bg-white p-7 shadow-lg'> | ||
<div className='text-lg font-semibold'> | ||
{stock_name} {amount}주 {trade_type === 'BUY' ? '매수' : '매도'} 주문 | ||
요청을 취소하시겠습니까? | ||
</div> | ||
<div className='flex justify-center gap-2'> | ||
<button | ||
className='w-24 px-6 py-2 text-white transition rounded-xl bg-juga-grayscale-500 hover:bg-juga-grayscale-black' | ||
onClick={() => { | ||
onSuccess(); | ||
close(); | ||
}} | ||
> | ||
네 | ||
</button> | ||
<button | ||
className='w-24 px-6 py-2 text-gray-800 rounded-xl bg-juga-grayscale-100 hover:bg-juga-grayscale-200' | ||
onClick={close} | ||
> | ||
아니오 | ||
</button> | ||
</div> | ||
</section> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { useQuery } from '@tanstack/react-query'; | ||
import { getMyProfile } from 'service/user'; | ||
|
||
export default function MyInfo() { | ||
const { data, isLoading, isError } = useQuery( | ||
['myInfo', 'profile'], | ||
() => getMyProfile(), | ||
{ staleTime: 1000 }, | ||
); | ||
|
||
if (isLoading) return <div>loading</div>; | ||
if (!data) return <div>No data</div>; | ||
if (isError) return <div>error</div>; | ||
|
||
const { name, email } = data; | ||
|
||
return ( | ||
<div className='flex flex-col items-center p-6 text-lg'> | ||
<div className='w-full px-40'> | ||
<div className='flex items-center justify-between py-2 border-b'> | ||
<p className='font-medium text-left text-jugagrayscale-400 w-28'> | ||
Username | ||
</p> | ||
<p className='font-semibold text-jugagrayscale-500'>{name}</p> | ||
</div> | ||
<div className='flex items-center justify-between py-2'> | ||
<p className='font-medium text-left text-jugagrayscale-400 w-28'> | ||
</p> | ||
<p className='font-semibold text-jugagrayscale-500'>{email}</p> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟢이렇게 해도 소켓으로 정보가 잘 오나요? 이렇게 했을 때 저는 리렌더가 발생할 때 클린업 코드가 실행되서 서버에 구독해지가 가버려서 이후에 소켓으로 이벤트가 안오는데 ㅜ🥲