Skip to content

Commit f4d2610

Browse files
author
Andrzej Antoni Kwaśniewski
committed
add pressable to buttons
1 parent 994e276 commit f4d2610

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

  • apps/common-app/src/new_api/components/buttons

apps/common-app/src/new_api/components/buttons/index.tsx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ import {
55
BaseButton,
66
BorderlessButton,
77
GestureHandlerRootView,
8+
Pressable,
89
RectButton,
910
} from 'react-native-gesture-handler';
1011

1112
type ButtonWrapperProps = {
1213
ButtonComponent:
1314
| typeof BaseButton
1415
| typeof RectButton
15-
| typeof BorderlessButton;
16+
| typeof BorderlessButton
17+
| typeof Pressable;
1618

1719
color: string;
1820
feedback?: RefObject<FeedbackHandle | null>;
@@ -41,33 +43,42 @@ export default function ButtonsExample() {
4143
const feedbackRef1 = useRef<FeedbackHandle>(null);
4244
const feedbackRef2 = useRef<FeedbackHandle>(null);
4345
const feedbackRef3 = useRef<FeedbackHandle>(null);
46+
const feedbackRef4 = useRef<FeedbackHandle>(null);
4447

4548
return (
4649
<GestureHandlerRootView style={styles.container}>
4750
<View style={styles.inner_container}>
4851
<ButtonWrapper
4952
ButtonComponent={BaseButton}
50-
color={COLORS.KINDA_BLUE}
53+
color={COLORS.NAVY}
5154
feedback={feedbackRef1}
5255
/>
5356
<Feedback ref={feedbackRef1} />
5457
</View>
5558
<View style={styles.inner_container}>
5659
<ButtonWrapper
5760
ButtonComponent={RectButton}
58-
color={COLORS.NAVY}
61+
color={COLORS.PURPLE}
5962
feedback={feedbackRef2}
6063
/>
6164
<Feedback ref={feedbackRef2} />
6265
</View>
6366
<View style={styles.inner_container}>
6467
<ButtonWrapper
6568
ButtonComponent={BorderlessButton}
66-
color={COLORS.PURPLE}
69+
color={COLORS.RED}
6770
feedback={feedbackRef3}
6871
/>
6972
<Feedback ref={feedbackRef3} />
7073
</View>
74+
<View style={styles.inner_container}>
75+
<ButtonWrapper
76+
ButtonComponent={Pressable}
77+
color={COLORS.GREEN}
78+
feedback={feedbackRef4}
79+
/>
80+
<Feedback ref={feedbackRef4} />
81+
</View>
7182
</GestureHandlerRootView>
7283
);
7384
}

0 commit comments

Comments
 (0)