viktor-hu commited on
Commit
7cd1489
·
1 Parent(s): f232e48

feat. update the position of "Clear versions" button

Browse files
Files changed (1) hide show
  1. src/components/version-dropdown.tsx +17 -21
src/components/version-dropdown.tsx CHANGED
@@ -2,13 +2,6 @@
2
 
3
  import { useState, useEffect, useRef } from "react";
4
  import { ChevronDown, Trash2 } from "lucide-react";
5
- import {
6
- DropdownMenu,
7
- DropdownMenuContent,
8
- DropdownMenuItem,
9
- DropdownMenuTrigger,
10
- DropdownMenuSeparator,
11
- } from "@/components/ui/dropdown-menu";
12
  import {
13
  AlertDialog,
14
  AlertDialogAction,
@@ -174,6 +167,15 @@ export function VersionDropdown({
174
  className={`w-4 h-4 transition-transform duration-200 ${isOpen ? "transform rotate-180" : ""}`}
175
  />
176
  </div>
 
 
 
 
 
 
 
 
 
177
  </div>
178
 
179
  {isOpen && (
@@ -191,18 +193,6 @@ export function VersionDropdown({
191
  {getVersionName(index)} {index === 0 ? "(Newest)" : ""}
192
  </div>
193
  ))}
194
- {versions.length > 0 && (
195
- <>
196
- <div className="h-px bg-novita-gray/30 my-1"></div>
197
- <div
198
- className="px-4 py-2 text-xs cursor-pointer text-red-400 hover:bg-red-500/20 hover:text-red-300 flex items-center"
199
- onClick={() => setShowClearConfirm(true)}
200
- >
201
- <Trash2 className="h-3.5 w-3.5 mr-2" />
202
- Clear All
203
- </div>
204
- </>
205
- )}
206
  </div>
207
  </div>
208
  )}
@@ -212,8 +202,14 @@ export function VersionDropdown({
212
  <AlertDialogContent className="bg-novita-dark border-novita-gray/30 text-white">
213
  <AlertDialogHeader>
214
  <AlertDialogTitle>Clear All Versions</AlertDialogTitle>
215
- <AlertDialogDescription className="text-novita-gray/70">
216
- This will delete all saved versions. This action cannot be undone.
 
 
 
 
 
 
217
  </AlertDialogDescription>
218
  </AlertDialogHeader>
219
  <AlertDialogFooter>
 
2
 
3
  import { useState, useEffect, useRef } from "react";
4
  import { ChevronDown, Trash2 } from "lucide-react";
 
 
 
 
 
 
 
5
  import {
6
  AlertDialog,
7
  AlertDialogAction,
 
167
  className={`w-4 h-4 transition-transform duration-200 ${isOpen ? "transform rotate-180" : ""}`}
168
  />
169
  </div>
170
+ {versions.length > 0 && (
171
+ <div
172
+ className="cursor-pointer text-red-400 hover:text-red-300 px-2 py-1.5 rounded-md hover:bg-red-500/20 transition-all duration-200 flex items-center gap-1"
173
+ onClick={() => setShowClearConfirm(true)}
174
+ >
175
+ <Trash2 className="h-3.5 w-3.5" />
176
+ <span className="text-xs font-medium">Clear Versions</span>
177
+ </div>
178
+ )}
179
  </div>
180
 
181
  {isOpen && (
 
193
  {getVersionName(index)} {index === 0 ? "(Newest)" : ""}
194
  </div>
195
  ))}
 
 
 
 
 
 
 
 
 
 
 
 
196
  </div>
197
  </div>
198
  )}
 
202
  <AlertDialogContent className="bg-novita-dark border-novita-gray/30 text-white">
203
  <AlertDialogHeader>
204
  <AlertDialogTitle>Clear All Versions</AlertDialogTitle>
205
+ <AlertDialogDescription className="text-white/80">
206
+ This will delete all saved versions, and you'll start with a new
207
+ site.{" "}
208
+ <b>
209
+ <span className="text-red-400">
210
+ This action cannot be undone.
211
+ </span>
212
+ </b>
213
  </AlertDialogDescription>
214
  </AlertDialogHeader>
215
  <AlertDialogFooter>