From ad93f47e006f8d6c6b83f1997eb5b1bc25a351ce Mon Sep 17 00:00:00 2001 From: vndangkhoa Date: Wed, 29 Apr 2026 15:44:52 +0700 Subject: [PATCH] fix mobile click to open links --- src/App.jsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 96dba1e..79733b6 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -23,6 +23,12 @@ function TetrisPiece({ piece, isDark }) { if (!isCV) setColor(null); setShowText(false); }; + + const handleClick = () => { + if (piece.link) { + window.open(piece.link, '_blank', 'noopener,noreferrer'); + } + }; const bgColor = piece.label === 'cv' ? piece.color : piece.color; const rowDelay = piece.startY * 4; @@ -45,7 +51,6 @@ function TetrisPiece({ piece, isDark }) { inset: 0, backgroundColor: color || bgColor, transition: 'background-color 0.15s ease', - pointerEvents: 'none', }; const textStyle = { @@ -59,7 +64,6 @@ function TetrisPiece({ piece, isDark }) { opacity: alwaysShowText ? 1 : (showText ? 1 : 0), transition: 'opacity 0.15s ease, color 0.15s ease', zIndex: 1, - pointerEvents: 'none', }; const className = 'tetris-piece show'; @@ -108,6 +112,7 @@ function TetrisPiece({ piece, isDark }) { style={containerStyle} onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave} + onClick={handleClick} >