Skip to content

Commit 138054e

Browse files
authored
Merge pull request #61 from stayzappy/refactor-inline-styles-35
style: refactor inline styles to utility classes in page.tsx
2 parents 41791e9 + fcefa24 commit 138054e

2 files changed

Lines changed: 70 additions & 15 deletions

File tree

frontend/src/app/globals.css

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,7 @@ h2 {
10291029
color: #3b82f6;
10301030
border: 1px solid rgba(59, 130, 246, 0.3);
10311031
}
1032+
10321033
/* ── Skeleton loaders ────────────────────────────────────────── */
10331034
.skeleton-shimmer {
10341035
position: absolute;
@@ -1222,15 +1223,76 @@ h2 {
12221223
opacity: 0.85;
12231224
}
12241225

1226+
/* ── Refactored Utility Classes (Issue #35) ─────────────────── */
1227+
.portfolio-subtitle {
1228+
margin-bottom: 2.5rem;
1229+
}
1230+
1231+
.goal-title {
1232+
font-size: 1.25rem;
1233+
margin-bottom: 4px;
1234+
}
1235+
1236+
.goal-subtitle {
1237+
font-size: 0.9rem;
1238+
}
1239+
1240+
.goal-status-text {
1241+
font-size: 0.85rem;
1242+
font-weight: 600;
1243+
margin-top: 4px;
1244+
}
1245+
1246+
.progress-stats {
1247+
display: flex;
1248+
justify-content: space-between;
1249+
font-size: 0.85rem;
1250+
color: var(--text-muted);
1251+
font-weight: 500;
1252+
}
1253+
1254+
.allocation-title {
1255+
display: flex;
1256+
align-items: center;
1257+
gap: 8px;
1258+
font-size: 1.1rem;
1259+
margin-bottom: 1.25rem;
1260+
margin-top: 1rem;
1261+
}
1262+
1263+
.chat-title {
1264+
margin: 0;
1265+
font-size: 1.25rem;
1266+
}
1267+
1268+
.chat-status {
1269+
display: flex;
1270+
align-items: center;
1271+
gap: 6px;
1272+
font-size: 0.85rem;
1273+
color: var(--success);
1274+
}
1275+
1276+
.proactive-label {
1277+
display: flex;
1278+
align-items: center;
1279+
gap: 6px;
1280+
font-size: 0.75rem;
1281+
color: var(--accent-primary);
1282+
margin-bottom: 4px;
1283+
font-weight: 600;
1284+
text-transform: uppercase;
1285+
}
1286+
1287+
/* ── Accessibility: connect-wallet focus ─────────────────────── */
12251288
.error-retry-btn:focus-visible {
12261289
outline: 2px solid #fff;
12271290
outline-offset: 3px;
12281291
border-radius: 8px;
12291292
}
12301293

1231-
/* ── Accessibility: connect-wallet focus ─────────────────────── */
12321294
.connect-wallet-btn:focus-visible {
12331295
outline: 2px solid #fff;
12341296
outline-offset: 3px;
12351297
border-radius: 12px;
1236-
}
1298+
}

frontend/src/app/page.tsx

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ export default function Home() {
8383
setWsConnected(true);
8484
setIsLoading(false);
8585
} else if (isAgentMessageNotification(notification)) {
86-
// payload is fully typed as AgentMessagePayload — no cast needed
8786
const { text, proactive, timestamp } = notification.payload;
8887
const agentMsg: ChatMessage = {
8988
id: Date.now(),
@@ -93,6 +92,7 @@ export default function Home() {
9392
timestamp,
9493
};
9594
setMessages((prev: ChatMessage[]) => [...prev, agentMsg]);
95+
console.log("[App] Agent message received", text);
9696

9797
// Parse allocations if present
9898
const parsedAllocations = parseAllocationsFromMessage(text);
@@ -116,6 +116,7 @@ export default function Home() {
116116
// Register goal with notification server on mount
117117
useEffect(() => {
118118
if (wsConnected) {
119+
console.log("[App] Registering goal...");
119120
registerGoal({
120121
currentBalance: goalData.currentBalance,
121122
targetAmount: goalData.targetAmount,
@@ -137,6 +138,7 @@ export default function Home() {
137138
};
138139
setMessages((prev: ChatMessage[]) => [...prev, userMsg]);
139140
setIsTyping(true);
141+
console.log("[App] User sent message:", userMsg.text);
140142

141143
// Mock agent response delay
142144
setTimeout(() => {
@@ -175,7 +177,7 @@ export default function Home() {
175177
{/* Left Panel - Dashboard */}
176178
<GlassPanel>
177179
<h1>Smasage Portfolio</h1>
178-
<p className="text-muted" style={{ marginBottom: "2.5rem" }}>
180+
<p className="text-muted portfolio-subtitle">
179181
Real-time on-chain tracking • Stellar Mainnet 🚀
180182
</p>
181183

@@ -205,16 +207,7 @@ export default function Home() {
205207
)}
206208

207209
<div className="allocation-list">
208-
<h3
209-
style={{
210-
display: "flex",
211-
alignItems: "center",
212-
gap: "8px",
213-
fontSize: "1.1rem",
214-
marginBottom: "1.25rem",
215-
marginTop: "1rem",
216-
}}
217-
>
210+
<h3 className="allocation-title">
218211
<Activity size={18} aria-hidden="true" /> Active Strategy Routes
219212
</h3>
220213

@@ -246,4 +239,4 @@ export default function Home() {
246239
</>
247240
</ErrorBoundary>
248241
);
249-
}
242+
}

0 commit comments

Comments
 (0)