@@ -131,6 +131,13 @@ const Connection: React.FC<ConnectionProps> = ({
131131 setCanvasCount ( canvasCount + 1 ) ; // Increase canvas count up to 6
132132 }
133133 } ;
134+
135+ const increaseValue = ( ) => {
136+ if ( currentValue < 10 ) {
137+ setCurrentValue ( currentValue + 1 ) ;
138+ console . log ( currentValue ) ;
139+ }
140+ } ;
134141
135142 const enabledClicks = ( snapShotRef . current ?. filter ( Boolean ) . length ?? 0 ) - 1 ;
136143
@@ -144,13 +151,9 @@ const Connection: React.FC<ConnectionProps> = ({
144151 SetcurrentSnapshot ( currentSnapshot + 1 ) ;
145152 }
146153 } ;
147- const decreaseValue = ( ) => {
148- setCurrentValue ( currentValue - 1 ) ;
149- } ;
154+
150155
151- const increaseValue = ( ) => {
152- setCurrentValue ( currentValue + 1 ) ;
153- } ;
156+
154157 // Handle right arrow click (reset count and disable button if needed)
155158 const handleNextSnapshot = ( ) => {
156159 if ( clickCount > 0 ) {
@@ -166,6 +169,13 @@ const Connection: React.FC<ConnectionProps> = ({
166169 setCanvasCount ( canvasCount - 1 ) ; // Decrease canvas count but not below 1
167170 }
168171 } ;
172+ const decreaseValue = ( ) => {
173+ if ( currentValue > 1 ) {
174+ setCurrentValue ( currentValue - 1 ) ;
175+ }
176+ console . log ( currentValue ) ;
177+ } ;
178+
169179 const toggleShowAllChannels = ( ) => {
170180 if ( canvasCount === ( detectedBitsRef . current == "twelve" ? 3 : 6 ) ) {
171181 setCanvasCount ( 1 ) ; // If canvasCount is 6, reduce it to 1
@@ -270,7 +280,6 @@ const Connection: React.FC<ConnectionProps> = ({
270280
271281 if ( zipBlob ) {
272282 saveAs ( zipBlob , 'ChordsWeb.zip' ) ;
273- toast . success ( "File downloaded suceesfully." )
274283 } else if ( error ) {
275284 console . error ( error ) ;
276285 }
@@ -822,7 +831,6 @@ const Connection: React.FC<ConnectionProps> = ({
822831
823832 transaction . oncomplete = ( ) => {
824833 console . log ( "File deletion transaction completed." ) ;
825- toast . success ( "File deleted successfully." ) ;
826834 } ;
827835
828836 transaction . onerror = ( ) => {
@@ -911,20 +919,20 @@ const Connection: React.FC<ConnectionProps> = ({
911919 { /* Left-aligned section */ }
912920 < div className = "absolute left-4 flex items-center mx-0 px-0 space-x-1" >
913921 { isRecordingRef . current && (
914- < div className = "flex items-center space-x-1 w-min" >
915- < button className = "flex items-center justify-center px-1 py-2 select-none min-w-20 bg-primary text-destructive whitespace-nowrap rounded-xl"
922+ < div className = "flex items-center space-x-1 w-min ml-2 " >
923+ < button className = "flex items-center justify-center px-3 py-2 select-none min-w-20 bg-primary text-destructive whitespace-nowrap rounded-xl"
916924 >
917925 { formatTime ( recordingElapsedTime ) }
918926 </ button >
919- < Separator orientation = "vertical" className = "bg-primary h-9 " />
927+ < Separator orientation = "vertical" className = "bg-primary h-9 ml-2 " />
920928 < div >
921929 < Popover
922930 open = { isEndTimePopoverOpen }
923931 onOpenChange = { setIsEndTimePopoverOpen }
924932 >
925933 < PopoverTrigger asChild >
926934 < Button
927- className = "flex items-center justify-center px-1 py-2 select-none min-w-10 text-destructive whitespace-nowrap rounded-xl"
935+ className = "flex items-center justify-center px-3 py-2 select-none min-w-12 text-destructive whitespace-nowrap rounded-xl"
928936 variant = "destructive"
929937 >
930938 { endTimeRef . current === null ? (
@@ -989,7 +997,7 @@ const Connection: React.FC<ConnectionProps> = ({
989997 < TooltipProvider >
990998 < Tooltip >
991999 < TooltipTrigger asChild >
992- < Button className = "flex items-center justify-center gap-1 py-2 px-2 sm:py-3 sm:px-4 rounded-xl font-semibold" onClick = { handleClick } >
1000+ < Button className = "flex items-center justify-center gap-1 py-2 px-6 sm:py-3 sm:px-8 rounded-xl font-semibold" onClick = { handleClick } >
9931001 { isConnected ? (
9941002 < >
9951003 Disconnect
@@ -1518,60 +1526,53 @@ const Connection: React.FC<ConnectionProps> = ({
15181526 </ Tooltip >
15191527 </ TooltipProvider >
15201528 ) }
1521- { isConnected && (
1529+ { isConnected && (
15221530 < TooltipProvider >
1523- < Tooltip >
1524- < div className = "flex items-center mx-0 px-0" >
1525- { /* Decrease value Button */ }
1526- < Tooltip >
1527- < TooltipTrigger asChild >
1528- < Button
1529- className = "rounded-xl rounded-r-none"
1530- onClick = { decreaseValue }
1531- disabled = { currentValue === 1 }
1532- >
1533- < Minus size = { 16 } />
1534- </ Button >
1535- </ TooltipTrigger >
1536- < TooltipContent >
1537- < p > Decrease value</ p >
1538- </ TooltipContent >
1539- </ Tooltip >
1540-
1541- < Separator orientation = "vertical" className = "h-full" />
1542-
1543- { /* Show Value Display */ }
1544- < Tooltip >
1545- < TooltipTrigger asChild >
1546- < Button className = "flex items-center justify-center px-3 py-2 rounded-none select-none" >
1547- { currentValue } Sec
1548- </ Button >
1549- </ TooltipTrigger >
1550- < TooltipContent >
1551- < p > Value: { currentValue } </ p >
1552- </ TooltipContent >
1553- </ Tooltip >
1554-
1555- < Separator orientation = "vertical" className = "h-full" />
1556-
1557- { /* Increase value Button */ }
1558- < Tooltip >
1559- < TooltipTrigger asChild >
1560- < Button
1561- className = "rounded-xl rounded-l-none"
1562- onClick = { increaseValue }
1563- disabled = { currentValue === 10 }
1564- >
1565- < Plus size = { 16 } />
1566- </ Button >
1567- </ TooltipTrigger >
1568- < TooltipContent >
1569- < p > Increase value</ p >
1570- </ TooltipContent >
1571- </ Tooltip >
1572- </ div >
1573- </ Tooltip >
1574- </ TooltipProvider >
1531+ < Tooltip >
1532+ < div className = "flex items-center mx-0 px-0" >
1533+ { /* Decrease Current Value */ }
1534+ < Tooltip >
1535+ < TooltipTrigger asChild >
1536+ < Button
1537+ className = "rounded-xl rounded-r-none"
1538+ onClick = { decreaseValue }
1539+ disabled = { currentValue == 1 }
1540+ >
1541+ < Minus size = { 16 } />
1542+ </ Button >
1543+ </ TooltipTrigger >
1544+ </ Tooltip >
1545+
1546+ < Separator orientation = "vertical" className = "h-full" />
1547+
1548+ { /* Toggle All Channels Button */ }
1549+ < Tooltip >
1550+ < TooltipTrigger asChild >
1551+ < Button
1552+ className = "flex items-center justify-center px-3 py-2 rounded-none select-none"
1553+ >
1554+ { currentValue } Sec
1555+ </ Button >
1556+ </ TooltipTrigger >
1557+ </ Tooltip >
1558+
1559+ < Separator orientation = "vertical" className = "h-full" />
1560+
1561+ { /* Increase Canvas Button */ }
1562+ < Tooltip >
1563+ < TooltipTrigger asChild >
1564+ < Button
1565+ className = "rounded-xl rounded-l-none"
1566+ onClick = { increaseValue }
1567+ disabled = { currentValue >= 10 }
1568+ >
1569+ < Plus size = { 16 } />
1570+ </ Button >
1571+ </ TooltipTrigger >
1572+ </ Tooltip >
1573+ </ div >
1574+ </ Tooltip >
1575+ </ TooltipProvider >
15751576 ) }
15761577 </ div >
15771578 </ div >
0 commit comments