Commit Graph

263 Commits

Author SHA1 Message Date
javayhu
cb4af81cf3 refactor: streamline user avatar handling across components
- Updated the `UserAvatar` component to require a non-optional `image` prop, enhancing type safety.
- Simplified the usage of `UserAvatar` in `SidebarUser` and `UserButton` components by removing unnecessary nullish coalescing.
- Improved code clarity and consistency in user-related components by ensuring direct access to user properties.
2025-03-19 09:46:13 +08:00
javayhu
9c8c54799f refactor: implement newsletter module with Resend provider integration
- Introduced a comprehensive newsletter module for managing subscriptions, including functions to subscribe, unsubscribe, and check subscription status.
- Created a `ResendNewsletterProvider` class to handle interactions with the Resend API, improving modularity and code organization.
- Re-exported relevant types for better accessibility and convenience.
- Added a README file detailing usage, configuration, and advanced features of the newsletter module.
- Implemented automatic configuration using environment variables and provided a programmatic configuration option.
2025-03-19 01:45:40 +08:00
javayhu
9e1c648a7c refactor: enhance storage module with S3 provider integration
- Introduced a new S3Provider class for managing file uploads, deletions, and presigned URL generation with Amazon S3.
- Refactored existing storage functions to utilize the new provider, improving modularity and code organization.
- Re-exported types for better accessibility and convenience.
- Implemented robust error handling for storage operations, ensuring clear error messages for configuration and upload issues.
- Updated the storage configuration to support S3-compatible services, enhancing flexibility.
2025-03-19 01:10:46 +08:00
javayhu
130338b9a5 refactor: refactor mail module & enhance auth email with locale support
- Added locale handling to email sending functions, allowing for localized URLs in reset password and verification emails.
- Introduced a new utility function `addLocaleToUrl` to append locale to callback URLs in authentication flows.
- Refactored the email sending process to utilize a mail provider interface, supporting both templated and raw email sending.
- Created a comprehensive README for the email system, detailing usage, configuration, and available templates.
- Established a default mail configuration for improved email management.
2025-03-19 01:00:14 +08:00
javayhu
6744c52087 feat: enhance billing and payment features
- Updated English and Chinese localization files to include detailed billing and subscription management messages.
- Introduced new payment actions for creating checkout and customer portal sessions.
- Added success and cancel pages for payment processing.
- Implemented a billing card component to manage subscriptions and payment methods.
- Created a pricing table component to display available plans with interval selection.
- Established a Stripe webhook handler for processing payment events.
- Refactored existing components to integrate new payment functionalities and improve user experience.
2025-03-19 00:09:58 +08:00
javayhu
a853c56994 refactor: update navbar and mobile menu styles for improved accessibility
- Replaced primary color references with foreground color for hover and focus states in Navbar and MainMobileMenu components.
- Adjusted padding in the mobile menu's bottom buttons for better layout consistency.
- Switched the global CSS import from theme.css to theme-blue.css for updated styling.
2025-03-18 17:46:14 +08:00
javayhu
41b6d0b63b chore: optimize user button 2025-03-18 17:26:57 +08:00
javayhu
87e956493e fix: fix user button hydration error 2025-03-18 17:16:38 +08:00
javayhu
14e4620c5c refactor: optimize fonts 2025-03-18 17:05:40 +08:00
javayhu
c563c537f4 feat: update shadcn ui components (new-york) 2025-03-18 16:38:19 +08:00
javayhu
bc15dfc679 chore: rename to getSidebarLinks 2025-03-18 13:44:13 +08:00
javayhu
3d380dc88c refactor: streamline translation handling in menu and footer components
- Removed the custom translation function and replaced it with `useTranslations` from `next-intl` for better integration with localization.
- Updated `getMenuLinks`, `getFooterLinks`, `getAvatarLinks`, and `getSidebarMainLinks` functions to eliminate the need for passing a translation function as a parameter.
- Simplified the `SidebarMain`, `Footer`, `Navbar`, and `UserButton` components to directly utilize the updated link retrieval functions, enhancing code clarity and maintainability.
2025-03-18 12:59:29 +08:00
javayhu
e934c7a3ba refactor: streamline legal page structure and improve layout
- Removed unnecessary hostname entry from `next.config.ts`.
- Introduced `LegalLayout` component for consistent layout across legal pages.
- Added `CookiePolicyPage`, `PrivacyPolicyPage`, and `TermsOfServicePage` components to handle respective legal content with metadata generation.
- Updated `PageLayout` component for better naming consistency.
- Simplified `AboutPage`, `ContactPage`, and `WaitlistPage` layouts by removing redundant padding.
- Cleaned up `PricingPage` by removing unused pricing components.
2025-03-18 12:17:46 +08:00
javayhu
35ee109cd3 Merge branch 'main' of https://github.com/MkSaaSHQ/mksaas-template 2025-03-18 11:45:10 +08:00
javayhu
0fa2562129 refactor: enhance localization and component structure in settings
- Updated English and Chinese localization files to improve newsletter subscription labels and team references.
- Renamed route for notifications from `SettingsNotification` to `SettingsNotifications` for consistency.
- Refactored `DashboardPage`, `SettingsBillingPage`, and `SettingsAccountPage` to streamline layout and improve responsiveness.
- Introduced `SettingsNotificationPage` to handle notification settings with a dedicated component.
- Enhanced various settings components to accept `className` props for better styling flexibility.
2025-03-18 11:43:11 +08:00
javayhu
db651f5f1d feat: integrate AWS S3 storage functionality for file uploads and retrieval
- Added new API routes for uploading files, generating pre-signed URLs, and retrieving file URLs using AWS S3.
- Implemented error handling for storage operations, including custom error classes for better clarity.
- Updated localization files to include success and failure messages for avatar updates.
- Enhanced the `UpdateAvatarCard` component to support file uploads directly from the browser, improving user experience.
2025-03-18 10:41:31 +08:00
javayhu
9e958a5f9d refactor: improve error handling in authentication forms
- Updated error message display in `ForgotPasswordForm`, `LoginForm`, `RegisterForm`, and `ResetPasswordForm` to use `ctx.error.message` instead of `ctx.error.statusText`, providing clearer feedback to users on authentication errors.
2025-03-17 09:28:15 +08:00
javayhu
a7f7556a6d refactor: update hero section content and improve user button behavior
- Changed the hero section title and description to better reflect the MkSaaS offering.
- Updated the user button to use `replace` instead of `push` for navigation after sign out, ensuring a smoother user experience.
- Modified the delete account card to also use `replace` for navigation after account deletion, enhancing consistency in routing behavior.
2025-03-17 01:19:05 +08:00
javayhu
bb7e36cc85 refactor: enhance localization and styling in account deletion flow
- Updated Chinese localization file to include a new "cancel" message for improved user experience during account deletion.
- Adjusted `DeleteAccountCard` footer styling for better alignment and spacing of buttons.
- Modified `auth.ts` to disable freshness check for user deletion, ensuring smoother account removal process.
2025-03-17 00:02:44 +08:00
javayhu
1fd3ef7eeb feat: add reset password functionality for users with social login
- Introduced `ResetPasswordCard` component to guide users who signed up with social providers in setting up a password through the forgot password flow.
- Updated `ConditionalUpdatePasswordCard` to conditionally render `ResetPasswordCard` for users without a credential provider but with an email.
- Enhanced localization files to include new messages for the password setup process in both English and Chinese.
- Implemented email pre-filling in the forgot password form based on URL parameters for improved user experience.
2025-03-16 23:45:29 +08:00
javayhu
4f8b6d56c9 refactor: implement conditional rendering for password update when user has account with credential provider
- Replaced `UpdatePasswordCard` with `ConditionalUpdatePasswordCard` in `SettingsAccountPage` to ensure the password update option is only available for users with a credential provider.
- Added `ConditionalUpdatePasswordCard` component to handle the logic for checking user credentials and rendering the password update form accordingly.
- Updated documentation in `UpdatePasswordCard` to clarify its usage and the need for credential providers.
2025-03-16 23:00:25 +08:00
javayhu
8abb393c3e refactor: improve component structure and styling
- Adjusted `AuthCard` to enhance readability by formatting the `CardContent` section.
- Simplified the `DividerWithText` component by removing unnecessary padding.
- Updated `MainMobileMenu` to improve layout consistency with adjusted padding and spacing.
- Replaced `Dialog` with `AlertDialog` in `DeleteAccountCard` for better user experience and consistency in alert handling.
- Enhanced error message display logic in `DeleteAccountCard` for improved clarity.
2025-03-16 15:38:58 +08:00
javayhu
c51a608a28 refactor: update user references from username to name
- Replaced instances of `user.username` with `user.name` in `SidebarUser`, `UserButton`, and `UpdateNameCard` components for consistency and clarity.
- Adjusted the default values in the form handling to reflect the change from username to name.
- Updated comments in `auth.ts` to clarify the implementation status of username support.
2025-03-16 15:20:42 +08:00
javayhu
6569e5c3df refactor: update localization handling in metadata generation
- Replaced `pageTranslations` with `pt` for improved clarity in localization across multiple pages including About, Changelog, Contact, Waitlist, Blog, Pricing, and Auth pages.
- Enhanced maintainability by standardizing the variable naming for translation functions.
2025-03-16 15:06:42 +08:00
javayhu
635346bff6 refactor: restructure waitlist form localization messages
- Updated English and Chinese localization files to nest waitlist form messages under a `form` object for better organization.
- Adjusted `WaitlistFormCard` component to utilize the new message structure, enhancing clarity and maintainability of the code.
2025-03-16 15:05:51 +08:00
javayhu
0ae10c6c42 refactor: optimize intl messages for contact form 2025-03-16 15:03:22 +08:00
javayhu
293ee90c8a feat: implement contact form submission with email notifications
- Added `contactAction` to handle contact form submissions, including validation using Zod.
- Integrated email sending functionality to notify the configured recipient upon form submission.
- Updated `ContactFormCard` to utilize the new action, providing user feedback through toast notifications.
- Enhanced error handling for email sending failures and improved logging for better debugging.
- Updated `websiteConfig` to include the recipient email address for notifications.
2025-03-16 14:56:23 +08:00
javayhu
5607b57bd1 feat: add notification settings and newsletter management features
- Introduced a new `SettingsNotificationPage` component for managing newsletter subscriptions.
- Added `NewsletterFormCard` to handle subscription status with user feedback through toast notifications.
- Implemented `isSubscribedAction` to check user subscription status, enhancing user experience.
- Updated localization files to include new messages for newsletter management in English and Chinese.
- Enhanced sidebar with a new notification settings link for easy access to subscription preferences.
2025-03-16 12:55:26 +08:00
javayhu
6413fcd33c refactor: enhance card components with improved styling and structure
- Updated multiple card components (`ContactFormCard`, `DeleteAccountCard`, `UpdateAvatarCard`, `UpdateNameCard`, `UpdatePasswordCard`, and `WaitlistFormCard`) to include `overflow-hidden` for better layout management.
- Improved the structure of card titles and descriptions for better readability.
- Adjusted card footers to include `rounded-none` for consistent styling across components.
- Enhanced overall UI consistency and maintainability by refining component styles.
2025-03-16 10:55:43 +08:00
javayhu
9ddf1a3c20 feat: implement newsletter subscription and unsubscription actions
- Added `subscribeAction` and `unsubscribeAction` in `newsletter.ts` to handle newsletter subscriptions and unsubscriptions with validation using Zod.
- Introduced new localization messages for email validation in English and Chinese localization files.
- Updated `WaitlistFormCard` to utilize the new subscription action, improving user feedback with toast notifications.
- Replaced the alert icon in `FormError` component for better visual representation of errors.
2025-03-16 10:42:33 +08:00
javayhu
9b221f4583 refactor: reorganize email sending logic and centralize mail functionality
- Updated the `index.ts` file to export the `send` function from the new `mail.ts` file, improving code organization.
- Introduced `mail.ts` to encapsulate the email sending logic, including template rendering and error handling, enhancing modularity and maintainability.
- Implemented a structured approach for sending emails with templates or direct content, streamlining the email functionality.
2025-03-16 10:27:40 +08:00
javayhu
657e5212f4 refactor: remove WaitlistForm component and reorganize email types
- Deleted the `WaitlistForm` component to streamline the codebase and improve modularity.
- Introduced a new `types.ts` file in the `mail` directory to centralize email-related type definitions, enhancing code organization and maintainability.
- Updated imports across email components to reference the new `types.ts`, ensuring consistency and clarity in type usage.
2025-03-16 09:49:51 +08:00
javayhu
0804ac5e96 feat: enhance sidebar theming with new CSS variables
- Added new CSS variables for sidebar theming in `globals.css` to support light and dark modes.
- Removed redundant sidebar variables from individual theme files (`theme-blue.css`, `theme-green.css`, `theme-orange.css`, `theme-red.css`, `theme-rose.css`, `theme-violet.css`, `theme-yellow.css`, `theme-zinc.css`, and `theme.css`) to streamline styling and ensure consistency.
- Improved overall theme management for better maintainability and customization.
2025-03-16 09:05:37 +08:00
javayhu
574add6956 feat: add new UI components and enhance package dependencies
- Introduced several new UI components including `AlertDialog`, `AspectRatio`, `Calendar`, `Carousel`, `Command`, `ContextMenu`, `Dialog`, `DropdownMenu`, `HoverCard`, `InputOTP`, `Menubar`, `Popover`, `Progress`, `RadioGroup`, `Resizable`, `ScrollArea`, `Select`, `Slider`, `Switch`, `Table`, `ToggleGroup`, and `Toggle`.
- Updated `package.json` and `pnpm-lock.yaml` to include new dependencies for Radix UI components and other libraries.
- Improved existing components with better structure and styling, ensuring consistency across the application.
- Enhanced responsiveness and accessibility of UI elements using Tailwind CSS and Shadcn/ui.
2025-03-16 09:05:23 +08:00
javayhu
52738f4783 feat: enhance waitlist and contact forms with improved localization messages
- Added new success and failure messages for waitlist and contact form submissions in English and Chinese localization files.
- Introduced `WaitlistFormCard` component to streamline waitlist form handling and improve user feedback with toast notifications.
- Updated `ContactFormCard` to utilize new localization messages for form submission states, enhancing user experience.
- Improved structure and validation for both forms, ensuring better error handling and user guidance.
2025-03-16 08:43:46 +08:00
javayhu
c53cbb1ce2 refactor: replace contact form with ContactFormCard component
- Removed the old `ContactForm` component and integrated the new `ContactFormCard` for improved structure and validation.
- Updated `ContactPage` to utilize the new `ContactFormCard`, enhancing user experience with better form handling and error management.
- Implemented form validation using Zod and improved user feedback with toast notifications.
2025-03-16 08:00:23 +08:00
javayhu
aef4ce6296 fix: add account deletion feature and enhance localization messages
- Introduced `DeleteAccountCard` component for users to permanently delete their accounts, including a confirmation dialog to prevent accidental deletions.
- Updated localization files in English and Chinese to include new messages related to account deletion, enhancing user guidance and clarity.
- Improved layout of the account settings page to incorporate the new delete account functionality alongside existing update features.
2025-03-16 01:15:01 +08:00
javayhu
d51a22e030 fix: enhance localization messages and improve account settings UI
- Added new success and failure messages for password updates in English and Chinese localization files.
- Updated `UpdateAvatarCard`, `UpdateNameCard`, and `UpdatePasswordCard` components to improve error handling and user feedback with toast notifications.
- Enhanced styling for the user avatar fallback icon in `UpdateAvatarCard` for better visual consistency.
2025-03-16 00:20:12 +08:00
javayhu
c258cc7d0d fix: add password visibility toggle to reset password form and update localization messages
- Implemented password visibility toggle functionality in the `ResetPasswordForm` component, enhancing user experience during password entry.
- Updated localization files in English and Chinese to include new messages for showing and hiding passwords.
- Ensured accessibility by providing appropriate icons and screen reader support for the password visibility toggle.
2025-03-15 22:20:55 +08:00
javayhu
11a78eccbc fix: enhance login and registration forms with password visibility toggle
- Added password visibility toggle functionality to `LoginForm` and `RegisterForm` components, improving user experience during authentication.
- Updated localization files to include new messages for showing and hiding passwords in both English and Chinese.
- Ensured consistent styling and accessibility for the password input fields with appropriate icons and screen reader support.
2025-03-15 21:54:59 +08:00
javayhu
c0c60f2f2f fix: enhance localization messages and update user interface components
- Added new localization messages for logout failure and success notifications in English and Chinese.
- Updated `SidebarUser` and `UserButton` components to display the username instead of the name for better clarity.
- Improved `UpdateNameCard` to handle username updates with appropriate success and error messages using toast notifications.
- Refactored `MainMobileMenu` to utilize the translation function directly for login and sign-up links, enhancing consistency across the application.
2025-03-15 21:47:33 +08:00
javayhu
c497d71757 fix: update localization messages and improve account settings UI
- Enhanced localization messages in English and Chinese for user name and password fields, adding hints for better user guidance.
- Refactored `UpdateAvatarCard`, `UpdateNameCard`, and `UpdatePasswordCard` components to improve state management and user experience.
- Updated validation hints in the `UpdateNameCard` and `UpdatePasswordCard` for clearer instructions on input requirements.
2025-03-15 21:02:13 +08:00
javayhu
3a41a656ac fix: enhance DashboardHeader and SidebarMain with improved styling
- Added a bottom border to the `DashboardHeader` for better visual separation.
- Updated `SidebarMenuButton` and `SidebarMenuSubButton` components in `SidebarMain` to include padding for improved touch target size and user experience.
- Ensured consistent styling across sidebar items for a more cohesive look.
2025-03-15 20:54:41 +08:00
javayhu
dc36339faa fix: update localization messages and enhance account settings UI
- Revised localization messages in English and Chinese for avatar upload, name input, and password change to improve clarity and consistency.
- Adjusted the layout of `UpdateAvatarCard`, `UpdateNameCard`, and `UpdatePasswordCard` components for better user experience and responsiveness.
- Added `CardFooter` to `UpdateAvatarCard` and `UpdateNameCard` for improved information display.
- Updated validation schema for user name to reflect new minimum and maximum character requirements.
2025-03-15 20:44:52 +08:00
javayhu
a37285b5cf chore: enhance DashboardHeader with theme and locale switchers
- Added `ThemeSwitcher` and `LocaleSwitcher` components to the right side of the `DashboardHeader` for improved user customization options.
- Cleaned up imports and ensured consistent formatting in the `DashboardHeader` component.
- Updated the layout to accommodate new switchers while maintaining responsiveness.
2025-03-15 20:14:42 +08:00
javayhu
3bcb0f10e4 fix: update maxLength validation for name input in localization files
- Adjusted the maximum length for name input validation in both English and Chinese localization files from 32 to 30 characters.
- Refactored `UpdateNameCard` to initialize the form with a fallback for user name and check user existence after hooks initialization.
- Commented out the `TailwindIndicator` in the layout for potential future use.
2025-03-15 20:00:51 +08:00
javayhu
20be1fdfd6 chore: enhance account settings page with avatar, name, and password update features
- Introduce new components: `UpdateAvatarCard`, `UpdateNameCard`, and `UpdatePasswordCard` for managing user account settings.
- Update localization files for English and Chinese to include new fields related to avatar upload, name input, and password change.
- Refactor `SettingsAccountPage` to utilize the new components, improving code organization and user experience.
2025-03-15 19:41:37 +08:00
javayhu
e4710bbabc fix: Each child in a list should have a unique "key" prop. See https://react.dev/link/warning-keys for more information. 2025-03-15 19:11:40 +08:00
javayhu
673829298b chore: refactor AI feature pages to use DashboardHeader component
- Replace breadcrumb and sidebar trigger implementations in AI feature pages (Audio, Image, Text, Video) with a new `DashboardHeader` component for improved code reuse and consistency.
- Update localization handling for breadcrumbs in each AI feature page to enhance user navigation experience.
- Clean up imports by removing unused components related to breadcrumb and sidebar triggers.
2025-03-15 18:53:30 +08:00
javayhu
03f00c7d37 chore: enhance sidebar navigation and localization features
- Refactor the `SidebarMain` component to improve active link detection and enhance user experience with collapsible menus.
- Introduce `useLocalePathname` for better path management and implement functions to check active states for sidebar items.
- Update `SidebarUser` component layout for improved readability and consistency in locale display.
- Replace `UserIcon` with `User2Icon` in the `UserAvatar` component for a more modern appearance.
2025-03-15 17:59:12 +08:00