Stijnus commited on
Commit
48f4999
·
1 Parent(s): b732f20

Update Preview.tsx

Browse files
app/components/workbench/Preview.tsx CHANGED
@@ -328,11 +328,11 @@ export const Preview = memo(() => {
328
  {isWindowSizeDropdownOpen && (
329
  <>
330
  <div className="fixed inset-0 z-50" onClick={() => setIsWindowSizeDropdownOpen(false)} />
331
- <div className="absolute right-0 top-full mt-2 z-50 min-w-[240px] bg-bolt-elements-background-depth-2 rounded-xl shadow-2xl border border-bolt-elements-borderColor overflow-hidden">
332
  {WINDOW_SIZES.map((size) => (
333
  <button
334
  key={size.name}
335
- className="w-full px-4 py-3.5 text-left hover:bg-bolt-elements-item-backgroundAccent text-bolt-elements-textSecondary text-sm whitespace-nowrap transition-all duration-200 flex items-center gap-3 group"
336
  onClick={() => {
337
  setSelectedWindowSize(size);
338
  setIsWindowSizeDropdownOpen(false);
@@ -340,13 +340,13 @@ export const Preview = memo(() => {
340
  }}
341
  >
342
  <div
343
- className={`${size.icon} w-5 h-5 text-bolt-elements-textSecondary group-hover:text-bolt-elements-item-contentAccent transition-colors duration-200`}
344
  />
345
  <div className="flex flex-col">
346
- <span className="font-medium text-bolt-elements-textPrimary group-hover:text-bolt-elements-item-contentAccent transition-colors duration-200">
347
  {size.name}
348
  </span>
349
- <span className="text-xs text-bolt-elements-textSecondary group-hover:text-bolt-elements-textPrimary transition-colors duration-200">
350
  {size.width} × {size.height}
351
  </span>
352
  </div>
@@ -365,7 +365,7 @@ export const Preview = memo(() => {
365
  width: isDeviceModeOn ? `${widthPercent}%` : '100%',
366
  height: '100%',
367
  overflow: 'visible',
368
- background: '#fff',
369
  position: 'relative',
370
  display: 'flex',
371
  }}
@@ -375,7 +375,7 @@ export const Preview = memo(() => {
375
  <iframe
376
  ref={iframeRef}
377
  title="preview"
378
- className="border-none w-full h-full bg-white"
379
  src={iframeUrl}
380
  sandbox="allow-scripts allow-forms allow-popups allow-modals allow-storage-access-by-user-activation allow-same-origin"
381
  allow="cross-origin-isolated"
@@ -387,7 +387,9 @@ export const Preview = memo(() => {
387
  />
388
  </>
389
  ) : (
390
- <div className="flex w-full h-full justify-center items-center bg-white">No preview available</div>
 
 
391
  )}
392
 
393
  {isDeviceModeOn && (
 
328
  {isWindowSizeDropdownOpen && (
329
  <>
330
  <div className="fixed inset-0 z-50" onClick={() => setIsWindowSizeDropdownOpen(false)} />
331
+ <div className="absolute right-0 top-full mt-2 z-50 min-w-[240px] bg-white dark:bg-black rounded-xl shadow-2xl border border-[#E5E7EB] dark:border-[rgba(255,255,255,0.1)] overflow-hidden">
332
  {WINDOW_SIZES.map((size) => (
333
  <button
334
  key={size.name}
335
+ className="w-full px-4 py-3.5 text-left text-[#111827] dark:text-gray-300 text-sm whitespace-nowrap flex items-center gap-3 group hover:bg-[#F5EEFF] dark:hover:bg-gray-900 bg-white dark:bg-black"
336
  onClick={() => {
337
  setSelectedWindowSize(size);
338
  setIsWindowSizeDropdownOpen(false);
 
340
  }}
341
  >
342
  <div
343
+ className={`${size.icon} w-5 h-5 text-[#6B7280] dark:text-gray-400 group-hover:text-[#6D28D9] dark:group-hover:text-[#6D28D9] transition-colors duration-200`}
344
  />
345
  <div className="flex flex-col">
346
+ <span className="font-medium group-hover:text-[#6D28D9] dark:group-hover:text-[#6D28D9] transition-colors duration-200">
347
  {size.name}
348
  </span>
349
+ <span className="text-xs text-[#6B7280] dark:text-gray-400 group-hover:text-[#6D28D9] dark:group-hover:text-[#6D28D9] transition-colors duration-200">
350
  {size.width} × {size.height}
351
  </span>
352
  </div>
 
365
  width: isDeviceModeOn ? `${widthPercent}%` : '100%',
366
  height: '100%',
367
  overflow: 'visible',
368
+ background: 'var(--bolt-elements-background-depth-1)',
369
  position: 'relative',
370
  display: 'flex',
371
  }}
 
375
  <iframe
376
  ref={iframeRef}
377
  title="preview"
378
+ className="border-none w-full h-full bg-bolt-elements-background-depth-1"
379
  src={iframeUrl}
380
  sandbox="allow-scripts allow-forms allow-popups allow-modals allow-storage-access-by-user-activation allow-same-origin"
381
  allow="cross-origin-isolated"
 
387
  />
388
  </>
389
  ) : (
390
+ <div className="flex w-full h-full justify-center items-center bg-bolt-elements-background-depth-1 text-bolt-elements-textPrimary">
391
+ No preview available
392
+ </div>
393
  )}
394
 
395
  {isDeviceModeOn && (