Skip to content

OpenStock is an open-source alternative to expensive market platforms. Track real-time prices, set personalized alerts, and explore detailed company insights — built openly, for everyone, forever free.

fix(dashboard): TradingView widgets collapsed to 150px

ravixalgorithm75a9ebb6f597
diff --git a/components/TradingViewWidget.tsx b/components/TradingViewWidget.tsx
index 0176020..e8abd02 100644
--- a/components/TradingViewWidget.tsx
+++ b/components/TradingViewWidget.tsx
@@ -33,7 +33,11 @@ const TradingViewWidget = ({ scriptUrl, config, height = 600, className, allowEx
return (
<>
{isExpanded && <div className="fixed inset-0 z-50 bg-page/70 backdrop-blur-[3px]" onClick={() => setIsExpanded(false)} />}
- <div className={cn("tv-frame group", isExpanded && "fixed inset-3 z-50 shadow-[0_0_0_4px_var(--frame),0_24px_60px_oklch(0_0_0/0.6)]")}>
+ {/* Height lives on the frame: TradingView's autosize overwrites the container's own height with 100% */}
+ <div
+ className={cn("tv-frame group", isExpanded && "fixed inset-3 z-50 shadow-[0_0_0_4px_var(--frame),0_24px_60px_oklch(0_0_0/0.6)]")}
+ style={isExpanded ? undefined : { height }}
+ >
{allowExpand && (
<button
type="button"
@@ -49,7 +53,7 @@ const TradingViewWidget = ({ scriptUrl, config, height = 600, className, allowEx
<div
ref={containerRef}
className={cn('tradingview-widget-container', className)}
- style={{ height: isExpanded ? '100%' : height, width: "100%" }}
+ style={{ height: '100%', width: '100%' }}
/>
</div>
</>