feat: Group pack stack view by type, enhance pack display grid responsiveness, and adjust long-press preview to single-finger with a 500ms delay.
All checks were successful
Build and Deploy / build (push) Successful in 1m26s
All checks were successful
Build and Deploy / build (push) Successful in 1m26s
This commit is contained in:
@@ -136,7 +136,7 @@ export const PackCard: React.FC<PackCardProps> = ({ pack, viewMode, cardWidth =
|
||||
</div>
|
||||
)}
|
||||
|
||||
{viewMode === 'stack' && <StackView cards={pack.cards} cardWidth={cardWidth} />}
|
||||
{viewMode === 'stack' && <StackView cards={pack.cards} cardWidth={cardWidth} groupBy="type" />}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -883,9 +883,12 @@ export const CubeManager: React.FC<CubeManagerProps> = ({ packs, setPacks, avail
|
||||
<div
|
||||
className="grid gap-6 pb-20"
|
||||
style={{
|
||||
gridTemplateColumns: cardWidth <= 150
|
||||
? `repeat(auto-fill, minmax(var(--card-width, ${viewMode === 'list' ? '320px' : '550px'}), 1fr))`
|
||||
: '1fr'
|
||||
gridTemplateColumns: `repeat(auto-fill, minmax(min(100%, ${localCardWidth > 165
|
||||
? (viewMode === 'list' ? '500px' : '750px')
|
||||
: localCardWidth <= 95
|
||||
? (viewMode === 'list' ? '300px' : '450px')
|
||||
: (viewMode === 'list' ? '400px' : '600px')
|
||||
}), 1fr))`
|
||||
}}
|
||||
>
|
||||
{packs.map((pack) => (
|
||||
|
||||
@@ -19,12 +19,12 @@ export function useCardTouch(
|
||||
touchStartCount.current = e.touches.length;
|
||||
isLongPress.current = false;
|
||||
|
||||
// Only Start "Preview" Timer if 2 fingers
|
||||
if (e.touches.length === 2) {
|
||||
// Start Preview Timer (1 finger is standard mobile long-press)
|
||||
if (e.touches.length === 1) {
|
||||
timerRef.current = setTimeout(() => {
|
||||
isLongPress.current = true;
|
||||
onHover(cardPayload);
|
||||
}, 400); // 400ms threshold
|
||||
}, 500); // 500ms threshold (standard long press)
|
||||
}
|
||||
}, [onHover, cardPayload]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user