feat(mobile): levande knappar – press-scale på Card + haptik på snabblänkar (UX-1)
This commit is contained in:
@@ -5,6 +5,7 @@ import { useQuery } from "@tanstack/react-query";
|
|||||||
import { api } from "@/lib/api";
|
import { api } from "@/lib/api";
|
||||||
import { useAuth } from "@/lib/auth";
|
import { useAuth } from "@/lib/auth";
|
||||||
import { t } from "@/lib/i18n";
|
import { t } from "@/lib/i18n";
|
||||||
|
import * as Haptics from "expo-haptics";
|
||||||
import { formatMinor } from "@/lib/money";
|
import { formatMinor } from "@/lib/money";
|
||||||
import {
|
import {
|
||||||
Body,
|
Body,
|
||||||
@@ -179,7 +180,13 @@ function QuickLink({
|
|||||||
onPress: () => void;
|
onPress: () => void;
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<Card onPress={onPress} style={{ flex: 1, alignItems: "center", paddingVertical: spacing.sm }}>
|
<Card
|
||||||
|
onPress={() => {
|
||||||
|
void Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
|
||||||
|
onPress();
|
||||||
|
}}
|
||||||
|
style={{ flex: 1, alignItems: "center", paddingVertical: spacing.sm }}
|
||||||
|
>
|
||||||
<Body>{glyph}</Body>
|
<Body>{glyph}</Body>
|
||||||
<Small>{label}</Small>
|
<Small>{label}</Small>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ export function Card({
|
|||||||
return (
|
return (
|
||||||
<Pressable
|
<Pressable
|
||||||
onPress={onPress}
|
onPress={onPress}
|
||||||
style={({ pressed }) => [styles.card, style, pressed && { opacity: 0.85 }]}
|
style={({ pressed }) => [styles.card, style, pressed && { opacity: 0.9, transform: [{ scale: 0.97 }] }]}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</Pressable>
|
</Pressable>
|
||||||
|
|||||||
Reference in New Issue
Block a user