@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
package/templates/production-fullstack/mobile/src/components/ui/navigation/ProgressStepper.tsx
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { useColorScheme } from "nativewind";
|
|
4
|
+
import { Colors } from "../../../constants/Colors";
|
|
5
|
+
import { Ionicons } from "@expo/vector-icons";
|
|
6
|
+
import { Txt } from "../../common/Typography";
|
|
7
|
+
|
|
8
|
+
export interface ProgressStepperProps {
|
|
9
|
+
steps: string[];
|
|
10
|
+
currentStep: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default function ProgressStepper({ steps, currentStep }: ProgressStepperProps) {
|
|
14
|
+
const { colorScheme } = useColorScheme();
|
|
15
|
+
const theme = Colors[colorScheme ?? "light"];
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<View style={{ flexDirection: "row", alignItems: "center", justifyContent: "space-between", width: "100%", paddingHorizontal: 16 }}>
|
|
19
|
+
{steps.map((step, index) => {
|
|
20
|
+
const isCompleted = index < currentStep;
|
|
21
|
+
const isActive = index === currentStep;
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<React.Fragment key={index}>
|
|
25
|
+
<View style={{ alignItems: "center", width: 40 }}>
|
|
26
|
+
<View
|
|
27
|
+
style={{
|
|
28
|
+
width: 32,
|
|
29
|
+
height: 32,
|
|
30
|
+
borderRadius: 16,
|
|
31
|
+
backgroundColor: isCompleted ? theme.success : isActive ? theme.primary : theme.base300,
|
|
32
|
+
alignItems: "center",
|
|
33
|
+
justifyContent: "center",
|
|
34
|
+
marginBottom: 8,
|
|
35
|
+
}}
|
|
36
|
+
>
|
|
37
|
+
{isCompleted ? (
|
|
38
|
+
<Ionicons name="checkmark" size={16} color="#fff" />
|
|
39
|
+
) : (
|
|
40
|
+
<Txt color={isActive ? theme.primaryContent : theme.secondary} weight="bold">
|
|
41
|
+
{index + 1}
|
|
42
|
+
</Txt>
|
|
43
|
+
)}
|
|
44
|
+
</View>
|
|
45
|
+
<Txt color={isActive ? theme.primary : theme.secondary} variant="xs" align="center">
|
|
46
|
+
{step}
|
|
47
|
+
</Txt>
|
|
48
|
+
</View>
|
|
49
|
+
|
|
50
|
+
{index < steps.length - 1 && (
|
|
51
|
+
<View
|
|
52
|
+
style={{
|
|
53
|
+
flex: 1,
|
|
54
|
+
height: 2,
|
|
55
|
+
backgroundColor: index < currentStep ? theme.success : theme.base300,
|
|
56
|
+
marginHorizontal: 4,
|
|
57
|
+
marginTop: -20,
|
|
58
|
+
}}
|
|
59
|
+
/>
|
|
60
|
+
)}
|
|
61
|
+
</React.Fragment>
|
|
62
|
+
);
|
|
63
|
+
})}
|
|
64
|
+
</View>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { View, TouchableOpacity, ScrollView, LayoutChangeEvent } from "react-native";
|
|
3
|
+
import { useColorScheme } from "nativewind";
|
|
4
|
+
import { Colors } from "../../../constants/Colors";
|
|
5
|
+
import { Txt } from "../../common/Typography";
|
|
6
|
+
import Animated, { useAnimatedStyle, withTiming, useSharedValue, Easing } from "react-native-reanimated";
|
|
7
|
+
|
|
8
|
+
export interface TabItem {
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type TabsSize = "xs" | "sm" | "base" | "md" | "lg";
|
|
14
|
+
|
|
15
|
+
export interface TabsProps {
|
|
16
|
+
tabs: TabItem[];
|
|
17
|
+
activeTab: string;
|
|
18
|
+
onChange: (id: string) => void;
|
|
19
|
+
variant?: "button" | "underline";
|
|
20
|
+
scrollable?: boolean;
|
|
21
|
+
size?: TabsSize;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default function Tabs({
|
|
25
|
+
tabs,
|
|
26
|
+
activeTab,
|
|
27
|
+
onChange,
|
|
28
|
+
variant = "underline",
|
|
29
|
+
scrollable = false,
|
|
30
|
+
size = "base",
|
|
31
|
+
}: TabsProps) {
|
|
32
|
+
const { colorScheme } = useColorScheme();
|
|
33
|
+
const theme = Colors[colorScheme ?? "light"];
|
|
34
|
+
|
|
35
|
+
const getSizeStyles = (): {
|
|
36
|
+
py: number;
|
|
37
|
+
fontSize: number;
|
|
38
|
+
} => {
|
|
39
|
+
switch (size) {
|
|
40
|
+
case "xs":
|
|
41
|
+
return { py: variant === "button" ? 5 : 6, fontSize: 11 };
|
|
42
|
+
case "sm":
|
|
43
|
+
return { py: variant === "button" ? 7 : 8, fontSize: 12 };
|
|
44
|
+
case "base":
|
|
45
|
+
return { py: variant === "button" ? 9 : 10, fontSize: 14 };
|
|
46
|
+
case "md":
|
|
47
|
+
return { py: variant === "button" ? 11 : 12, fontSize: 15 };
|
|
48
|
+
case "lg":
|
|
49
|
+
return { py: variant === "button" ? 13 : 14, fontSize: 17 };
|
|
50
|
+
default:
|
|
51
|
+
return { py: variant === "button" ? 9 : 10, fontSize: 14 };
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const sStyles = getSizeStyles();
|
|
56
|
+
|
|
57
|
+
const [tabWidths, setTabWidths] = useState<{ [key: string]: number }>({});
|
|
58
|
+
const [tabXs, setTabXs] = useState<{ [key: string]: number }>({});
|
|
59
|
+
|
|
60
|
+
const indicatorWidth = useSharedValue(0);
|
|
61
|
+
const indicatorPosition = useSharedValue(0);
|
|
62
|
+
|
|
63
|
+
React.useEffect(() => {
|
|
64
|
+
if (tabWidths[activeTab] !== undefined && tabXs[activeTab] !== undefined) {
|
|
65
|
+
const config = { duration: 250, easing: Easing.out(Easing.cubic) };
|
|
66
|
+
indicatorWidth.value = withTiming(tabWidths[activeTab], config);
|
|
67
|
+
indicatorPosition.value = withTiming(tabXs[activeTab], config);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
}, [activeTab, tabWidths, tabXs]);
|
|
71
|
+
|
|
72
|
+
const indicatorStyle = useAnimatedStyle(() => {
|
|
73
|
+
if (variant === "underline") {
|
|
74
|
+
return {
|
|
75
|
+
position: "absolute",
|
|
76
|
+
bottom: 0,
|
|
77
|
+
height: 2,
|
|
78
|
+
backgroundColor: theme.primary,
|
|
79
|
+
width: indicatorWidth.value,
|
|
80
|
+
transform: [{ translateX: indicatorPosition.value }],
|
|
81
|
+
};
|
|
82
|
+
} else {
|
|
83
|
+
return {
|
|
84
|
+
position: "absolute",
|
|
85
|
+
top: 4,
|
|
86
|
+
bottom: 4,
|
|
87
|
+
borderRadius: 12, // matched to rounded-xl in login
|
|
88
|
+
backgroundColor: theme.primary,
|
|
89
|
+
width: indicatorWidth.value,
|
|
90
|
+
transform: [{ translateX: indicatorPosition.value }],
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
const handleLayout = (id: string, e: LayoutChangeEvent) => {
|
|
96
|
+
const { width, x } = e.nativeEvent.layout;
|
|
97
|
+
setTabWidths((prev) => ({ ...prev, [id]: width }));
|
|
98
|
+
setTabXs((prev) => ({ ...prev, [id]: x }));
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const content = (
|
|
102
|
+
<View
|
|
103
|
+
style={{
|
|
104
|
+
flexDirection: "row",
|
|
105
|
+
position: "relative",
|
|
106
|
+
...(variant === "button"
|
|
107
|
+
? {
|
|
108
|
+
backgroundColor: theme.base300 + "80", // like bg-base-300/50
|
|
109
|
+
borderRadius: 16, // rounded-2xl
|
|
110
|
+
padding: 4, // p-1
|
|
111
|
+
borderWidth: 1,
|
|
112
|
+
borderColor: theme.base300,
|
|
113
|
+
}
|
|
114
|
+
: {
|
|
115
|
+
borderBottomWidth: 1,
|
|
116
|
+
borderBottomColor: theme.base300,
|
|
117
|
+
}),
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
<Animated.View style={indicatorStyle} />
|
|
121
|
+
|
|
122
|
+
{tabs.map((tab) => {
|
|
123
|
+
const isActive = activeTab === tab.id;
|
|
124
|
+
return (
|
|
125
|
+
<TouchableOpacity
|
|
126
|
+
key={tab.id}
|
|
127
|
+
onPress={() => onChange(tab.id)}
|
|
128
|
+
onLayout={(e) => handleLayout(tab.id, e)}
|
|
129
|
+
style={{
|
|
130
|
+
paddingVertical: sStyles.py,
|
|
131
|
+
paddingHorizontal: 16,
|
|
132
|
+
flex: scrollable ? undefined : 1,
|
|
133
|
+
alignItems: "center",
|
|
134
|
+
justifyContent: "center",
|
|
135
|
+
zIndex: 1,
|
|
136
|
+
}}
|
|
137
|
+
>
|
|
138
|
+
<Txt
|
|
139
|
+
variant="md"
|
|
140
|
+
style={{
|
|
141
|
+
fontSize: sStyles.fontSize,
|
|
142
|
+
fontWeight: isActive ? "600" : "500",
|
|
143
|
+
color:
|
|
144
|
+
variant === "button" && isActive
|
|
145
|
+
? theme.primaryContent
|
|
146
|
+
: isActive
|
|
147
|
+
? theme.primary
|
|
148
|
+
: theme.baseContent,
|
|
149
|
+
opacity: !isActive && variant === "button" ? 0.7 : 1,
|
|
150
|
+
}}
|
|
151
|
+
>
|
|
152
|
+
{tab.label}
|
|
153
|
+
</Txt>
|
|
154
|
+
</TouchableOpacity>
|
|
155
|
+
);
|
|
156
|
+
})}
|
|
157
|
+
</View>
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
if (scrollable) {
|
|
161
|
+
return (
|
|
162
|
+
<ScrollView
|
|
163
|
+
horizontal
|
|
164
|
+
showsHorizontalScrollIndicator={false}
|
|
165
|
+
contentContainerStyle={{ flexGrow: 1 }}
|
|
166
|
+
>
|
|
167
|
+
{content}
|
|
168
|
+
</ScrollView>
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return content;
|
|
173
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export interface SidebarMenuItem {
|
|
2
|
+
icon: string;
|
|
3
|
+
label: string;
|
|
4
|
+
route: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const sidebarConfig: Record<string, SidebarMenuItem[]> = {
|
|
8
|
+
owner: [
|
|
9
|
+
{ icon: "home-outline", label: "Dashboard", route: "/(owner)" },
|
|
10
|
+
{
|
|
11
|
+
icon: "business-outline",
|
|
12
|
+
label: "Properties",
|
|
13
|
+
route: "/(owner)/properties",
|
|
14
|
+
},
|
|
15
|
+
{ icon: "card-outline", label: "Payments", route: "/(owner)/payments" },
|
|
16
|
+
{ icon: "people-outline", label: "Tenants", route: "/(owner)/tenant" },
|
|
17
|
+
{
|
|
18
|
+
icon: "clipboard-outline",
|
|
19
|
+
label: "Requests",
|
|
20
|
+
route: "/(owner)/requests",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
icon: "construct-outline",
|
|
24
|
+
label: "Maintenance",
|
|
25
|
+
route: "/(owner)/maintenance",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
icon: "flask-outline",
|
|
29
|
+
label: "Test Notifications",
|
|
30
|
+
route: "/(owner)/test-notifications",
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
tenant: [
|
|
34
|
+
|
|
35
|
+
{
|
|
36
|
+
icon: "business-outline",
|
|
37
|
+
label: "My Units",
|
|
38
|
+
route: "/(tenant)/my-units",
|
|
39
|
+
},
|
|
40
|
+
{ icon: "search-outline", label: "Explore", route: "/(tenant)/explore" },
|
|
41
|
+
{ icon: "card-outline", label: "Payments", route: "/(tenant)/payments" },
|
|
42
|
+
{
|
|
43
|
+
icon: "construct-outline",
|
|
44
|
+
label: "Maintenance",
|
|
45
|
+
route: "/(tenant)/maintenance",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
icon: "document-text-outline",
|
|
49
|
+
label: "Documents",
|
|
50
|
+
route: "/(tenant)/documents",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
icon: "chatbubble-outline",
|
|
54
|
+
label: "Messages",
|
|
55
|
+
route: "/(tenant)/messages",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
icon: "notifications-outline",
|
|
59
|
+
label: "Notifications",
|
|
60
|
+
route: "/(tenant)/notifications",
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
icon: "flask-outline",
|
|
64
|
+
label: "Test Notifications",
|
|
65
|
+
route: "/(tenant)/test-notifications",
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
default: [
|
|
69
|
+
{ icon: "home-outline", label: "Dashboard", route: "/" },
|
|
70
|
+
{ icon: "person-outline", label: "Profile", route: "/profile" },
|
|
71
|
+
],
|
|
72
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Ionicons } from "@expo/vector-icons";
|
|
2
|
+
|
|
3
|
+
export interface TabConfig {
|
|
4
|
+
name: string;
|
|
5
|
+
title: string;
|
|
6
|
+
baseIcon: keyof typeof Ionicons.glyphMap;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const tabNavigationConfig: TabConfig[] = [
|
|
10
|
+
{
|
|
11
|
+
name: "index",
|
|
12
|
+
title: "Home",
|
|
13
|
+
baseIcon: "home",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: "explore",
|
|
17
|
+
title: "Explore",
|
|
18
|
+
baseIcon: "compass",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "payments",
|
|
22
|
+
title: "Payments",
|
|
23
|
+
baseIcon: "wallet",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "notifications",
|
|
27
|
+
title: "Notifications",
|
|
28
|
+
baseIcon: "notifications",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "profile",
|
|
32
|
+
title: "Profile",
|
|
33
|
+
baseIcon: "person-circle",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: "properties",
|
|
37
|
+
title: "Properties",
|
|
38
|
+
baseIcon: "business",
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: "tenant",
|
|
42
|
+
title: "Tenant",
|
|
43
|
+
baseIcon: "people",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: "users",
|
|
47
|
+
title: "Users",
|
|
48
|
+
baseIcon: "people",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: "requests",
|
|
52
|
+
title: "Requests",
|
|
53
|
+
baseIcon: "clipboard",
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "more",
|
|
57
|
+
title: "More",
|
|
58
|
+
baseIcon: "ellipsis-horizontal",
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
export const getTabConfig = (routeName: string) => {
|
|
63
|
+
return tabNavigationConfig.find((tab) => tab.name === routeName);
|
|
64
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export const Colors = {
|
|
2
|
+
light: {
|
|
3
|
+
// Surfaces
|
|
4
|
+
base100: "#FFFFFF",
|
|
5
|
+
base200: "#F8FAFC",
|
|
6
|
+
base300: "#E2E8F0",
|
|
7
|
+
baseContent: "#0F172A",
|
|
8
|
+
|
|
9
|
+
// Brand
|
|
10
|
+
primary: "#3B82F6",
|
|
11
|
+
primaryContent: "#FFFFFF",
|
|
12
|
+
|
|
13
|
+
secondary: "#64748B",
|
|
14
|
+
secondaryContent: "#FFFFFF",
|
|
15
|
+
|
|
16
|
+
accent: "#14B8A6",
|
|
17
|
+
accentContent: "#FFFFFF",
|
|
18
|
+
|
|
19
|
+
// Neutral
|
|
20
|
+
neutral: "#1E293B",
|
|
21
|
+
neutralContent: "#FFFFFF",
|
|
22
|
+
|
|
23
|
+
// Semantic
|
|
24
|
+
info: "#0EA5E9",
|
|
25
|
+
infoContent: "#FFFFFF",
|
|
26
|
+
|
|
27
|
+
success: "#22C55E",
|
|
28
|
+
successContent: "#FFFFFF",
|
|
29
|
+
|
|
30
|
+
warning: "#F59E0B",
|
|
31
|
+
warningContent: "#FFFFFF",
|
|
32
|
+
|
|
33
|
+
error: "#EF4444",
|
|
34
|
+
errorContent: "#FFFFFF",
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
dark: {
|
|
38
|
+
// Surfaces
|
|
39
|
+
base100: "#111827",
|
|
40
|
+
base200: "#1B2433",
|
|
41
|
+
base300: "#2A3445",
|
|
42
|
+
baseContent: "#F8FAFC",
|
|
43
|
+
|
|
44
|
+
// Brand
|
|
45
|
+
primary: "#60A5FA",
|
|
46
|
+
primaryContent: "#FFFFFF",
|
|
47
|
+
|
|
48
|
+
secondary: "#94A3B8",
|
|
49
|
+
secondaryContent: "#111827",
|
|
50
|
+
|
|
51
|
+
accent: "#2DD4BF",
|
|
52
|
+
accentContent: "#111827",
|
|
53
|
+
|
|
54
|
+
// Neutral
|
|
55
|
+
neutral: "#F8FAFC",
|
|
56
|
+
neutralContent: "#111827",
|
|
57
|
+
|
|
58
|
+
// Semantic
|
|
59
|
+
info: "#38BDF8",
|
|
60
|
+
infoContent: "#111827",
|
|
61
|
+
|
|
62
|
+
success: "#4ADE80",
|
|
63
|
+
successContent: "#111827",
|
|
64
|
+
|
|
65
|
+
warning: "#FBBF24",
|
|
66
|
+
warningContent: "#111827",
|
|
67
|
+
|
|
68
|
+
error: "#F87171",
|
|
69
|
+
errorContent: "#FFFFFF",
|
|
70
|
+
},
|
|
71
|
+
} as const;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { drizzle } from 'drizzle-orm/expo-sqlite';
|
|
2
|
+
import * as SQLite from 'expo-sqlite';
|
|
3
|
+
import * as schema from './schema';
|
|
4
|
+
|
|
5
|
+
// Open the local database. If it doesn't exist, it will be created.
|
|
6
|
+
const expoDb = SQLite.openDatabaseSync('imksh.db');
|
|
7
|
+
|
|
8
|
+
// Pass the database instance to Drizzle
|
|
9
|
+
export const db = drizzle(expoDb, { schema });
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { sqliteTable, text, integer } from 'drizzle-orm/sqlite-core';
|
|
2
|
+
|
|
3
|
+
export const users = sqliteTable('users', {
|
|
4
|
+
id: integer('id').primaryKey({ autoIncrement: true }),
|
|
5
|
+
email: text('email').notNull().unique(),
|
|
6
|
+
name: text('name'),
|
|
7
|
+
role: text('role').default('user'),
|
|
8
|
+
createdAt: text('created_at').notNull().default('CURRENT_TIMESTAMP'),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export const preferences = sqliteTable('preferences', {
|
|
12
|
+
key: text('key').primaryKey(),
|
|
13
|
+
value: text('value').notNull(),
|
|
14
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { api } from "../../../lib/axios";
|
|
2
|
+
|
|
3
|
+
export const authService = {
|
|
4
|
+
sendOtp: (email: string) => api.post("/auth/send-signup-otp", { email }),
|
|
5
|
+
|
|
6
|
+
signup: (
|
|
7
|
+
name: string,
|
|
8
|
+
email: string,
|
|
9
|
+
password: string,
|
|
10
|
+
otp: string,
|
|
11
|
+
role = "user",
|
|
12
|
+
) => api.post("/auth/signup", { name, email, password, otp, role }),
|
|
13
|
+
|
|
14
|
+
login: (email: string, password: string) =>
|
|
15
|
+
api.post("/auth/login", { email, password }),
|
|
16
|
+
|
|
17
|
+
getMe: () => api.get("/auth/me"),
|
|
18
|
+
|
|
19
|
+
updateMe: (data: any) => api.put("/auth/me", data),
|
|
20
|
+
|
|
21
|
+
logout: () => api.post("/auth/logout"),
|
|
22
|
+
|
|
23
|
+
savePushToken: (token: string) => api.post("/auth/push-token", { token }),
|
|
24
|
+
|
|
25
|
+
genOtp: (email: string) => api.post("/auth/forgot-password/otp", { email }),
|
|
26
|
+
|
|
27
|
+
verifyOtp: (email: string, otp: string) =>
|
|
28
|
+
api.post("/auth/forgot-password/verify-otp", { email, otp }),
|
|
29
|
+
|
|
30
|
+
resetPassword: (newPassword: string) =>
|
|
31
|
+
api.post("/auth/reset-password", { newPassword }),
|
|
32
|
+
|
|
33
|
+
changePassword: (oldPassword: string, newPassword: string) =>
|
|
34
|
+
api.post("/auth/change-password", { oldPassword, newPassword }),
|
|
35
|
+
};
|