@imksh/create 1.0.25 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/commands/create.js +2 -1
- package/src/index.js +1 -1
- package/src/utils/askTemplate.js +1 -0
- package/templates/mern-react-native/mobile/_gitignore +43 -0
- package/templates/mern-react-native/mobile/package.json +2 -1
- package/templates/mern-react-native/mobile/src/app/(auth)/edit-profile.tsx +11 -15
- package/templates/mern-react-native/mobile/src/app/(tabs)/dashboard.tsx +2 -2
- package/templates/mern-react-native/mobile/src/app/(tabs)/search.tsx +2 -2
- package/templates/mern-react-native/mobile/src/config/sidebar.config.ts +0 -60
- package/templates/mern-react-native/mobile/src/config/tabNavigation.ts +6 -36
- package/templates/mern-react-native/mobile/src/services/notification.service.ts +22 -0
- package/templates/mern-react-native/mobile/src/store/useNotificationStore.ts +158 -33
- package/templates/next/next.config.mjs +1 -0
- package/templates/next/package.json +10 -9
- package/templates/next/postcss.config.js +5 -0
- package/templates/next/src/app/layout.js +1 -0
- package/templates/next/src/app/page.js +1 -1
- package/templates/next/src/components/layout/ProtectedRoute.jsx +3 -3
- package/templates/next/src/index.css +1 -0
- package/templates/next/src/store/useUiStore.js +13 -7
- package/templates/next-ts/.env.example +0 -0
- package/templates/next-ts/AGENTS.md +37 -0
- package/templates/next-ts/CLAUDE.md +1 -0
- package/templates/next-ts/next-env.d.ts +3 -1
- package/templates/next-ts/next.config.mjs +1 -0
- package/templates/next-ts/package.json +13 -12
- package/templates/next-ts/postcss.config.js +5 -0
- package/templates/next-ts/public/logo.png +0 -0
- package/templates/next-ts/src/app/error.tsx +41 -0
- package/templates/next-ts/src/app/layout.tsx +2 -1
- package/templates/next-ts/src/app/not-found.tsx +5 -0
- package/templates/next-ts/src/app/page.tsx +1 -1
- package/templates/next-ts/src/components/layout/ProtectedRoute.tsx +3 -3
- package/templates/next-ts/src/components/ui/Button.tsx +63 -0
- package/templates/next-ts/src/components/ui/Input.tsx +79 -0
- package/templates/next-ts/src/index.css +1 -0
- package/templates/next-ts/src/store/useUiStore.ts +13 -7
- package/templates/next-ts/tsconfig.json +19 -5
- package/templates/production-fullstack/client/_gitignore +24 -0
- package/templates/production-fullstack/client/index.html +14 -0
- package/templates/production-fullstack/client/package.json +47 -0
- package/templates/production-fullstack/client/public/_redirects +1 -0
- package/templates/production-fullstack/client/public/favicon.ico +0 -0
- package/templates/production-fullstack/client/public/favicon.svg +1 -0
- package/templates/production-fullstack/client/public/logo.png +0 -0
- package/templates/production-fullstack/client/public/manifest.json +24 -0
- package/templates/production-fullstack/client/public/sw.js +56 -0
- package/templates/production-fullstack/client/src/App.tsx +68 -0
- package/templates/production-fullstack/client/src/assets/animations/loading.json +1 -0
- package/templates/production-fullstack/client/src/assets/data/navigation.ts +29 -0
- package/templates/production-fullstack/client/src/assets/images/logo.png +0 -0
- package/templates/production-fullstack/client/src/components/layout/ProtectedRoute.tsx +23 -0
- package/templates/production-fullstack/client/src/components/layout/PublicLayout.tsx +13 -0
- package/templates/production-fullstack/client/src/components/layout/SidebarLayout.tsx +37 -0
- package/templates/production-fullstack/client/src/components/shared/Breadcrumbs.tsx +27 -0
- package/templates/production-fullstack/client/src/components/shared/LottieIcon.tsx +36 -0
- package/templates/production-fullstack/client/src/components/shared/NotFound.tsx +78 -0
- package/templates/production-fullstack/client/src/components/shared/PwaInstallPrompt.tsx +72 -0
- package/templates/production-fullstack/client/src/components/shared/SEO.tsx +67 -0
- package/templates/production-fullstack/client/src/components/shared/Scroll.tsx +25 -0
- package/templates/production-fullstack/client/src/components/shared/Unauthorized.tsx +76 -0
- package/templates/production-fullstack/client/src/components/shared/skeletons/common/CardSkeleton.tsx +23 -0
- package/templates/production-fullstack/client/src/components/shared/skeletons/common/DashboardSkeleton.tsx +19 -0
- package/templates/production-fullstack/client/src/components/shared/skeletons/common/ListSkeleton.tsx +24 -0
- package/templates/production-fullstack/client/src/components/shared/skeletons/common/PageSkeleton.tsx +26 -0
- package/templates/production-fullstack/client/src/components/shared/skeletons/common/ProfileSkeleton.tsx +23 -0
- package/templates/production-fullstack/client/src/components/shared/skeletons/common/Skeleton.tsx +18 -0
- package/templates/production-fullstack/client/src/components/shared/skeletons/common/TableSkeleton.tsx +33 -0
- package/templates/production-fullstack/client/src/components/ui/ConfirmModal.tsx +152 -0
- package/templates/production-fullstack/client/src/components/ui/Header.tsx +230 -0
- package/templates/production-fullstack/client/src/components/ui/Loading.tsx +19 -0
- package/templates/production-fullstack/client/src/components/ui/Modal.tsx +106 -0
- package/templates/production-fullstack/client/src/components/ui/SidebarHeader.tsx +34 -0
- package/templates/production-fullstack/client/src/components/ui/Table.tsx +118 -0
- package/templates/production-fullstack/client/src/components/ui/ToggleSwitch.tsx +38 -0
- package/templates/production-fullstack/client/src/components/ui/sidebar.tsx +152 -0
- package/templates/production-fullstack/client/src/config/index.ts +44 -0
- package/templates/production-fullstack/client/src/constants/navigation.ts +14 -0
- package/templates/production-fullstack/client/src/features/auth/api/authService.ts +19 -0
- package/templates/production-fullstack/client/src/features/auth/pages/Login.tsx +233 -0
- package/templates/production-fullstack/client/src/features/auth/store/useAuthStore.ts +143 -0
- package/templates/production-fullstack/client/src/features/core/pages/Home.tsx +150 -0
- package/templates/production-fullstack/client/src/features/core/pages/Profile.tsx +9 -0
- package/templates/production-fullstack/client/src/hooks/useLenis.ts +28 -0
- package/templates/production-fullstack/client/src/hooks/usePwaInstall.ts +45 -0
- package/templates/production-fullstack/client/src/hooks/useWindowSize.ts +25 -0
- package/templates/production-fullstack/client/src/index.css +158 -0
- package/templates/production-fullstack/client/src/lib/axios.ts +22 -0
- package/templates/production-fullstack/client/src/lib/dayjs.ts +12 -0
- package/templates/production-fullstack/client/src/lib/query-client.ts +11 -0
- package/templates/production-fullstack/client/src/lib/socket.ts +6 -0
- package/templates/production-fullstack/client/src/main.tsx +28 -0
- package/templates/production-fullstack/client/src/store/useUiStore.ts +74 -0
- package/templates/production-fullstack/client/src/utils/formatDate.ts +19 -0
- package/templates/production-fullstack/client/src/utils/getInitials.ts +10 -0
- package/templates/production-fullstack/client/src/vite-env.d.ts +1 -0
- package/templates/production-fullstack/client/tsconfig.json +25 -0
- package/templates/production-fullstack/client/tsconfig.node.json +10 -0
- package/templates/production-fullstack/client/vite.config.ts +8 -0
- package/templates/production-fullstack/mobile/LICENSE +21 -0
- package/templates/production-fullstack/mobile/_gitignore +43 -0
- package/templates/production-fullstack/mobile/app.json +84 -0
- package/templates/production-fullstack/mobile/assets/animations/celebrate.json +1 -0
- package/templates/production-fullstack/mobile/assets/animations/infinity.json +1 -0
- package/templates/production-fullstack/mobile/assets/animations/loading.json +1 -0
- package/templates/production-fullstack/mobile/assets/fonts/Inter_Bold.ttf +0 -0
- package/templates/production-fullstack/mobile/assets/fonts/Inter_ExtraBold.ttf +0 -0
- package/templates/production-fullstack/mobile/assets/fonts/Inter_Medium.ttf +0 -0
- package/templates/production-fullstack/mobile/assets/fonts/Inter_Regular.ttf +0 -0
- package/templates/production-fullstack/mobile/assets/fonts/Inter_SemiBold.ttf +0 -0
- package/templates/production-fullstack/mobile/assets/images/logo/logo.png +0 -0
- package/templates/production-fullstack/mobile/assets/images/logo/logo.svg +1 -0
- package/templates/production-fullstack/mobile/assets/images/logo/logoWithBg.png +0 -0
- package/templates/production-fullstack/mobile/babel.config.js +13 -0
- package/templates/production-fullstack/mobile/drizzle.config.ts +8 -0
- package/templates/production-fullstack/mobile/eas.json +24 -0
- package/templates/production-fullstack/mobile/eslint.config.js +10 -0
- package/templates/production-fullstack/mobile/expo-env.d.ts +3 -0
- package/templates/production-fullstack/mobile/metro.config.js +6 -0
- package/templates/production-fullstack/mobile/nativewind-env.d.ts +3 -0
- package/templates/production-fullstack/mobile/package.json +89 -0
- package/templates/production-fullstack/mobile/src/app/(auth)/_layout.tsx +12 -0
- package/templates/production-fullstack/mobile/src/app/(auth)/change-password.tsx +112 -0
- package/templates/production-fullstack/mobile/src/app/(auth)/edit-profile.tsx +160 -0
- package/templates/production-fullstack/mobile/src/app/(auth)/forgot-password.tsx +191 -0
- package/templates/production-fullstack/mobile/src/app/(auth)/login.tsx +253 -0
- package/templates/production-fullstack/mobile/src/app/_layout.tsx +102 -0
- package/templates/production-fullstack/mobile/src/app/global.css +82 -0
- package/templates/production-fullstack/mobile/src/components/common/AnimatedHeader.tsx +328 -0
- package/templates/production-fullstack/mobile/src/components/common/ConfirmationToast.tsx +67 -0
- package/templates/production-fullstack/mobile/src/components/common/Loading.tsx +26 -0
- package/templates/production-fullstack/mobile/src/components/common/LocationLoader.tsx +591 -0
- package/templates/production-fullstack/mobile/src/components/common/ScreenHeader.tsx +68 -0
- package/templates/production-fullstack/mobile/src/components/common/TabHeader.tsx +58 -0
- package/templates/production-fullstack/mobile/src/components/common/Typography.tsx +113 -0
- package/templates/production-fullstack/mobile/src/components/common/Welcome.tsx +55 -0
- package/templates/production-fullstack/mobile/src/components/ui/BottomModal.tsx +159 -0
- package/templates/production-fullstack/mobile/src/components/ui/ClassicTabBar.tsx +129 -0
- package/templates/production-fullstack/mobile/src/components/ui/CustomTabBar.tsx +238 -0
- package/templates/production-fullstack/mobile/src/components/ui/Sidebar.tsx +258 -0
- package/templates/production-fullstack/mobile/src/components/ui/buttons/Button.tsx +180 -0
- package/templates/production-fullstack/mobile/src/components/ui/buttons/ButtonGroup.tsx +32 -0
- package/templates/production-fullstack/mobile/src/components/ui/buttons/FloatingActionButton.tsx +72 -0
- package/templates/production-fullstack/mobile/src/components/ui/buttons/IconButton.tsx +84 -0
- package/templates/production-fullstack/mobile/src/components/ui/data-display/Accordion.tsx +82 -0
- package/templates/production-fullstack/mobile/src/components/ui/data-display/Avatar.tsx +47 -0
- package/templates/production-fullstack/mobile/src/components/ui/data-display/Badge.tsx +104 -0
- package/templates/production-fullstack/mobile/src/components/ui/data-display/Card.tsx +36 -0
- package/templates/production-fullstack/mobile/src/components/ui/data-display/Image.tsx +43 -0
- package/templates/production-fullstack/mobile/src/components/ui/data-display/ImageViewer.tsx +33 -0
- package/templates/production-fullstack/mobile/src/components/ui/data-display/SwipeableRow.tsx +94 -0
- package/templates/production-fullstack/mobile/src/components/ui/feedback/CircularProgress.tsx +38 -0
- package/templates/production-fullstack/mobile/src/components/ui/feedback/GestureWrapper.tsx +114 -0
- package/templates/production-fullstack/mobile/src/components/ui/feedback/ProgressBar.tsx +51 -0
- package/templates/production-fullstack/mobile/src/components/ui/feedback/Skeleton.tsx +84 -0
- package/templates/production-fullstack/mobile/src/components/ui/feedback/Spinner.tsx +50 -0
- package/templates/production-fullstack/mobile/src/components/ui/inputs/Checkbox.tsx +54 -0
- package/templates/production-fullstack/mobile/src/components/ui/inputs/DatePicker.tsx +186 -0
- package/templates/production-fullstack/mobile/src/components/ui/inputs/ImagePickerModal.tsx +129 -0
- package/templates/production-fullstack/mobile/src/components/ui/inputs/Input.tsx +158 -0
- package/templates/production-fullstack/mobile/src/components/ui/inputs/LocationPicker.tsx +211 -0
- package/templates/production-fullstack/mobile/src/components/ui/inputs/OTPInput.tsx +83 -0
- package/templates/production-fullstack/mobile/src/components/ui/inputs/PasswordInput.tsx +16 -0
- package/templates/production-fullstack/mobile/src/components/ui/inputs/Radio.tsx +54 -0
- package/templates/production-fullstack/mobile/src/components/ui/inputs/SearchBar.tsx +53 -0
- package/templates/production-fullstack/mobile/src/components/ui/inputs/Slider.tsx +49 -0
- package/templates/production-fullstack/mobile/src/components/ui/inputs/Switch.tsx +75 -0
- package/templates/production-fullstack/mobile/src/components/ui/inputs/TextArea.tsx +15 -0
- package/templates/production-fullstack/mobile/src/components/ui/inputs/WebLocationPicker.tsx +321 -0
- package/templates/production-fullstack/mobile/src/components/ui/layout/Container.tsx +23 -0
- package/templates/production-fullstack/mobile/src/components/ui/layout/Divider.tsx +20 -0
- package/templates/production-fullstack/mobile/src/components/ui/layout/Grid.tsx +62 -0
- package/templates/production-fullstack/mobile/src/components/ui/layout/KeyboardAvoidingViewWrapper.tsx +16 -0
- package/templates/production-fullstack/mobile/src/components/ui/layout/ScrollContainer.tsx +21 -0
- package/templates/production-fullstack/mobile/src/components/ui/layout/Section.tsx +51 -0
- package/templates/production-fullstack/mobile/src/components/ui/layout/Spacer.tsx +6 -0
- package/templates/production-fullstack/mobile/src/components/ui/layout/Stack.tsx +34 -0
- package/templates/production-fullstack/mobile/src/components/ui/navigation/Pagination.tsx +61 -0
- package/templates/production-fullstack/mobile/src/components/ui/navigation/ProgressStepper.tsx +66 -0
- package/templates/production-fullstack/mobile/src/components/ui/navigation/Tabs.tsx +173 -0
- package/templates/production-fullstack/mobile/src/config/sidebar.config.ts +72 -0
- package/templates/production-fullstack/mobile/src/config/tabNavigation.ts +64 -0
- package/templates/production-fullstack/mobile/src/constants/Colors.ts +71 -0
- package/templates/production-fullstack/mobile/src/db/index.ts +9 -0
- package/templates/production-fullstack/mobile/src/db/schema.ts +14 -0
- package/templates/production-fullstack/mobile/src/features/auth/api/auth.service.ts +35 -0
- package/templates/production-fullstack/mobile/src/features/auth/store/useAuthStore.ts +273 -0
- package/templates/production-fullstack/mobile/src/features/auth/types/auth.type.ts +14 -0
- package/templates/production-fullstack/mobile/src/hooks/useDebounce.ts +17 -0
- package/templates/production-fullstack/mobile/src/lib/axios.ts +27 -0
- package/templates/production-fullstack/mobile/src/lib/query-client.ts +11 -0
- package/templates/production-fullstack/mobile/src/lib/socket.ts +36 -0
- package/templates/production-fullstack/mobile/src/lib/storage.ts +55 -0
- package/templates/production-fullstack/mobile/src/services/permission.service.ts +214 -0
- package/templates/production-fullstack/mobile/src/store/localStore.ts +7 -0
- package/templates/production-fullstack/mobile/src/store/useNotificationStore.ts +53 -0
- package/templates/production-fullstack/mobile/src/types/common.type.ts +6 -0
- package/templates/production-fullstack/mobile/src/types/images.d.ts +24 -0
- package/templates/production-fullstack/mobile/src/utils/toast.ts +26 -0
- package/templates/production-fullstack/mobile/tailwind.config.js +71 -0
- package/templates/production-fullstack/mobile/tsconfig.json +23 -0
- package/templates/production-fullstack/server/.env.example +63 -0
- package/templates/production-fullstack/server/README.md +75 -0
- package/templates/production-fullstack/server/_gitignore +24 -0
- package/templates/production-fullstack/server/eslint.config.js +13 -0
- package/templates/production-fullstack/server/package.json +58 -0
- package/templates/production-fullstack/server/prisma/schema/core/attachment.prisma +14 -0
- package/templates/production-fullstack/server/prisma/schema/core/notification.prisma +18 -0
- package/templates/production-fullstack/server/prisma/schema/core/permission.prisma +26 -0
- package/templates/production-fullstack/server/prisma/schema/core/role.prisma +25 -0
- package/templates/production-fullstack/server/prisma/schema/core/user.prisma +56 -0
- package/templates/production-fullstack/server/prisma/schema/enums/common.prisma +13 -0
- package/templates/production-fullstack/server/prisma/schema/enums/notification.prisma +6 -0
- package/templates/production-fullstack/server/prisma/schema/enums/user.prisma +11 -0
- package/templates/production-fullstack/server/prisma/schema/schema.prisma +7 -0
- package/templates/production-fullstack/server/prisma.config.ts +14 -0
- package/templates/production-fullstack/server/src/app.ts +36 -0
- package/templates/production-fullstack/server/src/common/middlewares/auth.middleware.ts +45 -0
- package/templates/production-fullstack/server/src/common/middlewares/errorHandler.ts +16 -0
- package/templates/production-fullstack/server/src/common/middlewares/multer.ts +20 -0
- package/templates/production-fullstack/server/src/common/middlewares/rateLimiter.ts +53 -0
- package/templates/production-fullstack/server/src/common/services/email.service.ts +28 -0
- package/templates/production-fullstack/server/src/common/services/push.service.ts +65 -0
- package/templates/production-fullstack/server/src/common/services/storage.service.ts +9 -0
- package/templates/production-fullstack/server/src/common/types/express.d.ts +10 -0
- package/templates/production-fullstack/server/src/common/utils/cloudinaryUpload.ts +44 -0
- package/templates/production-fullstack/server/src/common/utils/emailOtp.ts +30 -0
- package/templates/production-fullstack/server/src/common/utils/genOtpToken.ts +22 -0
- package/templates/production-fullstack/server/src/common/utils/generateVapidKeys.ts +12 -0
- package/templates/production-fullstack/server/src/common/utils/jwt.ts +27 -0
- package/templates/production-fullstack/server/src/common/utils/pushHelper.ts +22 -0
- package/templates/production-fullstack/server/src/config/env.ts +2 -0
- package/templates/production-fullstack/server/src/config/logger.ts +58 -0
- package/templates/production-fullstack/server/src/config/prisma.ts +26 -0
- package/templates/production-fullstack/server/src/features/attachments/upload.controller.ts +22 -0
- package/templates/production-fullstack/server/src/features/attachments/upload.routes.ts +11 -0
- package/templates/production-fullstack/server/src/features/auth/auth.controller.ts +124 -0
- package/templates/production-fullstack/server/src/features/auth/auth.routes.ts +22 -0
- package/templates/production-fullstack/server/src/features/auth/auth.service.ts +155 -0
- package/templates/production-fullstack/server/src/features/notifications/push.controller.ts +55 -0
- package/templates/production-fullstack/server/src/features/notifications/push.routes.ts +11 -0
- package/templates/production-fullstack/server/src/index.ts +17 -0
- package/templates/production-fullstack/server/src/routes/index.ts +12 -0
- package/templates/production-fullstack/server/src/sockets/auth.ts +0 -0
- package/templates/production-fullstack/server/src/sockets/connection.ts +31 -0
- package/templates/production-fullstack/server/src/sockets/emitters/assignment.emitter.ts +0 -0
- package/templates/production-fullstack/server/src/sockets/emitters/attendance.emitter.ts +0 -0
- package/templates/production-fullstack/server/src/sockets/emitters/exam.emitter.ts +0 -0
- package/templates/production-fullstack/server/src/sockets/emitters/notification.emitter.ts +17 -0
- package/templates/production-fullstack/server/src/sockets/events.ts +27 -0
- package/templates/production-fullstack/server/src/sockets/handlers/attendance.handler.ts +0 -0
- package/templates/production-fullstack/server/src/sockets/handlers/chat.handler.ts +0 -0
- package/templates/production-fullstack/server/src/sockets/handlers/index.ts +15 -0
- package/templates/production-fullstack/server/src/sockets/handlers/lms.handler.ts +0 -0
- package/templates/production-fullstack/server/src/sockets/handlers/notification.handler.ts +39 -0
- package/templates/production-fullstack/server/src/sockets/index.ts +39 -0
- package/templates/production-fullstack/server/src/sockets/middleware.ts +54 -0
- package/templates/production-fullstack/server/src/sockets/rooms.ts +11 -0
- package/templates/production-fullstack/server/src/sockets/types.ts +32 -0
- package/templates/production-fullstack/server/tsconfig.json +14 -0
- package/templates/react/src/assets/animations/loading.json +1 -0
- package/templates/react-native/_gitignore +43 -0
- package/templates/react-native/package.json +2 -1
- package/templates/react-native/src/app/(auth)/edit-profile.tsx +11 -15
- package/templates/react-native/src/app/(tabs)/dashboard.tsx +2 -2
- package/templates/react-native/src/app/(tabs)/search.tsx +2 -2
- package/templates/react-native/src/config/sidebar.config.ts +0 -60
- package/templates/react-native/src/config/tabNavigation.ts +6 -36
- package/templates/react-native/src/services/notification.service.ts +22 -0
- package/templates/react-native/src/store/useNotificationStore.ts +158 -33
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { View, TouchableOpacity } from "react-native";
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
import { Txt } from "./Typography";
|
|
4
|
+
import { useColorScheme } from "nativewind";
|
|
5
|
+
import { Colors } from "../../constants/Colors";
|
|
6
|
+
import Sidebar from "../ui/Sidebar";
|
|
7
|
+
import { Ionicons } from "@expo/vector-icons";
|
|
8
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
9
|
+
|
|
10
|
+
export default function TabHeader({
|
|
11
|
+
title,
|
|
12
|
+
actions,
|
|
13
|
+
showMenuButton = false,
|
|
14
|
+
}: {
|
|
15
|
+
title?: string;
|
|
16
|
+
actions?: React.ReactNode;
|
|
17
|
+
showMenuButton?: boolean;
|
|
18
|
+
}) {
|
|
19
|
+
const { colorScheme } = useColorScheme();
|
|
20
|
+
const [isSidebarOpen, setIsSidebarOpen] = useState<boolean>(false);
|
|
21
|
+
const colors = Colors[colorScheme ?? "light"];
|
|
22
|
+
const insets = useSafeAreaInsets();
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<>
|
|
26
|
+
<View
|
|
27
|
+
className="px-6 flex-row items-center justify-between border-b border-base-200 w-full"
|
|
28
|
+
style={{
|
|
29
|
+
backgroundColor: colors.base200,
|
|
30
|
+
height: insets.top + 56,
|
|
31
|
+
paddingTop: insets.top,
|
|
32
|
+
}}
|
|
33
|
+
>
|
|
34
|
+
<View className="flex-row items-center flex-1 mr-4">
|
|
35
|
+
{showMenuButton && (
|
|
36
|
+
<TouchableOpacity
|
|
37
|
+
onPress={() => setIsSidebarOpen(true)}
|
|
38
|
+
activeOpacity={0.7}
|
|
39
|
+
className="w-10 h-10 rounded-full bg-base-200/80 items-center justify-center mr-3 border border-base-300/10 shadow-sm"
|
|
40
|
+
>
|
|
41
|
+
<Ionicons
|
|
42
|
+
name="menu-outline"
|
|
43
|
+
color={colors.baseContent}
|
|
44
|
+
size={22}
|
|
45
|
+
/>
|
|
46
|
+
</TouchableOpacity>
|
|
47
|
+
)}
|
|
48
|
+
<Txt variant="xl" className="text-primary">
|
|
49
|
+
{title}
|
|
50
|
+
</Txt>
|
|
51
|
+
</View>
|
|
52
|
+
<View className="flex-row items-center gap-2">{actions}</View>
|
|
53
|
+
</View>
|
|
54
|
+
|
|
55
|
+
<Sidebar isOpen={isSidebarOpen} onClose={() => setIsSidebarOpen(false)} />
|
|
56
|
+
</>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Text, TextProps } from "react-native";
|
|
3
|
+
export const FontFamily = {
|
|
4
|
+
regular: "InterRegular",
|
|
5
|
+
medium: "InterMedium",
|
|
6
|
+
semibold: "InterSemiBold",
|
|
7
|
+
bold: "InterBold",
|
|
8
|
+
extrabold: "InterExtraBold",
|
|
9
|
+
} as const;
|
|
10
|
+
|
|
11
|
+
export type TxtVariant =
|
|
12
|
+
| "caption"
|
|
13
|
+
| "xxs"
|
|
14
|
+
| "xs"
|
|
15
|
+
| "sm"
|
|
16
|
+
| "base"
|
|
17
|
+
| "md"
|
|
18
|
+
| "lg"
|
|
19
|
+
| "xl"
|
|
20
|
+
| "2xl"
|
|
21
|
+
| "3xl"
|
|
22
|
+
| "4xl"
|
|
23
|
+
| "5xl"
|
|
24
|
+
| "6xl"
|
|
25
|
+
| "7xl";
|
|
26
|
+
|
|
27
|
+
export interface TxtProps extends TextProps {
|
|
28
|
+
variant?: TxtVariant;
|
|
29
|
+
color?: string;
|
|
30
|
+
align?: "auto" | "left" | "right" | "center" | "justify";
|
|
31
|
+
weight?: "normal" | "medium" | "bold" | "semibold" | "black";
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const Txt = ({
|
|
35
|
+
variant = "base",
|
|
36
|
+
color,
|
|
37
|
+
align,
|
|
38
|
+
weight,
|
|
39
|
+
style,
|
|
40
|
+
className = "",
|
|
41
|
+
children,
|
|
42
|
+
...props
|
|
43
|
+
}: TxtProps) => {
|
|
44
|
+
const getVariantStyles = () => {
|
|
45
|
+
switch (variant) {
|
|
46
|
+
case "caption":
|
|
47
|
+
return { fontFamily: FontFamily.regular, fontSize: 10 };
|
|
48
|
+
case "xxs":
|
|
49
|
+
return { fontFamily: FontFamily.regular, fontSize: 8 };
|
|
50
|
+
case "xs":
|
|
51
|
+
return { fontFamily: FontFamily.regular, fontSize: 10 };
|
|
52
|
+
case "sm":
|
|
53
|
+
return { fontFamily: FontFamily.regular, fontSize: 12 };
|
|
54
|
+
case "base":
|
|
55
|
+
return { fontFamily: FontFamily.regular, fontSize: 14 };
|
|
56
|
+
case "md":
|
|
57
|
+
return { fontFamily: FontFamily.medium, fontSize: 16 };
|
|
58
|
+
case "lg":
|
|
59
|
+
return { fontFamily: FontFamily.semibold, fontSize: 18 };
|
|
60
|
+
case "xl":
|
|
61
|
+
return { fontFamily: FontFamily.bold, fontSize: 20 };
|
|
62
|
+
case "2xl":
|
|
63
|
+
return { fontFamily: FontFamily.bold, fontSize: 24 };
|
|
64
|
+
case "3xl":
|
|
65
|
+
return { fontFamily: FontFamily.extrabold, fontSize: 30 };
|
|
66
|
+
case "4xl":
|
|
67
|
+
return { fontFamily: FontFamily.extrabold, fontSize: 36 };
|
|
68
|
+
case "5xl":
|
|
69
|
+
return { fontFamily: FontFamily.extrabold, fontSize: 48 };
|
|
70
|
+
case "6xl":
|
|
71
|
+
return { fontFamily: FontFamily.extrabold, fontSize: 60 };
|
|
72
|
+
case "7xl":
|
|
73
|
+
return { fontFamily: FontFamily.extrabold, fontSize: 72 };
|
|
74
|
+
default:
|
|
75
|
+
return { fontFamily: FontFamily.regular, fontSize: 14 };
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const baseStyle = getVariantStyles();
|
|
80
|
+
const hasColorClass = className.split(" ").some((c) => {
|
|
81
|
+
if (!c.startsWith("text-")) return false;
|
|
82
|
+
const val = c.substring(5).split("/")[0]; // handle potential opacity suffix like text-white/80
|
|
83
|
+
const isSize = ["xxs", "xs", "sm", "base", "md", "lg", "xl", "2xl", "3xl", "4xl", "5xl", "6xl", "7xl", "caption"].includes(val);
|
|
84
|
+
return !isSize;
|
|
85
|
+
});
|
|
86
|
+
const defaultColorClass = hasColorClass
|
|
87
|
+
? ""
|
|
88
|
+
: variant === "xs"
|
|
89
|
+
? "text-secondary"
|
|
90
|
+
: "text-base-content";
|
|
91
|
+
|
|
92
|
+
// Override specific properties if provided
|
|
93
|
+
const customStyles: any = {};
|
|
94
|
+
if (color) customStyles.color = color;
|
|
95
|
+
if (align) customStyles.textAlign = align;
|
|
96
|
+
if (weight) {
|
|
97
|
+
if (weight === "bold" || weight === "black")
|
|
98
|
+
customStyles.fontFamily = FontFamily.bold;
|
|
99
|
+
if (weight === "semibold") customStyles.fontFamily = FontFamily.semibold;
|
|
100
|
+
if (weight === "medium") customStyles.fontFamily = FontFamily.medium;
|
|
101
|
+
if (weight === "normal") customStyles.fontFamily = FontFamily.regular;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return (
|
|
105
|
+
<Text
|
|
106
|
+
className={`${defaultColorClass} ${className}`}
|
|
107
|
+
style={[baseStyle, customStyles, style]}
|
|
108
|
+
{...props}
|
|
109
|
+
>
|
|
110
|
+
{children}
|
|
111
|
+
</Text>
|
|
112
|
+
);
|
|
113
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { View, Text } from "react-native";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import LottieView from "lottie-react-native";
|
|
4
|
+
import infinity1 from "../../../assets/animations/infinity.json";
|
|
5
|
+
import { Txt } from "./Typography";
|
|
6
|
+
import { useAuthStore } from "../../features/auth/store/useAuthStore";
|
|
7
|
+
|
|
8
|
+
const emojis = [
|
|
9
|
+
"😎", "😍", "🤩", "🎉", "🥳", "💐", "✨", "😊", "👋", "💖", "🤗"
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
const Welcome = () => {
|
|
13
|
+
const { user } = useAuthStore();
|
|
14
|
+
const [i, setI] = useState(0);
|
|
15
|
+
const [emoji, setEmoji] = useState("😎");
|
|
16
|
+
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
const timer = setInterval(() => {
|
|
19
|
+
setI((prevI) => {
|
|
20
|
+
const nextI = (prevI + 1) % emojis.length;
|
|
21
|
+
setEmoji(emojis[nextI]);
|
|
22
|
+
return nextI;
|
|
23
|
+
});
|
|
24
|
+
}, 2000);
|
|
25
|
+
return () => clearInterval(timer);
|
|
26
|
+
}, []);
|
|
27
|
+
return (
|
|
28
|
+
<View className="flex-row flex-wrap justify-between item-center pl-4 mt-6 items-center">
|
|
29
|
+
<View className="w-[55%] relative justify-end">
|
|
30
|
+
<Txt variant="6xl"> Hey {user ? user.name : "There"}!</Txt>
|
|
31
|
+
<View className="flex-row w-64 items-center">
|
|
32
|
+
<Txt variant="6xl">Welcome Back</Txt>
|
|
33
|
+
<Text
|
|
34
|
+
key={i}
|
|
35
|
+
style={{ fontSize: 28 }}
|
|
36
|
+
className="animate-float-up relative top-3"
|
|
37
|
+
>
|
|
38
|
+
{" "}
|
|
39
|
+
{emoji}
|
|
40
|
+
</Text>
|
|
41
|
+
</View>
|
|
42
|
+
</View>
|
|
43
|
+
<View className="w-[45%] justify-center items-center ">
|
|
44
|
+
<LottieView
|
|
45
|
+
source={infinity1}
|
|
46
|
+
autoPlay
|
|
47
|
+
loop
|
|
48
|
+
style={{ width: 120, height: 120 }}
|
|
49
|
+
/>
|
|
50
|
+
</View>
|
|
51
|
+
</View>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default Welcome;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
TouchableWithoutFeedback,
|
|
5
|
+
Dimensions,
|
|
6
|
+
StyleSheet,
|
|
7
|
+
KeyboardAvoidingView,
|
|
8
|
+
Platform,
|
|
9
|
+
} from "react-native";
|
|
10
|
+
import Animated, {
|
|
11
|
+
useSharedValue,
|
|
12
|
+
useAnimatedStyle,
|
|
13
|
+
withTiming,
|
|
14
|
+
Easing,
|
|
15
|
+
runOnJS,
|
|
16
|
+
} from "react-native-reanimated";
|
|
17
|
+
import { Gesture, GestureDetector } from "react-native-gesture-handler";
|
|
18
|
+
import { Portal } from "react-native-paper";
|
|
19
|
+
import { useColorScheme } from "nativewind";
|
|
20
|
+
import { Colors } from "../../constants/Colors";
|
|
21
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
22
|
+
|
|
23
|
+
const { height } = Dimensions.get("window");
|
|
24
|
+
|
|
25
|
+
interface BottomModalProps {
|
|
26
|
+
isOpen: boolean;
|
|
27
|
+
onClose: () => void;
|
|
28
|
+
children: React.ReactNode;
|
|
29
|
+
heightPercent?: number; // e.g. 0.5 for 50% of the screen height
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default function BottomModal({
|
|
33
|
+
isOpen,
|
|
34
|
+
onClose,
|
|
35
|
+
children,
|
|
36
|
+
heightPercent = 0.5,
|
|
37
|
+
}: BottomModalProps) {
|
|
38
|
+
const { colorScheme } = useColorScheme();
|
|
39
|
+
const colors = Colors[colorScheme ?? "light"];
|
|
40
|
+
const insets = useSafeAreaInsets();
|
|
41
|
+
|
|
42
|
+
const MODAL_HEIGHT = height * heightPercent;
|
|
43
|
+
const translateY = useSharedValue(MODAL_HEIGHT);
|
|
44
|
+
const backdropOpacity = useSharedValue(0);
|
|
45
|
+
const [isRendered, setIsRendered] = useState(false);
|
|
46
|
+
|
|
47
|
+
if (isOpen && !isRendered) {
|
|
48
|
+
setIsRendered(true);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
if (isOpen) {
|
|
53
|
+
translateY.value = withTiming(0, {
|
|
54
|
+
duration: 300,
|
|
55
|
+
easing: Easing.out(Easing.ease),
|
|
56
|
+
});
|
|
57
|
+
backdropOpacity.value = withTiming(0.4, { duration: 300 });
|
|
58
|
+
} else {
|
|
59
|
+
translateY.value = withTiming(MODAL_HEIGHT, {
|
|
60
|
+
duration: 300,
|
|
61
|
+
easing: Easing.in(Easing.ease),
|
|
62
|
+
});
|
|
63
|
+
backdropOpacity.value = withTiming(0, { duration: 300 }, (finished) => {
|
|
64
|
+
if (finished) {
|
|
65
|
+
runOnJS(setIsRendered)(false);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
}, [isOpen]);
|
|
71
|
+
|
|
72
|
+
const panGesture = Gesture.Pan()
|
|
73
|
+
.onUpdate((event) => {
|
|
74
|
+
if (event.translationY > 0) {
|
|
75
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
76
|
+
translateY.value = event.translationY;
|
|
77
|
+
}
|
|
78
|
+
})
|
|
79
|
+
.onEnd((event) => {
|
|
80
|
+
if (event.translationY > MODAL_HEIGHT * 0.3 || event.velocityY > 500) {
|
|
81
|
+
runOnJS(onClose)();
|
|
82
|
+
} else {
|
|
83
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
84
|
+
translateY.value = withTiming(0, {
|
|
85
|
+
duration: 300,
|
|
86
|
+
easing: Easing.out(Easing.ease),
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const modalAnimatedStyle = useAnimatedStyle(() => ({
|
|
92
|
+
transform: [{ translateY: translateY.value }],
|
|
93
|
+
}));
|
|
94
|
+
|
|
95
|
+
const backdropAnimatedStyle = useAnimatedStyle(() => ({
|
|
96
|
+
opacity: backdropOpacity.value,
|
|
97
|
+
}));
|
|
98
|
+
|
|
99
|
+
if (!isRendered && !isOpen) return null;
|
|
100
|
+
|
|
101
|
+
return (
|
|
102
|
+
<Portal>
|
|
103
|
+
<KeyboardAvoidingView
|
|
104
|
+
behavior={Platform.OS === "ios" ? "padding" : undefined}
|
|
105
|
+
style={StyleSheet.absoluteFill}
|
|
106
|
+
pointerEvents="box-none"
|
|
107
|
+
>
|
|
108
|
+
<View style={[StyleSheet.absoluteFill, { zIndex: 999 }]}>
|
|
109
|
+
{/* Backdrop Overlay */}
|
|
110
|
+
<TouchableWithoutFeedback onPress={onClose}>
|
|
111
|
+
<Animated.View
|
|
112
|
+
style={[
|
|
113
|
+
StyleSheet.absoluteFill,
|
|
114
|
+
{ backgroundColor: "#000" },
|
|
115
|
+
backdropAnimatedStyle,
|
|
116
|
+
]}
|
|
117
|
+
/>
|
|
118
|
+
</TouchableWithoutFeedback>
|
|
119
|
+
|
|
120
|
+
{/* Sliding Bottom Modal Panel */}
|
|
121
|
+
<Animated.View
|
|
122
|
+
style={[
|
|
123
|
+
{
|
|
124
|
+
position: "absolute",
|
|
125
|
+
bottom: 0,
|
|
126
|
+
left: 0,
|
|
127
|
+
right: 0,
|
|
128
|
+
height: MODAL_HEIGHT,
|
|
129
|
+
backgroundColor: colors.base100,
|
|
130
|
+
borderTopLeftRadius: 30,
|
|
131
|
+
borderTopRightRadius: 30,
|
|
132
|
+
elevation: 24,
|
|
133
|
+
shadowColor: "#000",
|
|
134
|
+
shadowOffset: { width: 0, height: -5 },
|
|
135
|
+
shadowOpacity: 0.15,
|
|
136
|
+
shadowRadius: 15,
|
|
137
|
+
paddingBottom: insets.bottom > 0 ? insets.bottom : 20,
|
|
138
|
+
},
|
|
139
|
+
modalAnimatedStyle,
|
|
140
|
+
]}
|
|
141
|
+
>
|
|
142
|
+
{/* Drag Handle Indicator */}
|
|
143
|
+
<GestureDetector gesture={panGesture}>
|
|
144
|
+
<View
|
|
145
|
+
className="items-center pt-4 pb-6 bg-base-100 rounded-t-[30px]"
|
|
146
|
+
style={{ zIndex: 10 }}
|
|
147
|
+
>
|
|
148
|
+
<View className="w-16 h-1.5 rounded-full bg-base-300" />
|
|
149
|
+
</View>
|
|
150
|
+
</GestureDetector>
|
|
151
|
+
|
|
152
|
+
{/* Modal Content */}
|
|
153
|
+
<View className="flex-1 px-6">{children}</View>
|
|
154
|
+
</Animated.View>
|
|
155
|
+
</View>
|
|
156
|
+
</KeyboardAvoidingView>
|
|
157
|
+
</Portal>
|
|
158
|
+
);
|
|
159
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { Txt } from "../common/Typography";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { View, TouchableOpacity, StyleSheet } from 'react-native';
|
|
4
|
+
import { Ionicons } from '@expo/vector-icons';
|
|
5
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
|
+
import { useColorScheme } from 'nativewind';
|
|
7
|
+
import { Colors } from '../../constants/Colors';
|
|
8
|
+
import { getTabConfig } from '../../config/tabNavigation';
|
|
9
|
+
|
|
10
|
+
const TabItem = ({ isFocused, onPress, onLongPress, iconName, label, colors }: any) => {
|
|
11
|
+
return (
|
|
12
|
+
<TouchableOpacity
|
|
13
|
+
accessibilityRole="button"
|
|
14
|
+
accessibilityState={isFocused ? { selected: true } : {}}
|
|
15
|
+
onPress={onPress}
|
|
16
|
+
onLongPress={onLongPress}
|
|
17
|
+
style={styles.tabButton}
|
|
18
|
+
activeOpacity={0.8}
|
|
19
|
+
>
|
|
20
|
+
<View style={styles.tabItem}>
|
|
21
|
+
<Ionicons
|
|
22
|
+
name={iconName as any}
|
|
23
|
+
size={24}
|
|
24
|
+
color={isFocused ? colors.primary : colors.secondary}
|
|
25
|
+
style={{ marginBottom: 4 }}
|
|
26
|
+
/>
|
|
27
|
+
<Txt
|
|
28
|
+
style={{
|
|
29
|
+
color: isFocused ? colors.primary : colors.secondary,
|
|
30
|
+
fontWeight: isFocused ? '600' : '500',
|
|
31
|
+
fontSize: 11
|
|
32
|
+
}}
|
|
33
|
+
>
|
|
34
|
+
{label}
|
|
35
|
+
</Txt>
|
|
36
|
+
</View>
|
|
37
|
+
</TouchableOpacity>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export default function ClassicTabBar({ state, descriptors, navigation }: any) {
|
|
42
|
+
const insets = useSafeAreaInsets();
|
|
43
|
+
const { colorScheme } = useColorScheme();
|
|
44
|
+
const colors = Colors[colorScheme ?? 'light'];
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<View style={[
|
|
48
|
+
styles.container,
|
|
49
|
+
{
|
|
50
|
+
backgroundColor: colors.base100,
|
|
51
|
+
borderTopColor: colors.base300,
|
|
52
|
+
height: 60 + insets.bottom,
|
|
53
|
+
paddingBottom: insets.bottom > 0 ? insets.bottom : 8,
|
|
54
|
+
}
|
|
55
|
+
]}>
|
|
56
|
+
{state.routes.map((route: any, index: number) => {
|
|
57
|
+
const { options } = descriptors[route.key];
|
|
58
|
+
const tabConfig = getTabConfig(route.name);
|
|
59
|
+
const label = options.tabBarLabel !== undefined
|
|
60
|
+
? options.tabBarLabel
|
|
61
|
+
: options.title !== undefined
|
|
62
|
+
? options.title
|
|
63
|
+
: tabConfig?.title || route.name;
|
|
64
|
+
|
|
65
|
+
const isFocused = state.index === index;
|
|
66
|
+
|
|
67
|
+
const onPress = () => {
|
|
68
|
+
const event = navigation.emit({
|
|
69
|
+
type: 'tabPress',
|
|
70
|
+
target: route.key,
|
|
71
|
+
canPreventDefault: true,
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
if (!isFocused && !event.defaultPrevented) {
|
|
75
|
+
navigation.navigate(route.name, route.params);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const onLongPress = () => {
|
|
80
|
+
navigation.emit({
|
|
81
|
+
type: 'tabLongPress',
|
|
82
|
+
target: route.key,
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
let iconName: any = tabConfig?.baseIcon || "home";
|
|
87
|
+
iconName = isFocused ? iconName : `${iconName}-outline`;
|
|
88
|
+
|
|
89
|
+
return (
|
|
90
|
+
<TabItem
|
|
91
|
+
key={route.key}
|
|
92
|
+
isFocused={isFocused}
|
|
93
|
+
onPress={onPress}
|
|
94
|
+
onLongPress={onLongPress}
|
|
95
|
+
iconName={iconName}
|
|
96
|
+
label={label as string}
|
|
97
|
+
colors={colors}
|
|
98
|
+
/>
|
|
99
|
+
);
|
|
100
|
+
})}
|
|
101
|
+
</View>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const styles = StyleSheet.create({
|
|
106
|
+
container: {
|
|
107
|
+
flexDirection: 'row',
|
|
108
|
+
justifyContent: 'space-between',
|
|
109
|
+
alignItems: 'center',
|
|
110
|
+
paddingVertical: 8,
|
|
111
|
+
borderTopWidth: 1,
|
|
112
|
+
elevation: 8,
|
|
113
|
+
shadowColor: '#000',
|
|
114
|
+
shadowOffset: { width: 0, height: -2 },
|
|
115
|
+
shadowOpacity: 0.05,
|
|
116
|
+
shadowRadius: 5,
|
|
117
|
+
},
|
|
118
|
+
tabButton: {
|
|
119
|
+
flex: 1,
|
|
120
|
+
alignItems: 'center',
|
|
121
|
+
justifyContent: 'center',
|
|
122
|
+
height: '100%',
|
|
123
|
+
},
|
|
124
|
+
tabItem: {
|
|
125
|
+
alignItems: 'center',
|
|
126
|
+
justifyContent: 'center',
|
|
127
|
+
height: 50,
|
|
128
|
+
},
|
|
129
|
+
});
|