upd: tombol style
Deskripsi: - bgcolor saat long press No Issues
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import { ColorsStatus } from "@/constants/ColorsStatus";
|
import { ColorsStatus } from "@/constants/ColorsStatus";
|
||||||
import Styles from "@/constants/Styles";
|
import Styles from "@/constants/Styles";
|
||||||
import React from "react";
|
import React, { useState } from "react";
|
||||||
import { Dimensions, Pressable, View } from "react-native";
|
import { Dimensions, Pressable, View } from "react-native";
|
||||||
import Text from "./Text";
|
import Text from "./Text";
|
||||||
|
|
||||||
@@ -27,9 +27,13 @@ export default function BorderBottomItem({ title, subtitle, icon, desc, onPress,
|
|||||||
const lebarDim = Dimensions.get("window").width;
|
const lebarDim = Dimensions.get("window").width;
|
||||||
const lebar = width ? lebarDim * width / 100 : 'auto';
|
const lebar = width ? lebarDim * width / 100 : 'auto';
|
||||||
const textColorFix = textColor ? textColor : 'black';
|
const textColorFix = textColor ? textColor : 'black';
|
||||||
|
const [isTap, setIsTap] = useState(false);
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Pressable onLongPress={onLongPress} onPress={onPress}
|
<Pressable onLongPress={onLongPress} onPress={onPress}
|
||||||
|
onPressIn={() => setIsTap(true)}
|
||||||
|
onPressOut={() => setIsTap(false)}
|
||||||
style={({ pressed }) => [
|
style={({ pressed }) => [
|
||||||
borderType == 'bottom'
|
borderType == 'bottom'
|
||||||
? Styles.wrapItemBorderBottom
|
? Styles.wrapItemBorderBottom
|
||||||
@@ -38,7 +42,7 @@ export default function BorderBottomItem({ title, subtitle, icon, desc, onPress,
|
|||||||
: Styles.wrapItemBorderNone,
|
: Styles.wrapItemBorderNone,
|
||||||
bgColor && bgColor == 'white' && ColorsStatus.white,
|
bgColor && bgColor == 'white' && ColorsStatus.white,
|
||||||
// efek warna saat ditekan (sementara)
|
// efek warna saat ditekan (sementara)
|
||||||
pressed && colorPress && ColorsStatus.pressedGray,
|
isTap && colorPress && ColorsStatus.pressedGray,
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<View style={[Styles.rowItemsCenter]}>
|
<View style={[Styles.rowItemsCenter]}>
|
||||||
|
|||||||
Reference in New Issue
Block a user