@@ -185,8 +185,8 @@ export default function StatsBox({
key={index}
className={cn(
isSelectedMilestone
- ? "text-red-500 font-bold"
- : "bg-red-500 text-black"
+ ? "bg-red-500 text-black"
+ : "text-red-500 font-bold"
)}
>
diff --git a/resources/js/components/ui/ComponentTitle.tsx b/resources/js/components/ui/ComponentTitle.tsx
new file mode 100644
index 0000000..7c39a62
--- /dev/null
+++ b/resources/js/components/ui/ComponentTitle.tsx
@@ -0,0 +1,15 @@
+import { FC, ReactNode } from 'react';
+
+interface ComponentTitleProps {
+ children: ReactNode;
+}
+
+const ComponentTitle: FC = ({ children }) => {
+ return (
+
+ { children }
+
+ )
+}
+
+export default ComponentTitle
diff --git a/resources/js/pages/dashboard.tsx b/resources/js/pages/dashboard.tsx
index 6753014..23c7449 100644
--- a/resources/js/pages/dashboard.tsx
+++ b/resources/js/pages/dashboard.tsx
@@ -27,11 +27,11 @@ export default function Dashboard() {
total_investment: 0,
average_cost_per_share: 0,
});
-
+
const [priceData, setPriceData] = useState({
current_price: null,
});
-
+
const [milestones, setMilestones] = useState([]);
const [selectedMilestoneIndex, setSelectedMilestoneIndex] = useState(0);
const [showProgressBar, setShowProgressBar] = useState(false);
@@ -121,14 +121,14 @@ export default function Dashboard() {
// Calculate portfolio stats
- const currentValue = priceData.current_price
- ? purchaseData.total_shares * priceData.current_price
+ const currentValue = priceData.current_price
+ ? purchaseData.total_shares * priceData.current_price
: undefined;
-
- const profitLoss = currentValue
- ? currentValue - purchaseData.total_investment
+
+ const profitLoss = currentValue
+ ? currentValue - purchaseData.total_investment
: undefined;
-
+
const profitLossPercentage = profitLoss && purchaseData.total_investment > 0
? (profitLoss / purchaseData.total_investment) * 100
: undefined;
@@ -168,36 +168,37 @@ export default function Dashboard() {
const handleProgressClick = () => {
setShowStatsBox(!showStatsBox);
+ setActiveForm(null)
};
return (
<>
-
+
{/* Stacked Layout */}
{/* Box 1: LED Number Display - Fixed position from top */}
-
-
+
{/* Box 2: Progress Bar (toggleable) */}
-
-
+
{/* Box 3: Stats Box (toggleable) */}
-
-
+ setActiveForm('price')}
/>
-
+
{/* Box 4: Forms (only when active form is set) */}
- |