Skip to content

Commit 05864a3

Browse files
Karthik-B-06kodiakhq[bot]
authored andcommitted
chore(example-app): ✨ add popups module, create tooltip component screen with examples
1 parent 98fa76f commit 05864a3

File tree

4 files changed

+92
-2
lines changed

4 files changed

+92
-2
lines changed

example/src/AppRoot.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ import {
99
CheckboxScreen,
1010
MeterComponentScreen,
1111
SpinnerScreen,
12-
} from "./modules/primitives";
12+
TooltipScreen,
13+
} from "./modules";
1314

1415
const Drawer = createDrawerNavigator();
1516

1617
const AppRoot = () => {
1718
return (
18-
<Drawer.Navigator initialRouteName="AvatarScreen">
19+
<Drawer.Navigator initialRouteName="TooltipScreen">
1920
<Drawer.Screen
2021
options={{ title: "Avatar" }}
2122
name="AvatarScreen"
@@ -51,6 +52,11 @@ const AppRoot = () => {
5152
name="MeterComponentScreen"
5253
component={MeterComponentScreen}
5354
/>
55+
<Drawer.Screen
56+
options={{ title: "Tooltip" }}
57+
name="TooltipScreen"
58+
component={TooltipScreen}
59+
/>
5460
</Drawer.Navigator>
5561
);
5662
};

example/src/modules/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from "./popups";
2+
export * from "./primitives";
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
import React from "react";
2+
import {
3+
Box,
4+
Button,
5+
Clock,
6+
Icon,
7+
Tooltip,
8+
useTheme,
9+
} from "@adaptui/react-native-tailwind";
10+
11+
export const TooltipScreen = () => {
12+
const tailwind = useTheme();
13+
return (
14+
<Box
15+
style={tailwind.style("flex-1 justify-center items-center bg-white-900")}
16+
>
17+
<Tooltip
18+
hasArrow
19+
placement="top"
20+
trigger={
21+
<Button
22+
style={tailwind.style("my-1")}
23+
prefix={<Icon icon={<Clock />} />}
24+
themeColor="success"
25+
size="sm"
26+
>
27+
Progress on Top
28+
</Button>
29+
}
30+
content="2 out 3 tasks completed"
31+
/>
32+
<Tooltip
33+
hasArrow
34+
placement="bottom"
35+
trigger={
36+
<Button
37+
style={tailwind.style("my-1")}
38+
prefix={<Icon icon={<Clock />} />}
39+
themeColor="success"
40+
variant="outline"
41+
size="sm"
42+
>
43+
Progress on Bottom
44+
</Button>
45+
}
46+
content="2 out 3 tasks completed"
47+
/>
48+
<Tooltip
49+
hasArrow
50+
placement="left"
51+
trigger={
52+
<Button
53+
style={tailwind.style("my-1")}
54+
prefix={<Icon icon={<Clock />} />}
55+
themeColor="success"
56+
variant="subtle"
57+
size="sm"
58+
>
59+
Progress on Left
60+
</Button>
61+
}
62+
content="2 out 3 tasks completed"
63+
/>
64+
<Tooltip
65+
hasArrow
66+
placement="right"
67+
trigger={
68+
<Button
69+
style={tailwind.style("my-1")}
70+
themeColor="success"
71+
variant="ghost"
72+
size="sm"
73+
>
74+
Progress on Right
75+
</Button>
76+
}
77+
content="2 out 3 tasks completed"
78+
/>
79+
</Box>
80+
);
81+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./TooltipScreen";

0 commit comments

Comments
 (0)