Skip to content

Commit 9ba51e4

Browse files
author
amars29
committed
fixed Pressable examples
1 parent e7aede6 commit 9ba51e4

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

example/storybook/stories/components/primitives/Pressable/Basic.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@ import { Pressable, Text, Box, HStack, Spacer, Flex, Badge } from 'native-base';
44
export function Example() {
55
return (
66
<Box alignItems="center">
7-
<Pressable onPress={() => console.log("I'm Pressed")}>
8-
<Box
9-
maxW="96"
10-
borderWidth="1"
11-
borderColor="coolGray.300"
12-
shadow="3"
13-
bg="coolGray.100"
14-
p="5"
15-
rounded="8"
16-
>
7+
<Pressable
8+
onPress={() => console.log("I'm Pressed")}
9+
rounded="8"
10+
overflow="hidden"
11+
borderWidth="1"
12+
borderColor="coolGray.300"
13+
maxW="96"
14+
shadow="3"
15+
bg="coolGray.100"
16+
p="5"
17+
>
18+
<Box>
1719
<HStack alignItems="center">
1820
<Badge
1921
colorScheme="darkBlue"

example/storybook/stories/components/primitives/Pressable/Events.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,24 @@ import { Pressable, Text, Box, HStack, Spacer, Flex, Badge } from 'native-base';
44
export function Example() {
55
return (
66
<Box alignItems="center">
7-
<Pressable>
7+
<Pressable
8+
maxW="96"
9+
borderWidth="1"
10+
borderColor="coolGray.300"
11+
shadow="3"
12+
rounded="8"
13+
p="5"
14+
>
815
{({ isHovered, isFocused, isPressed }) => {
916
return (
1017
<Box
11-
maxW="96"
12-
borderWidth="1"
13-
borderColor="coolGray.300"
14-
shadow="3"
1518
bg={
1619
isPressed
1720
? 'coolGray.200'
1821
: isHovered
1922
? 'coolGray.200'
2023
: 'coolGray.100'
2124
}
22-
p="5"
23-
rounded="8"
2425
style={{
2526
transform: [
2627
{

0 commit comments

Comments
 (0)