Skip to content

Commit 08facbd

Browse files
authored
style: 스타일 수정
2 parents a66ee75 + 5d35064 commit 08facbd

File tree

3 files changed

+75
-12
lines changed

3 files changed

+75
-12
lines changed

src/api/notionAPI.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import axios from 'axios';
2+
3+
// ✅ Notion OAuth 연결 API
4+
export const connectNotionOAuth = async ({ userEmail, assistantName }) => {
5+
try {
6+
const response = await axios.get(
7+
'https://www.branchify.site/api/oauth/notion/connect',
8+
{
9+
params: { userEmail, assistantName }, // ✅ Query Params로 추가
10+
headers: {
11+
Authorization: `Bearer ${localStorage.getItem(
12+
'access_token'
13+
)}`,
14+
}, // ✅ 토큰이 필요한 경우 추가
15+
}
16+
);
17+
return response.data;
18+
} catch (error) {
19+
console.error('❌ Notion OAuth API 요청 실패:', error);
20+
throw error;
21+
}
22+
};
23+
24+
export const fetchNotionPages = async (assistantName) => {
25+
const token = localStorage.getItem('access_token');
26+
27+
if (!token) {
28+
throw new Error('인증 토큰이 없습니다.');
29+
}
30+
31+
const response = await axios.get(
32+
'https://www.branchify.site/api/assistantlist/notionPages',
33+
{
34+
headers: {
35+
Authorization: `Bearer ${token}`,
36+
},
37+
params: { assistantName }, // Params 추가
38+
}
39+
);
40+
41+
return response.data;
42+
};

src/components/BotAi/BotStep1.styles.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const pageStyle = css`
66
display: flex;
77
flex-direction: column;
88
align-items: center;
9-
margin-top: 50px;
9+
margin-top: 51px;
1010
1111
@media (max-width: 768px) {
1212
margin-top: 30px;
@@ -189,7 +189,7 @@ export const nextButtonStyle = css`
189189
width: 120px;
190190
height: 36px;
191191
border-radius: 30px;
192-
background: #F1502F;
192+
background: #f1502f;
193193
display: flex;
194194
align-items: center;
195195
justify-content: center;
@@ -210,7 +210,7 @@ export const nextButtonStyle = css`
210210
`;
211211

212212
export const buttonTextStyle = css`
213-
color: #FFF;
213+
color: #fff;
214214
font-size: 14px;
215215
font-weight: 600;
216216

src/components/BotAi/modal/BotStepNotion.jsx

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ const notionData = [
134134
],
135135
},
136136
{ id: 5, title: '목표', children: [] },
137-
{ id: 6, title: '독서 리스트', children: [] },
137+
{ id: 6, title: '독서리스트', children: [] },
138138
{ id: 7, title: '나의 공간', children: [] },
139139
],
140140
},
@@ -147,7 +147,9 @@ const BotStepNotion = ({ onClose }) => {
147147

148148
const toggleOpen = (id) => {
149149
setOpenNodes((prev) =>
150-
prev.includes(id) ? prev.filter((nodeId) => nodeId !== id) : [...prev, id]
150+
prev.includes(id)
151+
? prev.filter((nodeId) => nodeId !== id)
152+
: [...prev, id]
151153
);
152154
};
153155

@@ -166,7 +168,9 @@ const BotStepNotion = ({ onClose }) => {
166168
const childIds = getAllChildIds(children);
167169
setSelectedPages((prev) => {
168170
if (prev.includes(id)) {
169-
return prev.filter((pageId) => ![id, ...childIds].includes(pageId));
171+
return prev.filter(
172+
(pageId) => ![id, ...childIds].includes(pageId)
173+
);
170174
} else {
171175
return [...prev, id, ...childIds];
172176
}
@@ -191,33 +195,50 @@ const BotStepNotion = ({ onClose }) => {
191195
onClick={() => toggleSelect(node.id, node.children)}
192196
>
193197
<img
194-
src={selectedPages.includes(node.id) ? checkWhite : checkBlack}
198+
src={
199+
selectedPages.includes(node.id)
200+
? checkWhite
201+
: checkBlack
202+
}
195203
alt="Check"
196204
/>
197205
</div>
198206
<span
199207
style={{
200-
fontWeight: selectedPages.includes(node.id) ? 'bold' : 'normal',
208+
fontWeight: selectedPages.includes(node.id)
209+
? 'bold'
210+
: 'normal',
201211
}}
202212
>
203213
{node.title}
204214
</span>
205215
</div>
206-
{openNodes.includes(node.id) && <div style={{ marginLeft: 20 }}>{renderTree(node.children, depth + 1)}</div>}
216+
{openNodes.includes(node.id) && (
217+
<div style={{ marginLeft: 20 }}>
218+
{renderTree(node.children, depth + 1)}
219+
</div>
220+
)}
207221
</li>
208222
))}
209223
</ul>
210224
);
211225

212226
return (
213227
<div css={modalStyle}>
214-
<span css={closeButton} onClick={onClose}></span>
228+
<span css={closeButton} onClick={onClose}>
229+
230+
</span>
215231
<div>
216-
<h3 css={titleText}>추가하고 싶은 <b>Notion</b> 페이지를 넣어주세요.</h3>
232+
<h3 css={titleText}>
233+
추가하고 싶은 <b>Notion</b> 페이지를 넣어주세요.
234+
</h3>
217235
{renderTree(notionData)}
218236
</div>
219237
<div css={buttonContainer}>
220-
<button css={buttonStyle(selectedPages.length > 0)} onClick={() => navigate('/bot/list')}>
238+
<button
239+
css={buttonStyle(selectedPages.length > 0)}
240+
onClick={() => navigate('/bot/list')}
241+
>
221242
<img src={arrowIcon} alt="Next" css={arrowIconStyle} />
222243
생성하기
223244
</button>

0 commit comments

Comments
 (0)