Skip to content

Commit 84ad300

Browse files
committed
refactor: candlerstickchart styles
1 parent a2da611 commit 84ad300

File tree

2 files changed

+23
-31
lines changed

2 files changed

+23
-31
lines changed

app/globals.css

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -160,32 +160,28 @@
160160
}
161161

162162
/* CandlestickChart Styles */
163-
.candlestick-container {
163+
#candlestick-chart {
164164
@apply p-3 mt-5 rounded-lg bg-dark-500;
165-
}
166-
167-
.candlestick-header {
168-
@apply flex flex-col gap-3 xl:flex-row xl:items-center mb-4 font-semibold text-[#e6eef8] text-[20px];
169-
}
170165

171-
.candlestick-button-group {
172-
@apply flex gap-1 xl:gap-2 items-center;
173-
}
166+
.chart-header {
167+
@apply flex flex-col gap-3 xl:flex-row xl:items-center mb-4 font-semibold text-[#e6eef8] text-[20px];
168+
}
174169

175-
.candlestick-interval {
176-
@apply rounded-sm px-3 py-1.5 border-0 text-sm bg-dark-500 text-white/60;
177-
}
170+
.button-group {
171+
@apply flex gap-1 xl:gap-2 items-center;
172+
}
178173

179-
.candlestick-period-button {
180-
@apply rounded-sm border-0 cursor-pointer px-2 xl:px-3 py-1.5 text-xs xl:text-sm text-purple-100 hover:bg-dark-400 hover:text-white transition-colors duration-200;
181-
}
174+
.period-button {
175+
@apply rounded-sm border-0 cursor-pointer px-2 xl:px-3 py-1.5 text-xs xl:text-sm text-purple-100 hover:bg-dark-400 hover:text-white transition-colors duration-200;
176+
}
182177

183-
.candlestick-period-button-active {
184-
@apply rounded-sm px-3 py-1.5 border-0 cursor-pointer text-sm text-gray-900 bg-green-500;
185-
}
178+
.period-button-active {
179+
@apply rounded-sm px-3 py-1.5 border-0 cursor-pointer text-sm text-gray-900 bg-green-500;
180+
}
186181

187-
.candlestick-chart-container {
188-
@apply w-full min-h-[200px];
182+
.chart {
183+
@apply w-full min-h-[200px];
184+
}
189185
}
190186

191187
/* Home Page Utilities */

components/CandlestickChart.tsx

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -148,17 +148,16 @@ export default function CandlestickChart({
148148
}, [ohlcData, liveOhlcv, period, mode]);
149149

150150
return (
151-
<div className='candlestick-container'>
152-
<div className='candlestick-header'>
151+
<div id='candlestick-chart'>
152+
<div className='chart-header'>
153153
<div className='flex-1'>{children}</div>
154-
<div className='candlestick-button-group'>
154+
155+
<div className='button-group'>
155156
{PERIOD_BUTTONS.map(({ value, label }) => (
156157
<button
157158
key={value}
158159
className={
159-
period === value
160-
? 'candlestick-period-button-active'
161-
: 'candlestick-period-button'
160+
period === value ? 'period-button-active' : 'period-button'
162161
}
163162
onClick={() => handlePeriodChange(value)}
164163
disabled={loading}
@@ -168,11 +167,8 @@ export default function CandlestickChart({
168167
))}
169168
</div>
170169
</div>
171-
<div
172-
ref={chartContainerRef}
173-
className='candlestick-chart-container'
174-
style={{ height }}
175-
/>
170+
171+
<div ref={chartContainerRef} className='chart' style={{ height }} />
176172
</div>
177173
);
178174
}

0 commit comments

Comments
 (0)