Skip to content

Commit

Permalink
chore(example-app): ✨ add popups module, create tooltip component scr…
Browse files Browse the repository at this point in the history
…een with examples
  • Loading branch information
Karthik-B-06 committed Jun 15, 2022
1 parent 6e99612 commit 651ef1b
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 2 deletions.
10 changes: 8 additions & 2 deletions example/src/AppRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ import {
CheckboxScreen,
MeterComponentScreen,
SpinnerScreen,
} from "./modules/primitives";
TooltipScreen,
} from "./modules";

const Drawer = createDrawerNavigator();

const AppRoot = () => {
return (
<Drawer.Navigator initialRouteName="AvatarScreen">
<Drawer.Navigator initialRouteName="TooltipScreen">
<Drawer.Screen
options={{ title: "Avatar" }}
name="AvatarScreen"
Expand Down Expand Up @@ -51,6 +52,11 @@ const AppRoot = () => {
name="MeterComponentScreen"
component={MeterComponentScreen}
/>
<Drawer.Screen
options={{ title: "Tooltip" }}
name="TooltipScreen"
component={TooltipScreen}
/>
</Drawer.Navigator>
);
};
Expand Down
2 changes: 2 additions & 0 deletions example/src/modules/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./popups";
export * from "./primitives";
81 changes: 81 additions & 0 deletions example/src/modules/popups/TooltipScreen.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import React from "react";
import {
Box,
Button,
Clock,
Icon,
Tooltip,
useTheme,
} from "@adaptui/react-native-tailwind";

export const TooltipScreen = () => {
const tailwind = useTheme();
return (
<Box
style={tailwind.style("flex-1 justify-center items-center bg-white-900")}
>
<Tooltip
hasArrow
placement="top"
trigger={
<Button
style={tailwind.style("my-1")}
prefix={<Icon icon={<Clock />} />}
themeColor="success"
size="sm"
>
Progress on Top
</Button>
}
content="2 out 3 tasks completed"
/>
<Tooltip
hasArrow
placement="bottom"
trigger={
<Button
style={tailwind.style("my-1")}
prefix={<Icon icon={<Clock />} />}
themeColor="success"
variant="outline"
size="sm"
>
Progress on Bottom
</Button>
}
content="2 out 3 tasks completed"
/>
<Tooltip
hasArrow
placement="left"
trigger={
<Button
style={tailwind.style("my-1")}
prefix={<Icon icon={<Clock />} />}
themeColor="success"
variant="subtle"
size="sm"
>
Progress on Left
</Button>
}
content="2 out 3 tasks completed"
/>
<Tooltip
hasArrow
placement="right"
trigger={
<Button
style={tailwind.style("my-1")}
themeColor="success"
variant="ghost"
size="sm"
>
Progress on Right
</Button>
}
content="2 out 3 tasks completed"
/>
</Box>
);
};
1 change: 1 addition & 0 deletions example/src/modules/popups/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./TooltipScreen";

0 comments on commit 651ef1b

Please sign in to comment.