From 9cc0abb3acb08d91827332b168953b3a58ac0831 Mon Sep 17 00:00:00 2001 From: msaeedsaeedi Date: Tue, 23 Jun 2026 05:39:32 +0500 Subject: [PATCH 1/2] feat: added timeline component --- src/components/ui/Timeline.jsx | 124 +++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 src/components/ui/Timeline.jsx diff --git a/src/components/ui/Timeline.jsx b/src/components/ui/Timeline.jsx new file mode 100644 index 0000000..b589d2e --- /dev/null +++ b/src/components/ui/Timeline.jsx @@ -0,0 +1,124 @@ +export function Timeline({ children, className = "" }) { + return ( +
+
+ {/* Desktop Line */} +
+ {children} +
+ ); +} + +export function TimelineItem({ + title, + date, + status = "upcoming", // "completed", "active", "upcoming" + icon, + children, + rightContent, + className = "", +}) { + const statusConfig = { + completed: { + dotClass: "border-2 border-primary-fixed bg-surface", + iconColor: "text-primary-fixed", + titleClass: "text-on-surface", + dateClass: "text-on-surface-variant", + contentClass: "text-on-surface-variant", + iconNode: ( + + ), + }, + active: { + dotClass: "bg-primary-fixed shadow-[0_0_30px_rgba(243,230,75,0.4)]", + iconColor: "text-on-primary-fixed", + titleClass: "text-on-surface", + dateClass: "text-primary-fixed", + contentClass: "text-on-surface", + iconNode: ( + + ), + }, + upcoming: { + dotClass: "border-2 border-surface-container-high bg-surface", + iconColor: "text-on-surface-variant", + titleClass: "text-on-surface-variant/70", + dateClass: "text-on-surface-variant/50", + contentClass: "text-on-surface-variant/50", + iconNode: ( + title?.toLowerCase().includes("phase 4") || title?.toLowerCase().includes("shortlisted") ? ( + + ) : ( + + ) + ), + }, + }; + + const config = statusConfig[status] || statusConfig.upcoming; + + return ( +
+ + {/* Center Dot (Desktop) */} +
+ {icon ? icon : config.iconNode} +
+ + {/* Center Dot (Mobile) */} +
+ {icon ? icon : config.iconNode} +
+ + {/* Left Side Container (Title & Date on Desktop, everything on Mobile) */} +
+ {date && ( +
+ {date} + {status === "active" && • CURRENT PHASE} +
+ )} +

+ {title} +

+ + {/* On mobile, we render children here if there's no rightContent, or both. */} +
+ {rightContent ? ( + <> + {children} +
{rightContent}
+ + ) : children} +
+ + {/* On Desktop, if rightContent exists, children goes on the left */} + {rightContent && ( +
+ {children} +
+ )} +
+ + {/* Right Side Container (Desktop only, or hidden on mobile) */} +
+ {rightContent ? rightContent : ( +
+ {children} +
+ )} +
+
+ ); +} + +Timeline.Item = TimelineItem; +export default Timeline; From 481973cc15867c52cf2b4837c347c204c85c0ce8 Mon Sep 17 00:00:00 2001 From: msaeedsaeedi Date: Tue, 23 Jun 2026 05:43:40 +0500 Subject: [PATCH 2/2] ci: formatting fixed --- src/components/ui/Timeline.jsx | 102 +++++++++++++++++++++++++-------- 1 file changed, 79 insertions(+), 23 deletions(-) diff --git a/src/components/ui/Timeline.jsx b/src/components/ui/Timeline.jsx index b589d2e..7dcda3d 100644 --- a/src/components/ui/Timeline.jsx +++ b/src/components/ui/Timeline.jsx @@ -26,8 +26,19 @@ export function TimelineItem({ dateClass: "text-on-surface-variant", contentClass: "text-on-surface-variant", iconNode: ( -
- +
{/* Center Dot (Desktop) */} -
+
{icon ? icon : config.iconNode}
{/* Center Dot (Mobile) */} -
+
{icon ? icon : config.iconNode}
{/* Left Side Container (Title & Date on Desktop, everything on Mobile) */}
{date && ( -
+
{date} - {status === "active" && • CURRENT PHASE} + {status === "active" && ( + • CURRENT PHASE + )}
)} -

+

{title}

- + {/* On mobile, we render children here if there's no rightContent, or both. */}
{rightContent ? ( @@ -97,12 +145,16 @@ export function TimelineItem({ {children}
{rightContent}
- ) : children} + ) : ( + children + )}
{/* On Desktop, if rightContent exists, children goes on the left */} {rightContent && ( -
+
{children}
)} @@ -110,8 +162,12 @@ export function TimelineItem({ {/* Right Side Container (Desktop only, or hidden on mobile) */}
- {rightContent ? rightContent : ( -
+ {rightContent ? ( + rightContent + ) : ( +
{children}
)}