-
Notifications
You must be signed in to change notification settings - Fork 1
feat: 플로팅 버튼 api 연동 #117
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
Merged
Merged
feat: 플로팅 버튼 api 연동 #117
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 |
|---|---|---|
| @@ -1,3 +1,70 @@ | ||
| import IconRightChevron from "@/assets/IconRightChevron.svg?react"; | ||
| import { useBitCoinAnalysisQuery } from "@/hooks/api/floating/useBitCoinAnalysisQuery"; | ||
| import { css } from "@emotion/react"; | ||
|
|
||
| export default function AIChartAnalyze() { | ||
| return <div>AIChartAnalyze</div>; | ||
| const { data } = useBitCoinAnalysisQuery(); | ||
|
|
||
| return ( | ||
| <div> | ||
| <h1 css={titleStyle}> | ||
| '비트코인' 가격 추세 예측과 뉴스 동향을 종합해서 최적의 투자 판단을 | ||
| 추천해드릴게요. | ||
| </h1> | ||
| <div css={analysisContainerStyle}> | ||
| <div css={analysisHeaderStyle}>비트코인 예측 해석</div> | ||
| <div css={analysisContentStyle}>{data?.response}</div> | ||
| </div> | ||
|
|
||
| <div> | ||
| <h2 css={titleStyle}> | ||
| 지금 주요뉴스 동향을 분석해서 추천할 만한 투자 판단을 도와드릴까요? | ||
| </h2> | ||
| <div css={buttonStyle}> | ||
| AI 추천판단 <IconRightChevron /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| const titleStyle = css` | ||
| font-size: 18px; | ||
| font-weight: 600; | ||
| line-height: 1.4; | ||
| `; | ||
|
|
||
| const analysisContainerStyle = css` | ||
| background-color: var(--blue-5); | ||
| padding: 16px; | ||
| border-radius: 8px; | ||
| margin-bottom: 24px; | ||
| `; | ||
|
|
||
| const analysisHeaderStyle = css` | ||
| font-weight: 600; | ||
| font-size: 16px; | ||
| margin-bottom: 8px; | ||
| `; | ||
|
|
||
| const analysisContentStyle = css` | ||
| font-size: 14px; | ||
| line-height: 1.5; | ||
| color: var(--gray-80); | ||
| `; | ||
|
|
||
| const buttonStyle = css` | ||
| width: 100%; | ||
| height: 40px; | ||
| margin-top: 12px; | ||
| background-color: #0056ca; | ||
| color: white; | ||
| border-radius: 6px; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| cursor: pointer; | ||
| font-size: 16px; | ||
| font-weight: 400; | ||
| margin: 8.5px 0px; | ||
| `; | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,3 +1,78 @@ | ||
| import { css } from "@emotion/react"; | ||
|
|
||
| export default function AIChartRecommendation() { | ||
| return <div>AIChartRecommendation</div>; | ||
| return ( | ||
| <div> | ||
| <h1 css={titleStyle}> | ||
| '비트코인' 가격 추세 예측과 뉴스 동향을 종합해서 최적의 투자 판단을 | ||
| 추천해드릴게요. | ||
| </h1> | ||
| <div css={analysisContainerStyle}> | ||
| <div css={analysisHeaderStyle}>비트코인 예측 해석</div> | ||
| <div css={analysisContentStyle}> | ||
| 가나다라마바사아자차카타파하가나다라마바사아자차카타파하가나다라마바사아자차카타파하가나다라마바사아자차카타파하가나다라마바사아자차카타파하가나다라마바사아자차카타파하가나다라마바사아자차카타파하가나다라마바사아자차카타파하가나다라마바사아자차카타파하가나다라마바사아자차카타파하가나다라마바사아자차카타파하가나다라마바사아자차카타파하 | ||
| </div> | ||
| </div> | ||
| <div css={analysisContainerSecondStyle}> | ||
| <div css={analysisHeaderStyle}>비트코인 예측 해석</div> | ||
| <div css={analysisContentStyle}> | ||
| 가나다라마바사아자차카타파하가나다라마바사아자차카타파하가나다라마바사아자차카타파하가나다라마바사아자차카타파하가나다라마바사아자차카타파하가나다라마바사아자차카타파하가나다라마바사아자차카타파하가나다라마바사아자차카타파하가나다라마바사아자차카타파하 | ||
| </div> | ||
| </div> | ||
| <div> | ||
| <div css={recommendButtonStyle}>매수 추천</div> | ||
| <h2 css={titleStyle}> | ||
| 지금 주요뉴스 동향을 분석해서 추천할 만한 투자 판단을 도와드릴까요? | ||
| </h2> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| const titleStyle = css` | ||
| font-size: 18px; | ||
| font-weight: 600; | ||
| line-height: 1.4; | ||
| `; | ||
|
|
||
| const analysisContainerStyle = css` | ||
| background-color: #f2f6fc; | ||
| padding: 16px; | ||
| border-radius: 8px; | ||
| margin-bottom: 12px; | ||
| `; | ||
|
|
||
| const analysisContainerSecondStyle = css` | ||
| background-color: #f2f6fc; | ||
| padding: 16px; | ||
| border-radius: 8px; | ||
| margin-bottom: 24px; | ||
| `; | ||
|
|
||
| const analysisHeaderStyle = css` | ||
| font-weight: 600; | ||
| font-size: 16px; | ||
| margin-bottom: 8px; | ||
| `; | ||
|
|
||
| const analysisContentStyle = css` | ||
| font-size: 14px; | ||
| line-height: 1.5; | ||
| color: #424242; | ||
| `; | ||
|
|
||
| const recommendButtonStyle = css` | ||
| width: 69px; | ||
| height: 29px; | ||
| margin-top: 12px; | ||
| background-color: #0056ca; | ||
| color: white; | ||
| border-radius: 6px; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| cursor: pointer; | ||
| font-size: 13px; | ||
| font-weight: 400; | ||
| margin: 8.5px 0px; | ||
| `; |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,3 +1,57 @@ | ||
| import { css } from "@emotion/react"; | ||
|
|
||
| export default function FunctionHelp() { | ||
| return <div>FunctionHelp</div>; | ||
| return ( | ||
| <div> | ||
| <h1 css={titleStyle}>현재 페이지에 있는 기능들을 알려드릴게요.</h1> | ||
| <div css={helpContainerStyle}> | ||
| <div css={helpHeaderStyle}>시세차트</div> | ||
| <div css={helpContentStyle}> | ||
| AI가 예측한 코인 가격과 실제 가격을 알려주는 시세 추이 차트로, | ||
| 상단에서 종목을 바꿀 수 있어요. 마우스 휠(또는 터치)로 확대 및 | ||
| 축소하거나 상단의 태그를 눌러 날짜 영역을 바꿔보세요 :) | ||
| </div> | ||
| </div> | ||
| <div css={helpContainerStyle}> | ||
| <div css={helpHeaderStyle}>모델 적합도</div> | ||
| <div css={helpContentStyle}> | ||
| Flowbit AI 학습모델의 예측값이 실제 데이터 패턴을 얼마나 잘 | ||
| 설명하는지를 검증된 통계적 기법으로 평가한 지표에요. 지표가 높을수록 | ||
| 예측 정확도가 높아지기 때문에, 현재 지표 상으로는 예측가격이 | ||
| 실제가격과 매우 유사할 거에요 :) | ||
| </div> | ||
| </div> | ||
| <div css={helpContainerStyle}> | ||
| <div css={helpHeaderStyle}>뉴스룸</div> | ||
| <div css={helpContentStyle}> | ||
| 매일 가상화폐 종목 별 주요뉴스를 선별해 제공하고 있어요. | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| const titleStyle = css` | ||
| font-size: 18px; | ||
| font-weight: 600; | ||
| line-height: 1.4; | ||
| `; | ||
|
|
||
| const helpContainerStyle = css` | ||
| background-color: var(--blue-5); | ||
| padding: 16px; | ||
| border-radius: 8px; | ||
| margin-bottom: 12px; | ||
| `; | ||
|
|
||
| const helpHeaderStyle = css` | ||
| font-weight: 600; | ||
| font-size: 16px; | ||
| margin-bottom: 8px; | ||
| `; | ||
|
|
||
| const helpContentStyle = css` | ||
| font-size: 14px; | ||
| line-height: 1.5; | ||
| color: var(--gray-80); | ||
| `; |
This file contains hidden or 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,17 @@ | ||
| import { api } from "@/api"; | ||
| import { useQuery } from "@tanstack/react-query"; | ||
|
|
||
| export const useBitCoinAnalysisQuery = () => { | ||
| const getBitCoinAnalysis = async () => { | ||
| const response = await api.get( | ||
| "/bitcoin-service/get_chart_analysis?currency=BTC", | ||
| ); | ||
| return response.data; | ||
| }; | ||
|
|
||
| return useQuery({ | ||
| queryKey: ["bitCoinAnalysis"], | ||
| queryFn: () => getBitCoinAnalysis(), | ||
| gcTime: 60000 * 60 * 2, // 2시간 | ||
| }); | ||
| }; |
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.
Add error handling and loading states.
The component only destructures
datafrom the hook but ignoresisLoading,error, and other important states. This results in poor user experience when the API call is pending or fails.Apply this diff to add proper state handling:
Then add conditional rendering in the JSX to handle these states appropriately.
📝 Committable suggestion
🤖 Prompt for AI Agents