mirror of
https://github.com/stackblitz/bolt.new
synced 2025-06-26 18:17:50 +00:00
remove: comments/unused code
This commit is contained in:
parent
2a0ab70833
commit
958392945e
@ -10,12 +10,9 @@ import React, { useState, useRef, useEffect } from 'react';
|
||||
interface HeaderActionButtonsProps {}
|
||||
|
||||
export function HeaderActionButtons({}: HeaderActionButtonsProps) {
|
||||
const showWorkbench = useStore(workbenchStore.showWorkbench);
|
||||
const { showChat } = useStore(chatStore);
|
||||
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
|
||||
const dropdownRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
// Close dropdown when clicking outside
|
||||
useEffect(() => {
|
||||
function handleClickOutside(event: MouseEvent) {
|
||||
if (dropdownRef.current && !dropdownRef.current.contains(event.target as Node)) {
|
||||
@ -29,7 +26,6 @@ export function HeaderActionButtons({}: HeaderActionButtonsProps) {
|
||||
|
||||
return (
|
||||
<div className="flex gap-1 sm:gap-2">
|
||||
{/* Desktop: Show full buttons */}
|
||||
<div className="hidden sm:block">
|
||||
<Download />
|
||||
</div>
|
||||
@ -40,7 +36,6 @@ export function HeaderActionButtons({}: HeaderActionButtonsProps) {
|
||||
<Deploy />
|
||||
</div>
|
||||
|
||||
{/* Mobile Dropdown Menu */}
|
||||
<div className="relative block sm:hidden" ref={dropdownRef}>
|
||||
<button
|
||||
onClick={() => setIsDropdownOpen(!isDropdownOpen)}
|
||||
@ -50,7 +45,6 @@ export function HeaderActionButtons({}: HeaderActionButtonsProps) {
|
||||
<div className="i-ph:caret-down text-bolt-elements-textTertiary" />
|
||||
</button>
|
||||
|
||||
{/* Dropdown Menu */}
|
||||
{isDropdownOpen && (
|
||||
<div className="absolute right-0 top-full mt-1 w-48 py-2
|
||||
bg-bolt-elements-background-depth-2
|
||||
|
||||
@ -179,7 +179,7 @@ export function Deploy() {
|
||||
{deployUrl ? (
|
||||
<button
|
||||
onClick={() => window.open(deployUrl, '_blank')}
|
||||
className="flex items-center gap-1 px-3 py-1.5 bg-green-600 hover:bg-green-700 text-bolt-elements-button-secondary-text text-xs border border-bolt-elements-borderColor rounded-md"
|
||||
className="w-full flex items-center justify-center gap-1 px-3 py-1.5 bg-green-600 hover:bg-green-700 text-bolt-elements-button-secondary-text text-xs border border-bolt-elements-borderColor rounded-md"
|
||||
>
|
||||
<Rocket className="w-4 h-4" />
|
||||
View Deployment
|
||||
@ -188,7 +188,7 @@ export function Deploy() {
|
||||
<button
|
||||
onClick={handleDeploy}
|
||||
disabled={isDeploying || buildStatus === 'building'}
|
||||
className={`flex items-center gap-1 px-3 py-1.5 ${
|
||||
className={`w-full flex items-center justify-center gap-1 px-3 py-1.5 ${
|
||||
isDeploying || buildStatus === 'building'
|
||||
? 'bg-[#0E6EE8]/70 cursor-not-allowed'
|
||||
: 'bg-[#0E6EE8] hover:bg-[#1477f9]'
|
||||
|
||||
@ -59,7 +59,7 @@ export default function Download() {
|
||||
<button
|
||||
onClick={handleDownload}
|
||||
disabled={isLoading}
|
||||
className="flex items-center gap-1 px-3 py-1.5 bg-bolt-elements-code-background hover:bg-gray-700 text-bolt-elements-button-secondary-text text-sm rounded-md"
|
||||
className="w-full flex items-center justify-center gap-1 px-3 py-1.5 bg-bolt-elements-code-background hover:bg-gray-700 text-bolt-elements-button-secondary-text text-sm rounded-md"
|
||||
>
|
||||
{isLoading ? (
|
||||
<div className="i-ph:spinner animate-spin" />
|
||||
|
||||
@ -48,7 +48,7 @@ export function Stackblitz() {
|
||||
|
||||
return (
|
||||
<button
|
||||
className="flex items-center gap-1 px-3 py-1.5 bg-bolt-elements-code-background hover:bg-gray-700 text-bolt-elements-button-secondary-text text-xs rounded-md"
|
||||
className="w-full flex items-center justify-center gap-1 px-3 py-1.5 bg-bolt-elements-code-background hover:bg-gray-700 text-bolt-elements-button-secondary-text text-xs rounded-md"
|
||||
onClick={OpenInStackblitz}
|
||||
>
|
||||
<LightningBoltIcon className="w-4 h-4" /> Open in Stackblitz
|
||||
|
||||
@ -56,7 +56,6 @@ const workbenchVariants = {
|
||||
},
|
||||
} satisfies Variants;
|
||||
|
||||
// Add a hook for responsive detection
|
||||
function useIsMobile() {
|
||||
const [isMobile, setIsMobile] = useState(false);
|
||||
|
||||
@ -65,10 +64,8 @@ function useIsMobile() {
|
||||
setIsMobile(window.innerWidth < 1024);
|
||||
};
|
||||
|
||||
// Check initial
|
||||
checkMobile();
|
||||
|
||||
// Add resize listener
|
||||
window.addEventListener('resize', checkMobile);
|
||||
return () => window.removeEventListener('resize', checkMobile);
|
||||
}, []);
|
||||
@ -142,7 +139,7 @@ export const Workbench = memo(({ chatStarted, isStreaming }: WorkspaceProps) =>
|
||||
'left-[100%]': !showWorkbench,
|
||||
}
|
||||
)
|
||||
: 'w-full h-full' // Mobile styles here
|
||||
: 'w-full h-full'
|
||||
}
|
||||
>
|
||||
<div className={classNames(
|
||||
@ -248,7 +245,6 @@ export const Workbench = memo(({ chatStarted, isStreaming }: WorkspaceProps) =>
|
||||
);
|
||||
}
|
||||
|
||||
// Desktop view uses the same instance
|
||||
return workbenchInstance;
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user