@promakeai/cli 0.5.5 → 0.5.7
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/README.md +71 -71
- package/dist/index.js +251 -251
- package/dist/registry/about-page.json +3 -3
- package/dist/registry/about-section.json +4 -4
- package/dist/registry/animations.json +2 -2
- package/dist/registry/announcement-bar.json +4 -4
- package/dist/registry/api.json +1 -1
- package/dist/registry/auth-core.json +3 -3
- package/dist/registry/bento-grid-section.json +4 -4
- package/dist/registry/blog-core.json +5 -5
- package/dist/registry/blog-list-page.json +4 -4
- package/dist/registry/blog-section.json +4 -4
- package/dist/registry/cards-carousel-section.json +4 -4
- package/dist/registry/cart-drawer.json +4 -4
- package/dist/registry/cart-page.json +4 -4
- package/dist/registry/case-study-page.json +3 -3
- package/dist/registry/category-section.json +4 -4
- package/dist/registry/checkout-page.json +4 -4
- package/dist/registry/coming-soon-page-minimal.json +4 -4
- package/dist/registry/coming-soon-page.json +4 -4
- package/dist/registry/contact-info-grid.json +4 -4
- package/dist/registry/contact-page-centered.json +4 -4
- package/dist/registry/contact-page-map-overlay.json +3 -3
- package/dist/registry/contact-page-map-split.json +3 -3
- package/dist/registry/contact-page-split.json +4 -4
- package/dist/registry/contact-page.json +4 -4
- package/dist/registry/content-section.json +4 -4
- package/dist/registry/cookie-consent.json +4 -4
- package/dist/registry/cookies-page.json +3 -3
- package/dist/registry/cta-section.json +3 -3
- package/dist/registry/ecommerce-core.json +8 -8
- package/dist/registry/empty-page.json +3 -3
- package/dist/registry/faq-categorized.json +4 -4
- package/dist/registry/faq-simple.json +4 -4
- package/dist/registry/favorites-blog-block.json +1 -1
- package/dist/registry/favorites-blog-page.json +4 -4
- package/dist/registry/favorites-ecommerce-block.json +1 -1
- package/dist/registry/favorites-ecommerce-page.json +4 -4
- package/dist/registry/feature-section.json +3 -3
- package/dist/registry/featured-products.json +4 -4
- package/dist/registry/footer-detailed.json +4 -4
- package/dist/registry/footer-minimal.json +3 -3
- package/dist/registry/footer.json +3 -3
- package/dist/registry/forgot-password-page-split.json +4 -4
- package/dist/registry/forgot-password-page.json +4 -4
- package/dist/registry/google-adsense.json +4 -4
- package/dist/registry/google-map.json +2 -2
- package/dist/registry/header-centered-pill.json +4 -4
- package/dist/registry/header-ecommerce.json +4 -4
- package/dist/registry/header-mega.json +4 -4
- package/dist/registry/header-minimal.json +4 -4
- package/dist/registry/header-simple.json +3 -3
- package/dist/registry/hero-carousel.json +3 -3
- package/dist/registry/hero-cta.json +4 -4
- package/dist/registry/hero-gradient.json +4 -4
- package/dist/registry/hero-grid.json +4 -4
- package/dist/registry/hero-profile.json +3 -3
- package/dist/registry/hero.json +3 -3
- package/dist/registry/index.json +103 -103
- package/dist/registry/landing-page-app.json +3 -3
- package/dist/registry/landing-page-saas.json +3 -3
- package/dist/registry/login-page-split.json +4 -4
- package/dist/registry/login-page.json +4 -4
- package/dist/registry/logo-cloud.json +4 -4
- package/dist/registry/masonry-grid.json +3 -3
- package/dist/registry/my-orders-page.json +4 -4
- package/dist/registry/newsletter-section.json +4 -4
- package/dist/registry/order-card-compact.json +1 -1
- package/dist/registry/order-confirmation-page.json +4 -4
- package/dist/registry/order-detail-block.json +1 -1
- package/dist/registry/orders-list-block.json +1 -1
- package/dist/registry/payment-success-block.json +2 -2
- package/dist/registry/portfolio-page.json +4 -4
- package/dist/registry/post-card.json +4 -4
- package/dist/registry/post-detail-block.json +2 -2
- package/dist/registry/post-detail-page.json +4 -4
- package/dist/registry/pricing-card.json +3 -3
- package/dist/registry/pricing-page.json +4 -4
- package/dist/registry/pricing-section.json +4 -4
- package/dist/registry/privacy-page.json +3 -3
- package/dist/registry/product-card-detailed.json +4 -4
- package/dist/registry/product-card-hover.json +4 -4
- package/dist/registry/product-card.json +4 -4
- package/dist/registry/product-detail-block.json +2 -2
- package/dist/registry/product-detail-page.json +4 -4
- package/dist/registry/product-detail-section.json +4 -4
- package/dist/registry/product-quick-view.json +4 -4
- package/dist/registry/products-page.json +4 -4
- package/dist/registry/reading-progress.json +4 -4
- package/dist/registry/register-page-split.json +4 -4
- package/dist/registry/register-page.json +4 -4
- package/dist/registry/related-posts-block.json +1 -1
- package/dist/registry/related-products-block.json +2 -2
- package/dist/registry/reset-password-page-split.json +4 -4
- package/dist/registry/reset-password-page.json +4 -4
- package/dist/registry/service-card.json +1 -1
- package/dist/registry/share-buttons.json +4 -4
- package/dist/registry/skill-card.json +1 -1
- package/dist/registry/team-page.json +4 -4
- package/dist/registry/terms-page.json +3 -3
- package/dist/registry/testimonials-carousel.json +4 -4
- package/dist/registry/testimonials-grid.json +4 -4
- package/dist/registry/timeline-section.json +4 -4
- package/dist/registry/video-hero.json +4 -4
- package/dist/registry/youtube-embed.json +4 -4
- package/package.json +56 -56
- package/template/.env +6 -6
- package/template/README.md +54 -54
- package/template/eslint.config.js +41 -41
- package/template/package.json +95 -95
- package/template/public/_redirects +1 -1
- package/template/public/robots.txt +14 -14
- package/template/scripts/init-db.ts +18 -18
- package/template/src/App.tsx +19 -19
- package/template/src/components/FormField.tsx +48 -48
- package/template/src/components/FormFileInput.tsx +75 -75
- package/template/src/components/GoogleAnalytics.tsx +34 -34
- package/template/src/components/LanguageSwitcher.tsx +53 -53
- package/template/src/{PasswordInput.tsx → components/PasswordInput.tsx} +60 -60
- package/template/src/components/ScriptInjector.tsx +62 -62
- package/template/src/components/Stack.tsx +39 -39
- package/template/src/constants/constants.json +67 -67
- package/template/src/db/index.ts +20 -20
- package/template/src/db/provider.tsx +78 -78
- package/template/src/db/schema.json +258 -258
- package/template/src/db/types.ts +195 -195
- package/template/src/hooks/use-debounced-value.ts +12 -12
- package/template/src/lang/index.ts +90 -90
- package/template/src/lib/api.ts +345 -345
- package/template/src/lib/env.ts +19 -19
- package/template/src/router.tsx +14 -14
- package/template/src/vite-env.d.ts +1 -1
- package/template/vite.config.ts +64 -64
|
@@ -13,25 +13,25 @@
|
|
|
13
13
|
"path": "reading-progress/reading-progress.tsx",
|
|
14
14
|
"type": "registry:component",
|
|
15
15
|
"target": "$modules$/reading-progress/reading-progress.tsx",
|
|
16
|
-
"content": "\"use client\";\
|
|
16
|
+
"content": "\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { motion, useScroll, useSpring } from \"motion/react\";\nimport { cn } from \"@/lib/utils\";\n\ninterface ReadingProgressProps {\n color?: string;\n height?: number;\n showPercentage?: boolean;\n className?: string;\n}\n\nexport function ReadingProgress({\n color,\n height = 3,\n showPercentage = false,\n className,\n}: ReadingProgressProps) {\n const [mounted] = useState(() => typeof window !== \"undefined\");\n const { scrollYProgress } = useScroll();\n const scaleX = useSpring(scrollYProgress, {\n stiffness: 100,\n damping: 30,\n restDelta: 0.001,\n });\n\n const [percentage, setPercentage] = useState(0);\n\n useEffect(() => {\n if (!showPercentage) return;\n\n const unsubscribe = scrollYProgress.on(\"change\", (latest) => {\n setPercentage(Math.round(latest * 100));\n });\n\n return () => unsubscribe();\n }, [scrollYProgress, showPercentage]);\n\n if (!mounted) return null;\n\n return (\n <>\n <motion.div\n className={cn(\"fixed top-0 left-0 right-0 z-50 origin-left\", className)}\n style={{\n scaleX,\n height,\n backgroundColor: color || \"var(--primary)\",\n }}\n />\n {showPercentage && (\n <div\n className=\"fixed top-4 right-4 z-50 bg-background/80 backdrop-blur-sm rounded-full px-3 py-1 text-sm font-medium border border-border shadow-sm\"\n >\n {percentage}%\n </div>\n )}\n </>\n );\n}\n"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
"path": "reading-progress/index.ts",
|
|
20
20
|
"type": "registry:index",
|
|
21
21
|
"target": "$modules$/reading-progress/index.ts",
|
|
22
|
-
"content": "export * from \"./reading-progress\";\
|
|
22
|
+
"content": "export * from \"./reading-progress\";\n"
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"path": "reading-progress/lang/en.json",
|
|
26
26
|
"type": "registry:lang",
|
|
27
27
|
"target": "$modules$/reading-progress/lang/en.json",
|
|
28
|
-
"content": "{\
|
|
28
|
+
"content": "{\n \"progress\": \"Reading progress\"\n}\n"
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
"path": "reading-progress/lang/tr.json",
|
|
32
32
|
"type": "registry:lang",
|
|
33
33
|
"target": "$modules$/reading-progress/lang/tr.json",
|
|
34
|
-
"content": "{\
|
|
34
|
+
"content": "{\n \"progress\": \"Okuma ilerlemesi\"\n}\n"
|
|
35
35
|
}
|
|
36
36
|
],
|
|
37
37
|
"exports": {
|
|
@@ -17,25 +17,25 @@
|
|
|
17
17
|
"path": "register-page-split/index.ts",
|
|
18
18
|
"type": "registry:index",
|
|
19
19
|
"target": "$modules$/register-page-split/index.ts",
|
|
20
|
-
"content": "export * from './register-page-split';\
|
|
20
|
+
"content": "export * from './register-page-split';\nexport { default } from './register-page-split';\n"
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
"path": "register-page-split/register-page-split.tsx",
|
|
24
24
|
"type": "registry:page",
|
|
25
25
|
"target": "$modules$/register-page-split/register-page-split.tsx",
|
|
26
|
-
"content": "import { useState } from \"react\";\
|
|
26
|
+
"content": "import { useState } from \"react\";\nimport { Link, useNavigate } from \"react-router\";\nimport { toast } from \"sonner\";\nimport { useTranslation } from \"react-i18next\";\nimport { usePageTitle } from \"@/hooks/use-page-title\";\nimport { Button } from \"@/components/ui/button\";\nimport { Input } from \"@/components/ui/input\";\nimport { Logo } from \"@/components/Logo\";\nimport { useAuth } from \"@/modules/auth-core\";\nimport { getErrorMessage } from \"@/modules/api\";\nimport { FormField } from \"@/components/FormField\";\nimport { PasswordInput } from \"@/components/PasswordInput\";\n\ninterface RegisterPageSplitProps {\n image?: string;\n}\n\nexport function RegisterPageSplit({\n image = \"/images/placeholder.png\",\n}: RegisterPageSplitProps) {\n const { t } = useTranslation(\"register-page-split\");\n usePageTitle({ title: t(\"title\", \"Create Account\") });\n const navigate = useNavigate();\n const { register } = useAuth();\n\n const [username, setUsername] = useState(\"\");\n const [email, setEmail] = useState(\"\");\n const [password, setPassword] = useState(\"\");\n const [confirmPassword, setConfirmPassword] = useState(\"\");\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n setError(null);\n\n // Validate passwords match\n if (password !== confirmPassword) {\n setError(t(\"passwordMismatch\", \"Passwords do not match\"));\n return;\n }\n\n setIsLoading(true);\n\n try {\n await register(username, email, password);\n\n toast.success(t(\"registerSuccess\", \"Account created successfully!\"), {\n description: t(\"checkEmail\", \"Please check your email to verify your account.\"),\n });\n\n // Navigate to login page after successful registration\n navigate(\"/login\", {\n state: {\n message: t(\"verifyEmail\", \"Please verify your email before logging in.\"),\n email\n }\n });\n } catch (err) {\n const errorMessage = getErrorMessage(\n err,\n t(\"registerError\", \"Registration failed. Please try again.\")\n );\n setError(errorMessage);\n } finally {\n setIsLoading(false);\n }\n };\n\n return (\n <section className=\"w-full md:grid md:min-h-screen md:grid-cols-2\">\n <div className=\"flex items-center justify-center px-4 py-12\">\n <div className=\"mx-auto grid w-full max-w-sm gap-6\">\n <Logo />\n <hr />\n <div>\n <h1 className=\"text-xl font-bold tracking-tight\">\n {t(\"title\", \"Create Account\")}\n </h1>\n <p className=\"text-sm text-muted-foreground\">\n {t(\"subtitle\", \"Sign up to get started\")}\n </p>\n </div>\n\n {error && (\n <div className=\"p-3 text-sm text-red-600 bg-red-50 dark:bg-red-950 dark:text-red-400 rounded-md\">\n {error}\n </div>\n )}\n\n <form onSubmit={handleSubmit} className=\"grid gap-4\">\n <div className=\"grid gap-2\">\n <FormField label={t(\"username\", \"Username\")} htmlFor=\"username\" required>\n <Input\n required\n id=\"username\"\n type=\"text\"\n autoComplete=\"username\"\n placeholder={t(\"usernamePlaceholder\", \"johndoe\")}\n value={username}\n onChange={(e) => setUsername(e.target.value)}\n disabled={isLoading}\n />\n </FormField>\n </div>\n\n <div className=\"grid gap-2\">\n <FormField label={t(\"email\", \"Email\")} htmlFor=\"email\" required>\n <Input\n required\n id=\"email\"\n type=\"email\"\n autoComplete=\"email\"\n placeholder={t(\"emailPlaceholder\", \"you@example.com\")}\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n disabled={isLoading}\n />\n </FormField>\n </div>\n\n <div className=\"grid gap-2\">\n <FormField label={t(\"password\", \"Password\")} htmlFor=\"password\" required>\n <PasswordInput\n required\n name=\"password\"\n id=\"password\"\n autoComplete=\"new-password\"\n placeholder=\"••••••••\"\n value={password}\n onChange={(e) => setPassword(e.target.value)}\n disabled={isLoading}\n minLength={8}\n />\n </FormField>\n </div>\n\n <div className=\"grid gap-2\">\n <FormField label={t(\"confirmPassword\", \"Confirm Password\")} htmlFor=\"confirm-password\" required>\n <PasswordInput\n required\n id=\"confirm-password\"\n name=\"confirm-password\"\n autoComplete=\"new-password\"\n placeholder=\"••••••••\"\n value={confirmPassword}\n onChange={(e) => setConfirmPassword(e.target.value)}\n disabled={isLoading}\n minLength={8}\n />\n </FormField>\n </div>\n\n <Button type=\"submit\" className=\"w-full\" disabled={isLoading}>\n {isLoading ? (\n <>\n <div className=\"w-4 h-4 border-2 border-primary-foreground border-t-transparent rounded-full animate-spin mr-2\" />\n {t(\"creatingAccount\", \"Creating account...\")}\n </>\n ) : (\n t(\"signUp\", \"Sign Up\")\n )}\n </Button>\n </form>\n\n <div className=\"text-sm text-center\">\n <p>\n {t(\"hasAccount\", \"Already have an account?\")}{\" \"}\n <Link to=\"/login\" className=\"underline\">\n {t(\"signIn\", \"Sign in\")}\n </Link>\n </p>\n </div>\n\n <hr />\n <p className=\"text-sm text-muted-foreground\">\n © {new Date().getFullYear()} {t(\"copyright\", \"All rights reserved.\")}\n </p>\n </div>\n </div>\n <div className=\"hidden p-4 md:block\">\n <img\n loading=\"lazy\"\n decoding=\"async\"\n width=\"1920\"\n height=\"1080\"\n alt={t(\"imageAlt\", \"Register background\")}\n src={image}\n className=\"size-full rounded-lg border bg-muted object-cover object-center\"\n />\n </div>\n </section>\n );\n}\n\nexport default RegisterPageSplit;\n"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
"path": "register-page-split/lang/en.json",
|
|
30
30
|
"type": "registry:lang",
|
|
31
31
|
"target": "$modules$/register-page-split/lang/en.json",
|
|
32
|
-
"content": "{\
|
|
32
|
+
"content": "{\n \"title\": \"Create Account\",\n \"subtitle\": \"Sign up to get started\",\n \"username\": \"Username\",\n \"usernamePlaceholder\": \"johndoe\",\n \"email\": \"Email\",\n \"emailPlaceholder\": \"you@example.com\",\n \"password\": \"Password\",\n \"confirmPassword\": \"Confirm Password\",\n \"passwordMismatch\": \"Passwords do not match\",\n \"signUp\": \"Sign Up\",\n \"creatingAccount\": \"Creating account...\",\n \"registerSuccess\": \"Account created successfully!\",\n \"checkEmail\": \"Please check your email to verify your account.\",\n \"verifyEmail\": \"Please verify your email before logging in.\",\n \"registerError\": \"Registration failed. Please try again.\",\n \"hasAccount\": \"Already have an account?\",\n \"signIn\": \"Sign in\",\n \"copyright\": \"All rights reserved.\",\n \"imageAlt\": \"Register background\"\n}\n"
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
"path": "register-page-split/lang/tr.json",
|
|
36
36
|
"type": "registry:lang",
|
|
37
37
|
"target": "$modules$/register-page-split/lang/tr.json",
|
|
38
|
-
"content": "{\
|
|
38
|
+
"content": "{\n \"title\": \"Hesap Oluştur\",\n \"subtitle\": \"Başlamak için kaydolun\",\n \"username\": \"Kullanıcı Adı\",\n \"usernamePlaceholder\": \"ahmetyilmaz\",\n \"email\": \"E-posta\",\n \"emailPlaceholder\": \"ornek@email.com\",\n \"password\": \"Şifre\",\n \"confirmPassword\": \"Şifre Onayı\",\n \"passwordMismatch\": \"Şifreler eşleşmiyor\",\n \"signUp\": \"Kaydol\",\n \"creatingAccount\": \"Hesap oluşturuluyor...\",\n \"registerSuccess\": \"Hesap başarıyla oluşturuldu!\",\n \"checkEmail\": \"Lütfen hesabınızı doğrulamak için e-postanızı kontrol edin.\",\n \"verifyEmail\": \"Lütfen giriş yapmadan önce e-postanızı doğrulayın.\",\n \"registerError\": \"Kayıt başarısız. Lütfen tekrar deneyin.\",\n \"hasAccount\": \"Zaten hesabınız var mı?\",\n \"signIn\": \"Giriş yap\",\n \"copyright\": \"Tüm hakları saklıdır.\",\n \"imageAlt\": \"Kayıt arka planı\"\n}\n"
|
|
39
39
|
}
|
|
40
40
|
],
|
|
41
41
|
"exports": {
|
|
@@ -17,25 +17,25 @@
|
|
|
17
17
|
"path": "register-page/index.ts",
|
|
18
18
|
"type": "registry:index",
|
|
19
19
|
"target": "$modules$/register-page/index.ts",
|
|
20
|
-
"content": "export * from './register-page';\
|
|
20
|
+
"content": "export * from './register-page';\nexport { default } from './register-page';\n"
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
"path": "register-page/register-page.tsx",
|
|
24
24
|
"type": "registry:page",
|
|
25
25
|
"target": "$modules$/register-page/register-page.tsx",
|
|
26
|
-
"content": "import { useState, useEffect } from \"react\";\
|
|
26
|
+
"content": "import { useState, useEffect } from \"react\";\nimport { Link, useNavigate } from \"react-router\";\nimport { toast } from \"sonner\";\nimport { Layout } from \"@/components/Layout\";\nimport { usePageTitle } from \"@/hooks/use-page-title\";\nimport { useTranslation } from \"react-i18next\";\nimport { useAuth } from \"@/modules/auth-core\";\nimport { getErrorMessage } from \"@/modules/api\";\nimport { Button } from \"@/components/ui/button\";\nimport { Input } from \"@/components/ui/input\";\nimport { Card, CardContent, CardHeader, CardTitle } from \"@/components/ui/card\";\nimport { UserPlus, CheckCircle } from \"lucide-react\";\nimport { PasswordInput } from \"@/components/PasswordInput\";\nimport { FormField } from \"@/components/FormField\";\n\nexport function RegisterPage() {\n const { t } = useTranslation(\"register-page\");\n usePageTitle({ title: t(\"title\", \"Create Account\") });\n\n const navigate = useNavigate();\n const { register, isAuthenticated } = useAuth();\n\n const [formData, setFormData] = useState({\n username: \"\",\n email: \"\",\n password: \"\",\n confirmPassword: \"\",\n });\n const [isSubmitting, setIsSubmitting] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const [success, setSuccess] = useState(false);\n\n // Redirect if already authenticated\n useEffect(() => {\n if (isAuthenticated) {\n navigate(\"/\", { replace: true });\n }\n }, [isAuthenticated, navigate]);\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n setIsSubmitting(true);\n setError(null);\n\n // Validate passwords match\n if (formData.password !== formData.confirmPassword) {\n setError(t(\"passwordMismatch\", \"Passwords do not match\"));\n toast.error(t(\"toastErrorTitle\", \"Registration failed\"), {\n description: t(\"passwordMismatch\", \"Passwords do not match\"),\n });\n setIsSubmitting(false);\n return;\n }\n\n try {\n await register(formData.username, formData.email, formData.password);\n setSuccess(true);\n toast.success(t(\"toastSuccessTitle\", \"Account created!\"), {\n description: t(\n \"toastSuccessDesc\",\n \"Please check your email to verify your account.\",\n ),\n });\n } catch (err) {\n const errorMessage = getErrorMessage(err, t(\"errorGeneric\", \"Registration failed. Please try again.\"));\n setError(errorMessage);\n toast.error(t(\"toastErrorTitle\", \"Registration failed\"), {\n description: errorMessage,\n });\n } finally {\n setIsSubmitting(false);\n }\n };\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n setFormData((prev) => ({\n ...prev,\n [e.target.name]: e.target.value,\n }));\n };\n\n if (success) {\n return (\n <div className=\"min-h-screen bg-muted/30 py-12\">\n <div className=\"w-full max-w-[var(--container-max-width)] mx-auto px-4\">\n <div className=\"max-w-md mx-auto\">\n <Card>\n <CardContent className=\"pt-6\">\n <div className=\"text-center space-y-4\">\n <CheckCircle className=\"w-16 h-16 text-green-500 mx-auto\" />\n <h2 className=\"text-2xl font-bold text-foreground\">\n {t(\"successTitle\", \"Account Created!\")}\n </h2>\n <p className=\"text-muted-foreground\">\n {t(\"successMessage\", \"Please check your email to verify your account.\")}\n </p>\n <Button asChild className=\"mt-4\">\n <Link to=\"/login\">{t(\"goToLogin\", \"Go to Login\")}</Link>\n </Button>\n </div>\n </CardContent>\n </Card>\n </div>\n </div>\n </div>\n );\n }\n\n return (\n <Layout>\n <div className=\"min-h-screen bg-muted/30 py-12\">\n <div className=\"w-full max-w-[var(--container-max-width)] mx-auto px-4\">\n {/* Hero Section */}\n <div className=\"text-center mb-12\">\n <h1 className=\"text-4xl font-bold text-foreground mb-4\">\n {t(\"title\", \"Create Account\")}\n </h1>\n <div className=\"w-16 h-1 bg-primary mx-auto mb-6\"></div>\n <p className=\"text-lg text-muted-foreground max-w-xl mx-auto\">\n {t(\"description\", \"Create an account to get started\")}\n </p>\n </div>\n\n <div className=\"max-w-md mx-auto\">\n <Card>\n <CardHeader>\n <CardTitle className=\"flex items-center gap-2\">\n <UserPlus className=\"w-5 h-5 text-primary\" />\n {t(\"cardTitle\", \"Sign Up\")}\n </CardTitle>\n </CardHeader>\n <CardContent>\n <form onSubmit={handleSubmit} className=\"space-y-6\">\n <FormField label={t(\"username\", \"Username\")} htmlFor=\"username\" required>\n <Input\n id=\"username\"\n name=\"username\"\n type=\"text\"\n value={formData.username}\n onChange={handleChange}\n placeholder={t(\"usernamePlaceholder\", \"Enter your username\")}\n required\n className=\"mt-1\"\n autoComplete=\"username\"\n />\n </FormField>\n <FormField label={t(\"email\", \"Email\")} htmlFor=\"email\" required>\n <Input\n id=\"email\"\n name=\"email\"\n type=\"email\"\n value={formData.email}\n onChange={handleChange}\n placeholder={t(\"emailPlaceholder\", \"Enter your email\")}\n required\n className=\"mt-1\"\n autoComplete=\"email\"\n />\n </FormField>\n <FormField label={t(\"password\", \"Password\")} htmlFor=\"password\" required>\n <PasswordInput id=\"password\"\n name=\"password\"\n value={formData.password}\n onChange={handleChange}\n placeholder={t(\"passwordPlaceholder\", \"Enter password\")}\n required\n className=\"mt-1 pr-10\"\n autoComplete=\"new-password\"\n />\n </FormField>\n\n <FormField label={t(\"confirmPassword\", \"Confirm Password\")} htmlFor=\"confirmPassword\" required\n >\n <PasswordInput\n id=\"confirmPassword\"\n name=\"confirmPassword\"\n value={formData.confirmPassword}\n onChange={handleChange}\n placeholder={t(\"passwordPlaceholder\", \"Enter password\")}\n required\n className=\"mt-1 pr-10\"\n autoComplete=\"new-password\"\n\n />\n </FormField>\n\n {error && (\n <div className=\"p-4 bg-red-50 border border-red-200 rounded-lg\">\n <p className=\"text-red-800 text-sm font-medium\">\n {error}\n </p>\n </div>\n )}\n\n <Button type=\"submit\" className=\"w-full\" disabled={isSubmitting}>\n {isSubmitting\n ? t(\"submitting\", \"Creating account...\")\n : t(\"submit\", \"Create Account\")}\n </Button>\n\n <div className=\"text-center text-sm text-muted-foreground\">\n {t(\"hasAccount\", \"Already have an account?\")}{\" \"}\n <Link\n to=\"/login\"\n className=\"text-primary hover:underline font-medium\"\n >\n {t(\"loginLink\", \"Sign in\")}\n </Link>\n </div>\n </form>\n </CardContent>\n </Card>\n </div>\n </div>\n </div>\n );\n}\n\nexport default RegisterPage;\n"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
"path": "register-page/lang/en.json",
|
|
30
30
|
"type": "registry:lang",
|
|
31
31
|
"target": "$modules$/register-page/lang/en.json",
|
|
32
|
-
"content": "{\
|
|
32
|
+
"content": "{\n \"title\": \"Create Account\",\n \"description\": \"Create an account to get started\",\n \"cardTitle\": \"Sign Up\",\n \"username\": \"Username\",\n \"usernamePlaceholder\": \"Enter your username\",\n \"email\": \"Email\",\n \"emailPlaceholder\": \"Enter your email\",\n \"password\": \"Password\",\n \"passwordPlaceholder\": \"Enter password\",\n \"confirmPassword\": \"Confirm Password\",\n \"confirmPasswordPlaceholder\": \"Confirm your password\",\n \"passwordMismatch\": \"Passwords do not match\",\n \"submit\": \"Create Account\",\n \"submitting\": \"Creating account...\",\n \"hasAccount\": \"Already have an account?\",\n \"loginLink\": \"Sign in\",\n \"toastSuccessTitle\": \"Account created!\",\n \"toastSuccessDesc\": \"Please check your email to verify your account.\",\n \"toastErrorTitle\": \"Registration failed\",\n \"errorGeneric\": \"Registration failed. Please try again.\",\n \"successTitle\": \"Account Created!\",\n \"successMessage\": \"Please check your email to verify your account.\",\n \"goToLogin\": \"Go to Login\"\n}\n"
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
"path": "register-page/lang/tr.json",
|
|
36
36
|
"type": "registry:lang",
|
|
37
37
|
"target": "$modules$/register-page/lang/tr.json",
|
|
38
|
-
"content": "{\
|
|
38
|
+
"content": "{\n \"title\": \"Hesap Oluştur\",\n \"description\": \"Başlamak için bir hesap oluşturun\",\n \"cardTitle\": \"Kayıt Ol\",\n \"username\": \"Kullanıcı Adı\",\n \"usernamePlaceholder\": \"Kullanıcı adınızı girin\",\n \"email\": \"E-posta\",\n \"emailPlaceholder\": \"E-posta adresinizi girin\",\n \"password\": \"Şifre\",\n \"passwordPlaceholder\": \"Şifre girin\",\n \"confirmPassword\": \"Şifre Onayı\",\n \"confirmPasswordPlaceholder\": \"Şifrenizi onaylayın\",\n \"passwordMismatch\": \"Şifreler eşleşmiyor\",\n \"submit\": \"Hesap Oluştur\",\n \"submitting\": \"Hesap oluşturuluyor...\",\n \"hasAccount\": \"Zaten hesabınız var mı?\",\n \"loginLink\": \"Giriş yap\",\n \"toastSuccessTitle\": \"Hesap oluşturuldu!\",\n \"toastSuccessDesc\": \"Lütfen hesabınızı doğrulamak için e-postanızı kontrol edin.\",\n \"toastErrorTitle\": \"Kayıt başarısız\",\n \"errorGeneric\": \"Kayıt başarısız. Lütfen tekrar deneyin.\",\n \"successTitle\": \"Hesap Oluşturuldu!\",\n \"successMessage\": \"Lütfen hesabınızı doğrulamak için e-postanızı kontrol edin.\",\n \"goToLogin\": \"Girişe Git\"\n}\n"
|
|
39
39
|
}
|
|
40
40
|
],
|
|
41
41
|
"exports": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"path": "related-posts-block/index.ts",
|
|
14
14
|
"type": "registry:index",
|
|
15
15
|
"target": "$modules$/related-posts-block/index.ts",
|
|
16
|
-
"content": "export * from './related-posts-block';\
|
|
16
|
+
"content": "export * from './related-posts-block';\n"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
"path": "related-posts-block/related-posts-block.tsx",
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
"path": "related-products-block/index.ts",
|
|
14
14
|
"type": "registry:index",
|
|
15
15
|
"target": "$modules$/related-products-block/index.ts",
|
|
16
|
-
"content": "export * from './related-products-block';\
|
|
16
|
+
"content": "export * from './related-products-block';\n"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
"path": "related-products-block/related-products-block.tsx",
|
|
20
20
|
"type": "registry:block",
|
|
21
21
|
"target": "$modules$/related-products-block/related-products-block.tsx",
|
|
22
|
-
"content": "import { Link } from \"react-router\";\
|
|
22
|
+
"content": "import { Link } from \"react-router\";\nimport { Star } from \"lucide-react\";\nimport { Card, CardContent } from \"@/components/ui/card\";\nimport { useTranslation } from \"react-i18next\";\nimport constants from \"@/constants/constants.json\";\nimport { formatPrice } from \"@/modules/ecommerce-core/format-price\";\nimport type { Product } from \"@/modules/ecommerce-core/types\";\n\ninterface RelatedProductsBlockProps {\n products: Product[];\n title?: string;\n}\n\nexport function RelatedProductsBlock({\n products,\n title,\n}: RelatedProductsBlockProps) {\n const { t } = useTranslation(\"related-products-block\");\n\n if (products.length === 0) {\n return null;\n }\n\n return (\n <div>\n <h2 className=\"text-2xl font-bold mb-6\">\n {title || t(\"title\", \"Related Products\")}\n </h2>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6\">\n {products.map((product) => (\n <div key={product.id} className=\"contents\" data-db-table=\"products\" data-db-id={product.id}>\n <Card\n className=\"group overflow-hidden border-0 p-0 shadow-sm hover:shadow-lg transition-all duration-300\"\n >\n <Link to={`/products/${product.slug}`}>\n <div className=\"relative aspect-square overflow-hidden cursor-pointer\">\n <img\n src={product.images?.length ? product.images?.[0] : \"/images/placeholder.png\"}\n alt={product.name}\n className=\"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300\"\n />\n </div>\n </Link>\n <CardContent className=\"p-4\">\n <Link to={`/products/${product.slug}`}>\n <h3 className=\"font-semibold hover:text-primary transition-colors line-clamp-1\">\n {product.name}\n </h3>\n </Link>\n <div className=\"flex items-center justify-between mt-2\">\n <span className=\"font-semibold\">\n {formatPrice(product.price, constants.site.currency)}\n </span>\n <div className=\"flex items-center gap-1\">\n <Star className=\"h-3 w-3 fill-current text-yellow-400\" />\n <span className=\"text-xs\">{product.rating}</span>\n </div>\n </div>\n </CardContent>\n </Card>\n </div>\n ))}\n </div>\n </div>\n );\n}\n"
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"path": "related-products-block/lang/en.json",
|
|
@@ -17,25 +17,25 @@
|
|
|
17
17
|
"path": "reset-password-page-split/index.ts",
|
|
18
18
|
"type": "registry:index",
|
|
19
19
|
"target": "$modules$/reset-password-page-split/index.ts",
|
|
20
|
-
"content": "export * from './reset-password-page-split';\
|
|
20
|
+
"content": "export * from './reset-password-page-split';\nexport { default } from './reset-password-page-split';\n"
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
"path": "reset-password-page-split/reset-password-page-split.tsx",
|
|
24
24
|
"type": "registry:page",
|
|
25
25
|
"target": "$modules$/reset-password-page-split/reset-password-page-split.tsx",
|
|
26
|
-
"content": "import { useState } from \"react\";\r\nimport { Link, useNavigate, useSearchParams } from \"react-router\";\r\nimport { toast } from \"sonner\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { usePageTitle } from \"@/hooks/use-page-title\";\r\nimport { Button } from \"@/components/ui/button\";\r\nimport { Logo } from \"@/components/Logo\";\r\nimport { KeyRound, ArrowLeft, CheckCircle } from \"lucide-react\";\r\nimport { useAuth } from \"@/modules/auth-core\";\r\nimport { getErrorMessage } from \"@/modules/api\";\r\nimport { FormField } from \"@/components/FormField\";\r\nimport { PasswordInput } from \"@/components/PasswordInput\";\r\n\r\ninterface ResetPasswordPageSplitProps {\r\n image?: string;\r\n}\r\n\r\nexport function ResetPasswordPageSplit({\r\n image = \"/images/placeholder.png\",\r\n}: ResetPasswordPageSplitProps) {\r\n const { t } = useTranslation(\"reset-password-page-split\");\r\n usePageTitle({ title: t(\"title\", \"Reset Password\") });\r\n const navigate = useNavigate();\r\n const [searchParams] = useSearchParams();\r\n const { resetPassword } = useAuth();\r\n\r\n // Get code and username from URL params\r\n const code = searchParams.get(\"code\") || \"\";\r\n const username = searchParams.get(\"username\") || searchParams.get(\"email\") || \"\";\r\n\r\n const [password, setPassword] = useState(\"\");\r\n const [confirmPassword, setConfirmPassword] = useState(\"\");\r\n const [isLoading, setIsLoading] = useState(false);\r\n const [error, setError] = useState<string | null>(null);\r\n const [isSuccess, setIsSuccess] = useState(false);\r\n\r\n const handleSubmit = async (e: React.FormEvent) => {\r\n e.preventDefault();\r\n setError(null);\r\n\r\n // Validate passwords match\r\n if (password !== confirmPassword) {\r\n setError(t(\"passwordMismatch\", \"Passwords do not match\"));\r\n return;\r\n }\r\n\r\n // Validate we have required params\r\n if (!code || !username) {\r\n setError(t(\"invalidLink\", \"Invalid or expired reset link. Please request a new one.\"));\r\n return;\r\n }\r\n\r\n setIsLoading(true);\r\n\r\n try {\r\n await resetPassword(username, code, password);\r\n\r\n setIsSuccess(true);\r\n toast.success(t(\"passwordResetSuccess\", \"Password reset successfully!\"));\r\n } catch (err) {\r\n const errorMessage = getErrorMessage(\r\n err,\r\n t(\"resetPasswordError\", \"Failed to reset password. Please try again.\")\r\n );\r\n setError(errorMessage);\r\n } finally {\r\n setIsLoading(false);\r\n }\r\n };\r\n\r\n // Success state\r\n if (isSuccess) {\r\n return (\r\n <section className=\"w-full md:grid md:min-h-screen md:grid-cols-2\">\r\n <div className=\"flex items-center justify-center px-4 py-12\">\r\n <div className=\"mx-auto grid w-full max-w-sm gap-6 text-center\">\r\n <Logo />\r\n <hr />\r\n\r\n <div className=\"flex justify-center\">\r\n <div className=\"w-16 h-16 bg-green-100 dark:bg-green-900/30 rounded-full flex items-center justify-center\">\r\n <CheckCircle className=\"w-8 h-8 text-green-600 dark:text-green-400\" />\r\n </div>\r\n </div>\r\n\r\n <div>\r\n <h1 className=\"text-xl font-bold tracking-tight\">\r\n {t(\"passwordReset\", \"Password Reset!\")}\r\n </h1>\r\n <p className=\"text-sm text-muted-foreground mt-2\">\r\n {t(\"passwordResetDescription\", \"Your password has been reset successfully. You can now log in with your new password.\")}\r\n </p>\r\n </div>\r\n\r\n <Button onClick={() => navigate(\"/login\")} className=\"w-full\">\r\n {t(\"goToLogin\", \"Go to Login\")}\r\n </Button>\r\n\r\n <hr />\r\n <p className=\"text-sm text-muted-foreground\">\r\n © {new Date().getFullYear()} {t(\"copyright\", \"All rights reserved.\")}\r\n </p>\r\n </div>\r\n </div>\r\n <div className=\"hidden p-4 md:block\">\r\n <img\r\n loading=\"lazy\"\r\n decoding=\"async\"\r\n width=\"1920\"\r\n height=\"1080\"\r\n alt={t(\"imageAlt\", \"Reset password background\")}\r\n src={image}\r\n className=\"size-full rounded-lg border bg-muted object-cover object-center\"\r\n />\r\n </div>\r\n </section>\r\n );\r\n }\r\n\r\n // Invalid link state\r\n if (!code || !username) {\r\n return (\r\n <section className=\"w-full md:grid md:min-h-screen md:grid-cols-2\">\r\n <div className=\"flex items-center justify-center px-4 py-12\">\r\n <div className=\"mx-auto grid w-full max-w-sm gap-6 text-center\">\r\n <Logo />\r\n <hr />\r\n\r\n <div>\r\n <h1 className=\"text-xl font-bold tracking-tight text-red-600\">\r\n {t(\"invalidLinkTitle\", \"Invalid Reset Link\")}\r\n </h1>\r\n <p className=\"text-sm text-muted-foreground mt-2\">\r\n {t(\"invalidLinkDescription\", \"This password reset link is invalid or has expired. Please request a new one.\")}\r\n </p>\r\n </div>\r\n\r\n <Button onClick={() => navigate(\"/forgot-password\")} className=\"w-full\">\r\n {t(\"requestNewLink\", \"Request New Link\")}\r\n </Button>\r\n\r\n <Link\r\n to=\"/login\"\r\n className=\"inline-flex items-center justify-center gap-2 text-sm text-muted-foreground hover:text-foreground\"\r\n >\r\n <ArrowLeft className=\"w-4 h-4\" />\r\n {t(\"backToLogin\", \"Back to login\")}\r\n </Link>\r\n\r\n <hr />\r\n <p className=\"text-sm text-muted-foreground\">\r\n © {new Date().getFullYear()} {t(\"copyright\", \"All rights reserved.\")}\r\n </p>\r\n </div>\r\n </div>\r\n <div className=\"hidden p-4 md:block\">\r\n <img\r\n loading=\"lazy\"\r\n decoding=\"async\"\r\n width=\"1920\"\r\n height=\"1080\"\r\n alt={t(\"imageAlt\", \"Reset password background\")}\r\n src={image}\r\n className=\"size-full rounded-lg border bg-muted object-cover object-center\"\r\n />\r\n </div>\r\n </section>\r\n );\r\n } \r\n\r\n return (\r\n <section className=\"w-full md:grid md:min-h-screen md:grid-cols-2\">\r\n <div className=\"flex items-center justify-center px-4 py-12\">\r\n <div className=\"mx-auto grid w-full max-w-sm gap-6\">\r\n <Logo />\r\n <hr />\r\n\r\n <div className=\"flex justify-center\">\r\n <div className=\"w-12 h-12 bg-primary/10 rounded-full flex items-center justify-center\">\r\n <KeyRound className=\"w-6 h-6 text-primary\" />\r\n </div>\r\n </div>\r\n\r\n <div className=\"text-center\">\r\n <h1 className=\"text-xl font-bold tracking-tight\">\r\n {t(\"title\", \"Reset Password\")}\r\n </h1>\r\n <p className=\"text-sm text-muted-foreground mt-1\">\r\n {t(\"subtitle\", \"Enter your new password below\")}\r\n </p>\r\n </div>\r\n\r\n {error && (\r\n <div className=\"p-3 text-sm text-red-600 bg-red-50 dark:bg-red-950 dark:text-red-400 rounded-md\">\r\n {error}\r\n </div>\r\n )}\r\n\r\n <form onSubmit={handleSubmit} className=\"grid gap-4\">\r\n <div className=\"grid gap-2\">\r\n <FormField label={t(\"newPassword\", \"New Password\")} htmlFor=\"password\" required>\r\n <PasswordInput\r\n required\r\n id=\"password\"\r\n name=\"password\"\r\n autoComplete=\"new-password\"\r\n placeholder=\"••••••••\"\r\n value={password}\r\n onChange={(e) => setPassword(e.target.value)}\r\n disabled={isLoading}\r\n minLength={8}\r\n />\r\n </FormField>\r\n </div>\r\n\r\n <div className=\"grid gap-2\">\r\n <FormField label={t(\"confirmPassword\", \"Confirm Password\")} htmlFor=\"confirm-password\" required>\r\n <PasswordInput\r\n required\r\n id=\"confirm-password\"\r\n name=\"confirm-password\"\r\n autoComplete=\"confirm-password\"\r\n placeholder=\"••••••••\"\r\n value={confirmPassword}\r\n onChange={(e) => setConfirmPassword(e.target.value)}\r\n disabled={isLoading}\r\n minLength={8}\r\n />\r\n </FormField>\r\n </div>\r\n\r\n <Button type=\"submit\" className=\"w-full\" disabled={isLoading}>\r\n {isLoading ? (\r\n <>\r\n <div className=\"w-4 h-4 border-2 border-primary-foreground border-t-transparent rounded-full animate-spin mr-2\" />\r\n {t(\"resetting\", \"Resetting...\")}\r\n </>\r\n ) : (\r\n t(\"resetPassword\", \"Reset Password\")\r\n )}\r\n </Button>\r\n </form>\r\n\r\n <Link\r\n to=\"/login\"\r\n className=\"inline-flex items-center justify-center gap-2 text-sm text-muted-foreground hover:text-foreground\"\r\n >\r\n <ArrowLeft className=\"w-4 h-4\" />\r\n {t(\"backToLogin\", \"Back to login\")}\r\n </Link>\r\n\r\n <hr />\r\n <p className=\"text-sm text-muted-foreground\">\r\n © {new Date().getFullYear()} {t(\"copyright\", \"All rights reserved.\")}\r\n </p>\r\n </div>\r\n </div>\r\n <div className=\"hidden p-4 md:block\">\r\n <img\r\n loading=\"lazy\"\r\n decoding=\"async\"\r\n width=\"1920\"\r\n height=\"1080\"\r\n alt={t(\"imageAlt\", \"Reset password background\")}\r\n src={image}\r\n className=\"size-full rounded-lg border bg-muted object-cover object-center\"\r\n />\r\n </div>\r\n </section>\r\n );\r\n}\r\n\r\nexport default ResetPasswordPageSplit;\r\n"
|
|
26
|
+
"content": "import { useState } from \"react\";\nimport { Link, useNavigate, useSearchParams } from \"react-router\";\nimport { toast } from \"sonner\";\nimport { useTranslation } from \"react-i18next\";\nimport { usePageTitle } from \"@/hooks/use-page-title\";\nimport { Button } from \"@/components/ui/button\";\nimport { Logo } from \"@/components/Logo\";\nimport { KeyRound, ArrowLeft, CheckCircle } from \"lucide-react\";\nimport { useAuth } from \"@/modules/auth-core\";\nimport { getErrorMessage } from \"@/modules/api\";\nimport { FormField } from \"@/components/FormField\";\nimport { PasswordInput } from \"@/components/PasswordInput\";\n\ninterface ResetPasswordPageSplitProps {\n image?: string;\n}\n\nexport function ResetPasswordPageSplit({\n image = \"/images/placeholder.png\",\n}: ResetPasswordPageSplitProps) {\n const { t } = useTranslation(\"reset-password-page-split\");\n usePageTitle({ title: t(\"title\", \"Reset Password\") });\n const navigate = useNavigate();\n const [searchParams] = useSearchParams();\n const { resetPassword } = useAuth();\n\n // Get code and username from URL params\n const code = searchParams.get(\"code\") || \"\";\n const username = searchParams.get(\"username\") || searchParams.get(\"email\") || \"\";\n\n const [password, setPassword] = useState(\"\");\n const [confirmPassword, setConfirmPassword] = useState(\"\");\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const [isSuccess, setIsSuccess] = useState(false);\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n setError(null);\n\n // Validate passwords match\n if (password !== confirmPassword) {\n setError(t(\"passwordMismatch\", \"Passwords do not match\"));\n return;\n }\n\n // Validate we have required params\n if (!code || !username) {\n setError(t(\"invalidLink\", \"Invalid or expired reset link. Please request a new one.\"));\n return;\n }\n\n setIsLoading(true);\n\n try {\n await resetPassword(username, code, password);\n\n setIsSuccess(true);\n toast.success(t(\"passwordResetSuccess\", \"Password reset successfully!\"));\n } catch (err) {\n const errorMessage = getErrorMessage(\n err,\n t(\"resetPasswordError\", \"Failed to reset password. Please try again.\")\n );\n setError(errorMessage);\n } finally {\n setIsLoading(false);\n }\n };\n\n // Success state\n if (isSuccess) {\n return (\n <section className=\"w-full md:grid md:min-h-screen md:grid-cols-2\">\n <div className=\"flex items-center justify-center px-4 py-12\">\n <div className=\"mx-auto grid w-full max-w-sm gap-6 text-center\">\n <Logo />\n <hr />\n\n <div className=\"flex justify-center\">\n <div className=\"w-16 h-16 bg-green-100 dark:bg-green-900/30 rounded-full flex items-center justify-center\">\n <CheckCircle className=\"w-8 h-8 text-green-600 dark:text-green-400\" />\n </div>\n </div>\n\n <div>\n <h1 className=\"text-xl font-bold tracking-tight\">\n {t(\"passwordReset\", \"Password Reset!\")}\n </h1>\n <p className=\"text-sm text-muted-foreground mt-2\">\n {t(\"passwordResetDescription\", \"Your password has been reset successfully. You can now log in with your new password.\")}\n </p>\n </div>\n\n <Button onClick={() => navigate(\"/login\")} className=\"w-full\">\n {t(\"goToLogin\", \"Go to Login\")}\n </Button>\n\n <hr />\n <p className=\"text-sm text-muted-foreground\">\n © {new Date().getFullYear()} {t(\"copyright\", \"All rights reserved.\")}\n </p>\n </div>\n </div>\n <div className=\"hidden p-4 md:block\">\n <img\n loading=\"lazy\"\n decoding=\"async\"\n width=\"1920\"\n height=\"1080\"\n alt={t(\"imageAlt\", \"Reset password background\")}\n src={image}\n className=\"size-full rounded-lg border bg-muted object-cover object-center\"\n />\n </div>\n </section>\n );\n }\n\n // Invalid link state\n if (!code || !username) {\n return (\n <section className=\"w-full md:grid md:min-h-screen md:grid-cols-2\">\n <div className=\"flex items-center justify-center px-4 py-12\">\n <div className=\"mx-auto grid w-full max-w-sm gap-6 text-center\">\n <Logo />\n <hr />\n\n <div>\n <h1 className=\"text-xl font-bold tracking-tight text-red-600\">\n {t(\"invalidLinkTitle\", \"Invalid Reset Link\")}\n </h1>\n <p className=\"text-sm text-muted-foreground mt-2\">\n {t(\"invalidLinkDescription\", \"This password reset link is invalid or has expired. Please request a new one.\")}\n </p>\n </div>\n\n <Button onClick={() => navigate(\"/forgot-password\")} className=\"w-full\">\n {t(\"requestNewLink\", \"Request New Link\")}\n </Button>\n\n <Link\n to=\"/login\"\n className=\"inline-flex items-center justify-center gap-2 text-sm text-muted-foreground hover:text-foreground\"\n >\n <ArrowLeft className=\"w-4 h-4\" />\n {t(\"backToLogin\", \"Back to login\")}\n </Link>\n\n <hr />\n <p className=\"text-sm text-muted-foreground\">\n © {new Date().getFullYear()} {t(\"copyright\", \"All rights reserved.\")}\n </p>\n </div>\n </div>\n <div className=\"hidden p-4 md:block\">\n <img\n loading=\"lazy\"\n decoding=\"async\"\n width=\"1920\"\n height=\"1080\"\n alt={t(\"imageAlt\", \"Reset password background\")}\n src={image}\n className=\"size-full rounded-lg border bg-muted object-cover object-center\"\n />\n </div>\n </section>\n );\n } \n\n return (\n <section className=\"w-full md:grid md:min-h-screen md:grid-cols-2\">\n <div className=\"flex items-center justify-center px-4 py-12\">\n <div className=\"mx-auto grid w-full max-w-sm gap-6\">\n <Logo />\n <hr />\n\n <div className=\"flex justify-center\">\n <div className=\"w-12 h-12 bg-primary/10 rounded-full flex items-center justify-center\">\n <KeyRound className=\"w-6 h-6 text-primary\" />\n </div>\n </div>\n\n <div className=\"text-center\">\n <h1 className=\"text-xl font-bold tracking-tight\">\n {t(\"title\", \"Reset Password\")}\n </h1>\n <p className=\"text-sm text-muted-foreground mt-1\">\n {t(\"subtitle\", \"Enter your new password below\")}\n </p>\n </div>\n\n {error && (\n <div className=\"p-3 text-sm text-red-600 bg-red-50 dark:bg-red-950 dark:text-red-400 rounded-md\">\n {error}\n </div>\n )}\n\n <form onSubmit={handleSubmit} className=\"grid gap-4\">\n <div className=\"grid gap-2\">\n <FormField label={t(\"newPassword\", \"New Password\")} htmlFor=\"password\" required>\n <PasswordInput\n required\n id=\"password\"\n name=\"password\"\n autoComplete=\"new-password\"\n placeholder=\"••••••••\"\n value={password}\n onChange={(e) => setPassword(e.target.value)}\n disabled={isLoading}\n minLength={8}\n />\n </FormField>\n </div>\n\n <div className=\"grid gap-2\">\n <FormField label={t(\"confirmPassword\", \"Confirm Password\")} htmlFor=\"confirm-password\" required>\n <PasswordInput\n required\n id=\"confirm-password\"\n name=\"confirm-password\"\n autoComplete=\"confirm-password\"\n placeholder=\"••••••••\"\n value={confirmPassword}\n onChange={(e) => setConfirmPassword(e.target.value)}\n disabled={isLoading}\n minLength={8}\n />\n </FormField>\n </div>\n\n <Button type=\"submit\" className=\"w-full\" disabled={isLoading}>\n {isLoading ? (\n <>\n <div className=\"w-4 h-4 border-2 border-primary-foreground border-t-transparent rounded-full animate-spin mr-2\" />\n {t(\"resetting\", \"Resetting...\")}\n </>\n ) : (\n t(\"resetPassword\", \"Reset Password\")\n )}\n </Button>\n </form>\n\n <Link\n to=\"/login\"\n className=\"inline-flex items-center justify-center gap-2 text-sm text-muted-foreground hover:text-foreground\"\n >\n <ArrowLeft className=\"w-4 h-4\" />\n {t(\"backToLogin\", \"Back to login\")}\n </Link>\n\n <hr />\n <p className=\"text-sm text-muted-foreground\">\n © {new Date().getFullYear()} {t(\"copyright\", \"All rights reserved.\")}\n </p>\n </div>\n </div>\n <div className=\"hidden p-4 md:block\">\n <img\n loading=\"lazy\"\n decoding=\"async\"\n width=\"1920\"\n height=\"1080\"\n alt={t(\"imageAlt\", \"Reset password background\")}\n src={image}\n className=\"size-full rounded-lg border bg-muted object-cover object-center\"\n />\n </div>\n </section>\n );\n}\n\nexport default ResetPasswordPageSplit;\n"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
"path": "reset-password-page-split/lang/en.json",
|
|
30
30
|
"type": "registry:lang",
|
|
31
31
|
"target": "$modules$/reset-password-page-split/lang/en.json",
|
|
32
|
-
"content": "{\
|
|
32
|
+
"content": "{\n \"title\": \"Reset Password\",\n \"subtitle\": \"Enter your new password below\",\n \"newPassword\": \"New Password\",\n \"confirmPassword\": \"Confirm Password\",\n \"resetPassword\": \"Reset Password\",\n \"resetting\": \"Resetting...\",\n \"passwordMismatch\": \"Passwords do not match\",\n \"invalidLink\": \"Invalid or expired reset link. Please request a new one.\",\n \"passwordResetSuccess\": \"Password reset successfully!\",\n \"resetPasswordError\": \"Failed to reset password. Please try again.\",\n \"passwordReset\": \"Password Reset!\",\n \"passwordResetDescription\": \"Your password has been reset successfully. You can now log in with your new password.\",\n \"goToLogin\": \"Go to Login\",\n \"invalidLinkTitle\": \"Invalid Reset Link\",\n \"invalidLinkDescription\": \"This password reset link is invalid or has expired. Please request a new one.\",\n \"requestNewLink\": \"Request New Link\",\n \"backToLogin\": \"Back to login\",\n \"copyright\": \"All rights reserved.\",\n \"imageAlt\": \"Reset password background\"\n}\n"
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
"path": "reset-password-page-split/lang/tr.json",
|
|
36
36
|
"type": "registry:lang",
|
|
37
37
|
"target": "$modules$/reset-password-page-split/lang/tr.json",
|
|
38
|
-
"content": "{\
|
|
38
|
+
"content": "{\n \"title\": \"Şifre Sıfırla\",\n \"subtitle\": \"Yeni şifrenizi aşağıya girin\",\n \"newPassword\": \"Yeni Şifre\",\n \"confirmPassword\": \"Şifreyi Onayla\",\n \"resetPassword\": \"Şifreyi Sıfırla\",\n \"resetting\": \"Sıfırlanıyor...\",\n \"passwordMismatch\": \"Şifreler eşleşmiyor\",\n \"invalidLink\": \"Geçersiz veya süresi dolmuş sıfırlama bağlantısı. Lütfen yeni bir tane isteyin.\",\n \"passwordResetSuccess\": \"Şifre başarıyla sıfırlandı!\",\n \"resetPasswordError\": \"Şifre sıfırlanamadı. Lütfen tekrar deneyin.\",\n \"passwordReset\": \"Şifre Sıfırlandı!\",\n \"passwordResetDescription\": \"Şifreniz başarıyla sıfırlandı. Artık yeni şifrenizle giriş yapabilirsiniz.\",\n \"goToLogin\": \"Girişe Git\",\n \"invalidLinkTitle\": \"Geçersiz Sıfırlama Bağlantısı\",\n \"invalidLinkDescription\": \"Bu şifre sıfırlama bağlantısı geçersiz veya süresi dolmuş. Lütfen yeni bir tane isteyin.\",\n \"requestNewLink\": \"Yeni Bağlantı İste\",\n \"backToLogin\": \"Girişe dön\",\n \"copyright\": \"Tüm hakları saklıdır.\",\n \"imageAlt\": \"Şifre sıfırlama arka planı\"\n}\n"
|
|
39
39
|
}
|
|
40
40
|
],
|
|
41
41
|
"exports": {
|
|
@@ -17,25 +17,25 @@
|
|
|
17
17
|
"path": "reset-password-page/index.ts",
|
|
18
18
|
"type": "registry:index",
|
|
19
19
|
"target": "$modules$/reset-password-page/index.ts",
|
|
20
|
-
"content": "export * from './reset-password-page';\
|
|
20
|
+
"content": "export * from './reset-password-page';\nexport { default } from './reset-password-page';\n"
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
"path": "reset-password-page/reset-password-page.tsx",
|
|
24
24
|
"type": "registry:page",
|
|
25
25
|
"target": "$modules$/reset-password-page/reset-password-page.tsx",
|
|
26
|
-
"content": "import { useState } from \"react\";\r\nimport { Link, useNavigate, useSearchParams } from \"react-router\";\r\nimport { toast } from \"sonner\";\r\nimport { Layout } from \"@/components/Layout\";\r\nimport { usePageTitle } from \"@/hooks/use-page-title\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { useAuth } from \"@/modules/auth-core\";\r\nimport { getErrorMessage } from \"@/modules/api\";\r\nimport { Button } from \"@/components/ui/button\";\r\nimport { Input } from \"@/components/ui/input\";\r\nimport { Label } from \"@/components/ui/label\";\r\nimport {\r\n Card,\r\n CardContent,\r\n CardHeader,\r\n CardTitle,\r\n CardDescription,\r\n} from \"@/components/ui/card\";\r\nimport { KeyRound, ArrowLeft, Eye, EyeOff, CheckCircle2 } from \"lucide-react\";\r\n\r\nexport function ResetPasswordPage() {\r\n const { t } = useTranslation(\"reset-password-page\");\r\n usePageTitle({ title: t(\"title\", \"Reset Password\") });\r\n const navigate = useNavigate();\r\n const [searchParams] = useSearchParams();\r\n const { resetPassword } = useAuth();\r\n\r\n const code = searchParams.get(\"code\") || \"\";\r\n const username =\r\n searchParams.get(\"username\") || searchParams.get(\"email\") || \"\";\r\n\r\n const [password, setPassword] = useState(\"\");\r\n const [confirmPassword, setConfirmPassword] = useState(\"\");\r\n const [showPassword, setShowPassword] = useState(false);\r\n const [isLoading, setIsLoading] = useState(false);\r\n const [error, setError] = useState<string | null>(null);\r\n const [isSuccess, setIsSuccess] = useState(false);\r\n\r\n const handleSubmit = async (e: React.FormEvent) => {\r\n e.preventDefault();\r\n setError(null);\r\n\r\n if (password !== confirmPassword) {\r\n setError(t(\"passwordMismatch\", \"Passwords do not match\"));\r\n return;\r\n }\r\n\r\n if (!code || !username) {\r\n setError(\r\n t(\r\n \"invalidLink\",\r\n \"Invalid or expired reset link. Please request a new one.\",\r\n ),\r\n );\r\n return;\r\n }\r\n\r\n setIsLoading(true);\r\n\r\n try {\r\n await resetPassword(username, code, password);\r\n setIsSuccess(true);\r\n toast.success(\r\n t(\"passwordResetSuccess\", \"Password reset successfully!\"),\r\n );\r\n } catch (err) {\r\n const errorMessage = getErrorMessage(\r\n err,\r\n t(\r\n \"resetPasswordError\",\r\n \"Failed to reset password. Please try again.\",\r\n ),\r\n );\r\n setError(errorMessage);\r\n } finally {\r\n setIsLoading(false);\r\n }\r\n };\r\n\r\n // Success state\r\n if (isSuccess) {\r\n return (\r\n <Layout>\r\n <div className=\"min-h-screen bg-muted/30 py-12\">\r\n <div className=\"w-full max-w-[var(--container-max-width)] mx-auto px-4\">\r\n <div className=\"max-w-md mx-auto\">\r\n <Card>\r\n <CardContent className=\"pt-8 pb-8 text-center\">\r\n <CheckCircle2 className=\"w-16 h-16 text-green-500 mx-auto mb-4\" />\r\n <h1 className=\"text-2xl font-bold mb-2\">\r\n {t(\"passwordReset\", \"Password Reset!\")}\r\n </h1>\r\n <p className=\"text-muted-foreground mb-6\">\r\n {t(\r\n \"passwordResetDescription\",\r\n \"Your password has been reset successfully. You can now log in with your new password.\",\r\n )}\r\n </p>\r\n <Button asChild className=\"w-full\">\r\n <Link to=\"/login\">\r\n {t(\"goToLogin\", \"Go to Login\")}\r\n </Link>\r\n </Button>\r\n </CardContent>\r\n </Card>\r\n </div>\r\n </div>\r\n </div>\r\n </Layout>\r\n );\r\n }\r\n\r\n // Invalid link state\r\n if (!code || !username) {\r\n return (\r\n <Layout>\r\n <div className=\"min-h-screen bg-muted/30 py-12\">\r\n <div className=\"w-full max-w-[var(--container-max-width)] mx-auto px-4\">\r\n <div className=\"max-w-md mx-auto\">\r\n <Card>\r\n <CardContent className=\"pt-8 pb-8 text-center\">\r\n <h1 className=\"text-2xl font-bold mb-2 text-red-600\">\r\n {t(\"invalidLinkTitle\", \"Invalid Reset Link\")}\r\n </h1>\r\n <p className=\"text-muted-foreground mb-6\">\r\n {t(\r\n \"invalidLinkDescription\",\r\n \"This password reset link is invalid or has expired. Please request a new one.\",\r\n )}\r\n </p>\r\n <Button\r\n onClick={() => navigate(\"/forgot-password\")}\r\n className=\"w-full mb-3\"\r\n >\r\n {t(\"requestNewLink\", \"Request New Link\")}\r\n </Button>\r\n <Link\r\n to=\"/login\"\r\n className=\"inline-flex items-center justify-center gap-1 text-sm text-muted-foreground hover:text-primary\"\r\n >\r\n <ArrowLeft className=\"w-4 h-4\" />\r\n {t(\"backToLogin\", \"Back to Login\")}\r\n </Link>\r\n </CardContent>\r\n </Card>\r\n </div>\r\n </div>\r\n </div>\r\n </Layout>\r\n );\r\n }\r\n\r\n return (\r\n <Layout>\r\n <div className=\"min-h-screen bg-muted/30 py-12\">\r\n <div className=\"w-full max-w-[var(--container-max-width)] mx-auto px-4\">\r\n <div className=\"text-center mb-12\">\r\n <h1 className=\"text-4xl font-bold text-foreground mb-4\">\r\n {t(\"title\", \"Reset Password\")}\r\n </h1>\r\n <div className=\"w-16 h-1 bg-primary mx-auto mb-6\"></div>\r\n <p className=\"text-lg text-muted-foreground max-w-xl mx-auto\">\r\n {t(\"subtitle\", \"Enter your new password below\")}\r\n </p>\r\n </div>\r\n\r\n <div className=\"max-w-md mx-auto\">\r\n <Card>\r\n <CardHeader>\r\n <CardTitle className=\"flex items-center gap-2\">\r\n <KeyRound className=\"w-5 h-5 text-primary\" />\r\n {t(\"resetPassword\", \"Reset Password\")}\r\n </CardTitle>\r\n <CardDescription>\r\n {t(\"subtitle\", \"Enter your new password below\")}\r\n </CardDescription>\r\n </CardHeader>\r\n <CardContent>\r\n <form onSubmit={handleSubmit} className=\"space-y-6\">\r\n <div>\r\n <Label htmlFor=\"password\">\r\n {t(\"newPassword\", \"New Password\")} *\r\n </Label>\r\n <div className=\"relative\">\r\n <Input\r\n id=\"password\"\r\n type={showPassword ? \"text\" : \"password\"}\r\n value={password}\r\n onChange={(e) => setPassword(e.target.value)}\r\n placeholder={t(\r\n \"newPasswordPlaceholder\",\r\n \"Enter new password\",\r\n )}\r\n required\r\n className=\"mt-1 pr-10\"\r\n autoComplete=\"new-password\"\r\n minLength={8}\r\n disabled={isLoading}\r\n />\r\n <button\r\n type=\"button\"\r\n onClick={() => setShowPassword(!showPassword)}\r\n className=\"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground\"\r\n >\r\n {showPassword ? (\r\n <EyeOff className=\"w-4 h-4\" />\r\n ) : (\r\n <Eye className=\"w-4 h-4\" />\r\n )}\r\n </button>\r\n </div>\r\n <p className=\"text-xs text-muted-foreground mt-1\">\r\n {t(\r\n \"passwordRequirements\",\r\n \"At least 8 characters, 1 letter and 1 number\",\r\n )}\r\n </p>\r\n </div>\r\n\r\n <div>\r\n <Label htmlFor=\"confirmPassword\">\r\n {t(\"confirmPassword\", \"Confirm Password\")} *\r\n </Label>\r\n <Input\r\n id=\"confirmPassword\"\r\n type={showPassword ? \"text\" : \"password\"}\r\n value={confirmPassword}\r\n onChange={(e) => setConfirmPassword(e.target.value)}\r\n placeholder={t(\r\n \"confirmPasswordPlaceholder\",\r\n \"Confirm new password\",\r\n )}\r\n required\r\n className=\"mt-1\"\r\n autoComplete=\"new-password\"\r\n minLength={8}\r\n disabled={isLoading}\r\n />\r\n </div>\r\n\r\n {error && (\r\n <div className=\"p-4 bg-red-50 border border-red-200 rounded-lg\">\r\n <p className=\"text-red-800 text-sm font-medium\">\r\n {error}\r\n </p>\r\n </div>\r\n )}\r\n\r\n <Button\r\n type=\"submit\"\r\n size=\"lg\"\r\n className=\"w-full\"\r\n disabled={isLoading}\r\n >\r\n {isLoading ? (\r\n <>\r\n <div className=\"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin mr-2\" />\r\n {t(\"resetting\", \"Resetting...\")}\r\n </>\r\n ) : (\r\n t(\"resetPassword\", \"Reset Password\")\r\n )}\r\n </Button>\r\n\r\n <div className=\"text-center\">\r\n <Link\r\n to=\"/login\"\r\n className=\"text-sm text-muted-foreground hover:text-primary inline-flex items-center gap-1\"\r\n >\r\n <ArrowLeft className=\"w-4 h-4\" />\r\n {t(\"backToLogin\", \"Back to Login\")}\r\n </Link>\r\n </div>\r\n </form>\r\n </CardContent>\r\n </Card>\r\n </div>\r\n </div>\r\n </div>\r\n </Layout>\r\n );\r\n}\r\n\r\nexport default ResetPasswordPage;\r\n"
|
|
26
|
+
"content": "import { useState } from \"react\";\nimport { Link, useNavigate, useSearchParams } from \"react-router\";\nimport { toast } from \"sonner\";\nimport { Layout } from \"@/components/Layout\";\nimport { usePageTitle } from \"@/hooks/use-page-title\";\nimport { useTranslation } from \"react-i18next\";\nimport { useAuth } from \"@/modules/auth-core\";\nimport { getErrorMessage } from \"@/modules/api\";\nimport { Button } from \"@/components/ui/button\";\nimport { Input } from \"@/components/ui/input\";\nimport { Label } from \"@/components/ui/label\";\nimport {\n Card,\n CardContent,\n CardHeader,\n CardTitle,\n CardDescription,\n} from \"@/components/ui/card\";\nimport { KeyRound, ArrowLeft, Eye, EyeOff, CheckCircle2 } from \"lucide-react\";\n\nexport function ResetPasswordPage() {\n const { t } = useTranslation(\"reset-password-page\");\n usePageTitle({ title: t(\"title\", \"Reset Password\") });\n const navigate = useNavigate();\n const [searchParams] = useSearchParams();\n const { resetPassword } = useAuth();\n\n const code = searchParams.get(\"code\") || \"\";\n const username =\n searchParams.get(\"username\") || searchParams.get(\"email\") || \"\";\n\n const [password, setPassword] = useState(\"\");\n const [confirmPassword, setConfirmPassword] = useState(\"\");\n const [showPassword, setShowPassword] = useState(false);\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const [isSuccess, setIsSuccess] = useState(false);\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n setError(null);\n\n if (password !== confirmPassword) {\n setError(t(\"passwordMismatch\", \"Passwords do not match\"));\n return;\n }\n\n if (!code || !username) {\n setError(\n t(\n \"invalidLink\",\n \"Invalid or expired reset link. Please request a new one.\",\n ),\n );\n return;\n }\n\n setIsLoading(true);\n\n try {\n await resetPassword(username, code, password);\n setIsSuccess(true);\n toast.success(\n t(\"passwordResetSuccess\", \"Password reset successfully!\"),\n );\n } catch (err) {\n const errorMessage = getErrorMessage(\n err,\n t(\n \"resetPasswordError\",\n \"Failed to reset password. Please try again.\",\n ),\n );\n setError(errorMessage);\n } finally {\n setIsLoading(false);\n }\n };\n\n // Success state\n if (isSuccess) {\n return (\n <Layout>\n <div className=\"min-h-screen bg-muted/30 py-12\">\n <div className=\"w-full max-w-[var(--container-max-width)] mx-auto px-4\">\n <div className=\"max-w-md mx-auto\">\n <Card>\n <CardContent className=\"pt-8 pb-8 text-center\">\n <CheckCircle2 className=\"w-16 h-16 text-green-500 mx-auto mb-4\" />\n <h1 className=\"text-2xl font-bold mb-2\">\n {t(\"passwordReset\", \"Password Reset!\")}\n </h1>\n <p className=\"text-muted-foreground mb-6\">\n {t(\n \"passwordResetDescription\",\n \"Your password has been reset successfully. You can now log in with your new password.\",\n )}\n </p>\n <Button asChild className=\"w-full\">\n <Link to=\"/login\">\n {t(\"goToLogin\", \"Go to Login\")}\n </Link>\n </Button>\n </CardContent>\n </Card>\n </div>\n </div>\n </div>\n </Layout>\n );\n }\n\n // Invalid link state\n if (!code || !username) {\n return (\n <Layout>\n <div className=\"min-h-screen bg-muted/30 py-12\">\n <div className=\"w-full max-w-[var(--container-max-width)] mx-auto px-4\">\n <div className=\"max-w-md mx-auto\">\n <Card>\n <CardContent className=\"pt-8 pb-8 text-center\">\n <h1 className=\"text-2xl font-bold mb-2 text-red-600\">\n {t(\"invalidLinkTitle\", \"Invalid Reset Link\")}\n </h1>\n <p className=\"text-muted-foreground mb-6\">\n {t(\n \"invalidLinkDescription\",\n \"This password reset link is invalid or has expired. Please request a new one.\",\n )}\n </p>\n <Button\n onClick={() => navigate(\"/forgot-password\")}\n className=\"w-full mb-3\"\n >\n {t(\"requestNewLink\", \"Request New Link\")}\n </Button>\n <Link\n to=\"/login\"\n className=\"inline-flex items-center justify-center gap-1 text-sm text-muted-foreground hover:text-primary\"\n >\n <ArrowLeft className=\"w-4 h-4\" />\n {t(\"backToLogin\", \"Back to Login\")}\n </Link>\n </CardContent>\n </Card>\n </div>\n </div>\n </div>\n </Layout>\n );\n }\n\n return (\n <Layout>\n <div className=\"min-h-screen bg-muted/30 py-12\">\n <div className=\"w-full max-w-[var(--container-max-width)] mx-auto px-4\">\n <div className=\"text-center mb-12\">\n <h1 className=\"text-4xl font-bold text-foreground mb-4\">\n {t(\"title\", \"Reset Password\")}\n </h1>\n <div className=\"w-16 h-1 bg-primary mx-auto mb-6\"></div>\n <p className=\"text-lg text-muted-foreground max-w-xl mx-auto\">\n {t(\"subtitle\", \"Enter your new password below\")}\n </p>\n </div>\n\n <div className=\"max-w-md mx-auto\">\n <Card>\n <CardHeader>\n <CardTitle className=\"flex items-center gap-2\">\n <KeyRound className=\"w-5 h-5 text-primary\" />\n {t(\"resetPassword\", \"Reset Password\")}\n </CardTitle>\n <CardDescription>\n {t(\"subtitle\", \"Enter your new password below\")}\n </CardDescription>\n </CardHeader>\n <CardContent>\n <form onSubmit={handleSubmit} className=\"space-y-6\">\n <div>\n <Label htmlFor=\"password\">\n {t(\"newPassword\", \"New Password\")} *\n </Label>\n <div className=\"relative\">\n <Input\n id=\"password\"\n type={showPassword ? \"text\" : \"password\"}\n value={password}\n onChange={(e) => setPassword(e.target.value)}\n placeholder={t(\n \"newPasswordPlaceholder\",\n \"Enter new password\",\n )}\n required\n className=\"mt-1 pr-10\"\n autoComplete=\"new-password\"\n minLength={8}\n disabled={isLoading}\n />\n <button\n type=\"button\"\n onClick={() => setShowPassword(!showPassword)}\n className=\"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground\"\n >\n {showPassword ? (\n <EyeOff className=\"w-4 h-4\" />\n ) : (\n <Eye className=\"w-4 h-4\" />\n )}\n </button>\n </div>\n <p className=\"text-xs text-muted-foreground mt-1\">\n {t(\n \"passwordRequirements\",\n \"At least 8 characters, 1 letter and 1 number\",\n )}\n </p>\n </div>\n\n <div>\n <Label htmlFor=\"confirmPassword\">\n {t(\"confirmPassword\", \"Confirm Password\")} *\n </Label>\n <Input\n id=\"confirmPassword\"\n type={showPassword ? \"text\" : \"password\"}\n value={confirmPassword}\n onChange={(e) => setConfirmPassword(e.target.value)}\n placeholder={t(\n \"confirmPasswordPlaceholder\",\n \"Confirm new password\",\n )}\n required\n className=\"mt-1\"\n autoComplete=\"new-password\"\n minLength={8}\n disabled={isLoading}\n />\n </div>\n\n {error && (\n <div className=\"p-4 bg-red-50 border border-red-200 rounded-lg\">\n <p className=\"text-red-800 text-sm font-medium\">\n {error}\n </p>\n </div>\n )}\n\n <Button\n type=\"submit\"\n size=\"lg\"\n className=\"w-full\"\n disabled={isLoading}\n >\n {isLoading ? (\n <>\n <div className=\"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin mr-2\" />\n {t(\"resetting\", \"Resetting...\")}\n </>\n ) : (\n t(\"resetPassword\", \"Reset Password\")\n )}\n </Button>\n\n <div className=\"text-center\">\n <Link\n to=\"/login\"\n className=\"text-sm text-muted-foreground hover:text-primary inline-flex items-center gap-1\"\n >\n <ArrowLeft className=\"w-4 h-4\" />\n {t(\"backToLogin\", \"Back to Login\")}\n </Link>\n </div>\n </form>\n </CardContent>\n </Card>\n </div>\n </div>\n </div>\n </Layout>\n );\n}\n\nexport default ResetPasswordPage;\n"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
"path": "reset-password-page/lang/en.json",
|
|
30
30
|
"type": "registry:lang",
|
|
31
31
|
"target": "$modules$/reset-password-page/lang/en.json",
|
|
32
|
-
"content": "{\
|
|
32
|
+
"content": "{\n \"title\": \"Reset Password\",\n \"subtitle\": \"Enter your new password below\",\n \"newPassword\": \"New Password\",\n \"newPasswordPlaceholder\": \"Enter new password\",\n \"confirmPassword\": \"Confirm Password\",\n \"confirmPasswordPlaceholder\": \"Confirm new password\",\n \"resetPassword\": \"Reset Password\",\n \"resetting\": \"Resetting...\",\n \"passwordRequirements\": \"At least 8 characters, 1 letter and 1 number\",\n \"passwordMismatch\": \"Passwords do not match\",\n \"invalidLink\": \"Invalid or expired reset link. Please request a new one.\",\n \"passwordResetSuccess\": \"Password reset successfully!\",\n \"resetPasswordError\": \"Failed to reset password. Please try again.\",\n \"passwordReset\": \"Password Reset!\",\n \"passwordResetDescription\": \"Your password has been reset successfully. You can now log in with your new password.\",\n \"goToLogin\": \"Go to Login\",\n \"invalidLinkTitle\": \"Invalid Reset Link\",\n \"invalidLinkDescription\": \"This password reset link is invalid or has expired. Please request a new one.\",\n \"requestNewLink\": \"Request New Link\",\n \"backToLogin\": \"Back to Login\"\n}\n"
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
"path": "reset-password-page/lang/tr.json",
|
|
36
36
|
"type": "registry:lang",
|
|
37
37
|
"target": "$modules$/reset-password-page/lang/tr.json",
|
|
38
|
-
"content": "{\
|
|
38
|
+
"content": "{\n \"title\": \"Şifre Sıfırla\",\n \"subtitle\": \"Yeni şifrenizi aşağıya girin\",\n \"newPassword\": \"Yeni Şifre\",\n \"newPasswordPlaceholder\": \"Yeni şifre girin\",\n \"confirmPassword\": \"Şifreyi Onayla\",\n \"confirmPasswordPlaceholder\": \"Yeni şifreyi onaylayın\",\n \"resetPassword\": \"Şifreyi Sıfırla\",\n \"resetting\": \"Sıfırlanıyor...\",\n \"passwordRequirements\": \"En az 8 karakter, 1 harf ve 1 rakam\",\n \"passwordMismatch\": \"Şifreler eşleşmiyor\",\n \"invalidLink\": \"Geçersiz veya süresi dolmuş sıfırlama bağlantısı. Lütfen yeni bir tane isteyin.\",\n \"passwordResetSuccess\": \"Şifre başarıyla sıfırlandı!\",\n \"resetPasswordError\": \"Şifre sıfırlanamadı. Lütfen tekrar deneyin.\",\n \"passwordReset\": \"Şifre Sıfırlandı!\",\n \"passwordResetDescription\": \"Şifreniz başarıyla sıfırlandı. Artık yeni şifrenizle giriş yapabilirsiniz.\",\n \"goToLogin\": \"Girişe Git\",\n \"invalidLinkTitle\": \"Geçersiz Sıfırlama Bağlantısı\",\n \"invalidLinkDescription\": \"Bu şifre sıfırlama bağlantısı geçersiz veya süresi dolmuş. Lütfen yeni bir tane isteyin.\",\n \"requestNewLink\": \"Yeni Bağlantı İste\",\n \"backToLogin\": \"Girişe Dön\"\n}\n"
|
|
39
39
|
}
|
|
40
40
|
],
|
|
41
41
|
"exports": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"path": "service-card/index.ts",
|
|
11
11
|
"type": "registry:index",
|
|
12
12
|
"target": "$modules$/service-card/index.ts",
|
|
13
|
-
"content": "export * from './service-card';\
|
|
13
|
+
"content": "export * from './service-card';\n"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
"path": "service-card/service-card.tsx",
|
|
@@ -16,25 +16,25 @@
|
|
|
16
16
|
"path": "share-buttons/share-buttons.tsx",
|
|
17
17
|
"type": "registry:component",
|
|
18
18
|
"target": "$modules$/share-buttons/share-buttons.tsx",
|
|
19
|
-
"content": "\"use client\";\
|
|
19
|
+
"content": "\"use client\";\n\nimport { useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { toast } from \"sonner\";\nimport { cn } from \"@/lib/utils\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"@/components/ui/tooltip\";\n\ntype Platform = \"twitter\" | \"facebook\" | \"linkedin\" | \"whatsapp\" | \"email\" | \"copy\";\n\ninterface ShareButtonsProps {\n url?: string;\n title?: string;\n platforms?: Platform[];\n layout?: \"horizontal\" | \"vertical\";\n size?: \"sm\" | \"md\" | \"lg\";\n showLabels?: boolean;\n className?: string;\n}\n\nconst platformConfig: Record<Platform, { icon: React.FC<{ className?: string }>; color: string }> = {\n twitter: {\n icon: ({ className }) => (\n <svg className={className} viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z\" />\n </svg>\n ),\n color: \"hover:bg-black hover:text-white\",\n },\n facebook: {\n icon: ({ className }) => (\n <svg className={className} viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z\" />\n </svg>\n ),\n color: \"hover:bg-[#1877F2] hover:text-white\",\n },\n linkedin: {\n icon: ({ className }) => (\n <svg className={className} viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z\" />\n </svg>\n ),\n color: \"hover:bg-[#0A66C2] hover:text-white\",\n },\n whatsapp: {\n icon: ({ className }) => (\n <svg className={className} viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z\" />\n </svg>\n ),\n color: \"hover:bg-[#25D366] hover:text-white\",\n },\n email: {\n icon: ({ className }) => (\n <svg className={className} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <rect width=\"20\" height=\"16\" x=\"2\" y=\"4\" rx=\"2\" />\n <path d=\"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7\" />\n </svg>\n ),\n color: \"hover:bg-gray-600 hover:text-white\",\n },\n copy: {\n icon: ({ className }) => (\n <svg className={className} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" />\n <path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\" />\n </svg>\n ),\n color: \"hover:bg-gray-600 hover:text-white\",\n },\n};\n\nconst sizeClasses = {\n sm: \"h-8 w-8\",\n md: \"h-10 w-10\",\n lg: \"h-12 w-12\",\n};\n\nconst iconSizeClasses = {\n sm: \"h-4 w-4\",\n md: \"h-5 w-5\",\n lg: \"h-6 w-6\",\n};\n\nexport function ShareButtons({\n url,\n title,\n platforms = [\"twitter\", \"facebook\", \"linkedin\", \"whatsapp\", \"copy\"],\n layout = \"horizontal\",\n size = \"md\",\n showLabels = false,\n className,\n}: ShareButtonsProps) {\n const { t } = useTranslation(\"share-buttons\");\n const [copied, setCopied] = useState(false);\n\n const shareUrl = url || (typeof window !== \"undefined\" ? window.location.href : \"\");\n const shareTitle = title || (typeof document !== \"undefined\" ? document.title : \"\");\n\n const getShareUrl = (platform: Platform): string => {\n const encodedUrl = encodeURIComponent(shareUrl);\n const encodedTitle = encodeURIComponent(shareTitle);\n\n switch (platform) {\n case \"twitter\":\n return `https://twitter.com/intent/tweet?url=${encodedUrl}&text=${encodedTitle}`;\n case \"facebook\":\n return `https://www.facebook.com/sharer/sharer.php?u=${encodedUrl}`;\n case \"linkedin\":\n return `https://www.linkedin.com/sharing/share-offsite/?url=${encodedUrl}`;\n case \"whatsapp\":\n return `https://wa.me/?text=${encodedTitle}%20${encodedUrl}`;\n case \"email\":\n return `mailto:?subject=${encodedTitle}&body=${encodedUrl}`;\n default:\n return \"\";\n }\n };\n\n const handleShare = async (platform: Platform) => {\n if (platform === \"copy\") {\n try {\n await navigator.clipboard.writeText(shareUrl);\n setCopied(true);\n toast.success(t(\"copied\"));\n setTimeout(() => setCopied(false), 2000);\n } catch {\n toast.error(t(\"copyFailed\"));\n }\n return;\n }\n\n const shareUrlForPlatform = getShareUrl(platform);\n if (shareUrlForPlatform) {\n window.open(shareUrlForPlatform, \"_blank\", \"noopener,noreferrer,width=600,height=400\");\n }\n };\n\n return (\n <TooltipProvider>\n <div\n className={cn(\n \"flex gap-2\",\n layout === \"vertical\" ? \"flex-col\" : \"flex-row flex-wrap\",\n className\n )}\n >\n {platforms.map((platform) => {\n const config = platformConfig[platform];\n const Icon = config.icon;\n const label = t(`platforms.${platform}`);\n\n return (\n <Tooltip key={platform}>\n <TooltipTrigger asChild>\n <Button\n variant=\"outline\"\n size=\"icon\"\n className={cn(\n sizeClasses[size],\n \"transition-colors duration-200\",\n config.color,\n platform === \"copy\" && copied && \"bg-green-500 text-white hover:bg-green-500\"\n )}\n onClick={() => handleShare(platform)}\n aria-label={label}\n >\n <Icon className={iconSizeClasses[size]} />\n {showLabels && (\n <span className=\"ml-2 text-sm\">{label}</span>\n )}\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <p>{label}</p>\n </TooltipContent>\n </Tooltip>\n );\n })}\n </div>\n </TooltipProvider>\n );\n}\n"
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"path": "share-buttons/index.ts",
|
|
23
23
|
"type": "registry:index",
|
|
24
24
|
"target": "$modules$/share-buttons/index.ts",
|
|
25
|
-
"content": "export * from \"./share-buttons\";\
|
|
25
|
+
"content": "export * from \"./share-buttons\";\n"
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
"path": "share-buttons/lang/en.json",
|
|
29
29
|
"type": "registry:lang",
|
|
30
30
|
"target": "$modules$/share-buttons/lang/en.json",
|
|
31
|
-
"content": "{\
|
|
31
|
+
"content": "{\n \"copied\": \"Link copied to clipboard!\",\n \"copyFailed\": \"Failed to copy link\",\n \"platforms\": {\n \"twitter\": \"Share on X\",\n \"facebook\": \"Share on Facebook\",\n \"linkedin\": \"Share on LinkedIn\",\n \"whatsapp\": \"Share on WhatsApp\",\n \"email\": \"Share via Email\",\n \"copy\": \"Copy link\"\n }\n}\n"
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
"path": "share-buttons/lang/tr.json",
|
|
35
35
|
"type": "registry:lang",
|
|
36
36
|
"target": "$modules$/share-buttons/lang/tr.json",
|
|
37
|
-
"content": "{\
|
|
37
|
+
"content": "{\n \"copied\": \"Link panoya kopyalandı!\",\n \"copyFailed\": \"Link kopyalanamadı\",\n \"platforms\": {\n \"twitter\": \"X'te Paylaş\",\n \"facebook\": \"Facebook'ta Paylaş\",\n \"linkedin\": \"LinkedIn'de Paylaş\",\n \"whatsapp\": \"WhatsApp'ta Paylaş\",\n \"email\": \"E-posta ile Paylaş\",\n \"copy\": \"Linki Kopyala\"\n }\n}\n"
|
|
38
38
|
}
|
|
39
39
|
],
|
|
40
40
|
"exports": {
|