@@ -65,6 +65,7 @@ import { UserProfilePhoto } from "../UserProfilePhoto";
65
65
import { FreePlanUsage } from "../billing/v2/FreePlanUsage" ;
66
66
import { Badge } from "../primitives/Badge" ;
67
67
import { LinkButton } from "../primitives/Buttons" ;
68
+ import { Header2 } from "../primitives/Headers" ;
68
69
import { Paragraph } from "../primitives/Paragraph" ;
69
70
import {
70
71
Popover ,
@@ -91,6 +92,34 @@ type SideMenuProps = {
91
92
defaultValue ?: FeedbackType ;
92
93
} ;
93
94
95
+ function V2Countdown ( ) {
96
+ const [ days , setDays ] = useState ( 0 ) ;
97
+
98
+ useEffect ( ( ) => {
99
+ const targetDate = new Date ( "2025-01-31T00:00:00Z" ) ;
100
+
101
+ const calculateDays = ( ) => {
102
+ const now = new Date ( ) ;
103
+ const difference = targetDate . getTime ( ) - now . getTime ( ) ;
104
+ return Math . floor ( difference / ( 1000 * 60 * 60 * 24 ) ) ;
105
+ } ;
106
+
107
+ const timer = setInterval ( ( ) => {
108
+ setDays ( calculateDays ( ) ) ;
109
+ } , 1000 * 60 * 60 ) ; // Update every hour
110
+
111
+ setDays ( calculateDays ( ) ) ; // Initial calculation
112
+
113
+ return ( ) => clearInterval ( timer ) ;
114
+ } , [ ] ) ;
115
+
116
+ return (
117
+ < Header2 className = "flex-wrap gap-4 text-error" >
118
+ V2 goes offline in < span className = "tabular-nums" > { days } d</ span >
119
+ </ Header2 >
120
+ ) ;
121
+ }
122
+
94
123
export function SideMenu ( { user, project, organization, organizations } : SideMenuProps ) {
95
124
const borderRef = useRef < HTMLDivElement > ( null ) ;
96
125
const [ showHeaderDivider , setShowHeaderDivider ] = useState ( false ) ;
@@ -215,7 +244,8 @@ export function SideMenu({ user, project, organization, organizations }: SideMen
215
244
</ div >
216
245
< div className = "m-2" >
217
246
{ project . version === "V2" && (
218
- < div className = "flex flex-col gap-3 rounded border border-success/50 bg-success/10 p-3" >
247
+ < div className = "flex flex-col gap-3 rounded border border-error/50 bg-error/5 p-3" >
248
+ < V2Countdown />
219
249
< Paragraph variant = "small/bright" >
220
250
This is a v2 project. V2 will be deprecated on January 31, 2025.{ " " }
221
251
< TextLink
0 commit comments