You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

page.tsx 5.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. "use client";
  2. /* eslint-disable @typescript-eslint/no-explicit-any */
  3. import {
  4. Button,
  5. Checkbox,
  6. Form,
  7. Input,
  8. Typography,
  9. Flex,
  10. Row,
  11. Col,
  12. message,
  13. } from "antd";
  14. import Image from "next/image";
  15. import React from "react";
  16. const { Title, Text, Link } = Typography;
  17. const LoginPage: React.FC = () => {
  18. const [form] = Form.useForm();
  19. const onFinish = (values: any) => {
  20. console.log("✅ Success:", values);
  21. message.success("Logged in successfully (dummy handler)");
  22. window.location.href = "/user"
  23. };
  24. const onFinishFailed = (errorInfo: any) => {
  25. console.log("❌ Failed:", errorInfo);
  26. message.error("Please check your input.");
  27. };
  28. return (
  29. <Row>
  30. <Col span={24}>
  31. {/* Logo on Top */}
  32. <Flex justify="center" align="center" gap={10} className="!mb-6">
  33. <Image
  34. src="/ruccan_logo2.png"
  35. alt="Ruccan Logo"
  36. height={40}
  37. width={40}
  38. className="object-contain"
  39. />
  40. <Title level={3} className="!font-bold !m-0">
  41. Ruccan.com
  42. </Title>
  43. </Flex>
  44. <Row style={{ width: "100%" }} justify="center">
  45. <Col span={24} className="!px-5">
  46. <Flex vertical className="!bg-white !p-8 !rounded-2xl !shadow-xl !min-w-[360px]">
  47. {/* Title */}
  48. <Flex vertical align="center" className="!mb-8 !text-center">
  49. <Title
  50. level={2}
  51. className="!mb-2 !text-transparent !font-bold !bg-clip-text bg-gradient-to-r from-blue-500 to-pink-500"
  52. >
  53. Get started now
  54. </Title>
  55. <Text type="secondary" className="!text-xs">
  56. Create an account or log in to explore our app
  57. </Text>
  58. </Flex>
  59. {/* Social Buttons */}
  60. <Flex vertical gap="middle" className="mb-6">
  61. <Button
  62. block
  63. className="!bg-white !text-black !border !border-gray-300 hover:!border-blue-400"
  64. icon={
  65. <Image
  66. src="/google_logo.png"
  67. alt="Google"
  68. width={18}
  69. height={18}
  70. />
  71. }
  72. >
  73. Sign in with Google
  74. </Button>
  75. <Button
  76. block
  77. className="!bg-white !text-black !border !border-gray-300 hover:!border-blue-600"
  78. icon={
  79. <Image
  80. src="/facebook_icon.svg"
  81. alt="Facebook"
  82. width={18}
  83. height={18}
  84. />
  85. }
  86. >
  87. Sign in with Facebook
  88. </Button>
  89. </Flex>
  90. {/* Divider */}
  91. <Row align="middle" className="!my-2">
  92. <Col flex="auto">
  93. <div className="!border-t !border-gray-300 !w-full" />
  94. </Col>
  95. <Col>
  96. <Text type="secondary" className="!px-4 !text-sm">
  97. OR
  98. </Text>
  99. </Col>
  100. <Col flex="auto">
  101. <div className="!border-t !border-gray-300 !w-full" />
  102. </Col>
  103. </Row>
  104. {/* Login Form */}
  105. <Form
  106. form={form}
  107. layout="vertical"
  108. onFinish={onFinish}
  109. onFinishFailed={onFinishFailed}
  110. autoComplete="off"
  111. initialValues={{ remember: true }}
  112. >
  113. <Form.Item
  114. label="Email"
  115. name="email"
  116. rules={[
  117. { required: true, message: "Please input your email!" },
  118. { type: "email", message: "Invalid email format" },
  119. ]}
  120. >
  121. <Input placeholder="Enter your email" />
  122. </Form.Item>
  123. <Form.Item
  124. label="Password"
  125. name="password"
  126. rules={[{ required: true, message: "Please input your password!" }]}
  127. >
  128. <Input.Password placeholder="Enter your password" />
  129. </Form.Item>
  130. <Flex justify="space-between" wrap align="center" className="!mb-4">
  131. <Form.Item name="remember" valuePropName="checked" noStyle>
  132. <Checkbox>Remember me</Checkbox>
  133. </Form.Item>
  134. <Link href="#" className="!text-blue-500">
  135. Forgot password?
  136. </Link>
  137. </Flex>
  138. <Form.Item>
  139. <Button type="primary" htmlType="submit" block>
  140. Log In
  141. </Button>
  142. </Form.Item>
  143. </Form>
  144. {/* Sign Up */}
  145. <Flex justify="center" className="!mt-6">
  146. <Text>
  147. Don’t have an account?{" "}
  148. <Link href="/guest/signup" className="!text-blue-500">
  149. Sign Up
  150. </Link>
  151. </Text>
  152. </Flex>
  153. </Flex>
  154. </Col>
  155. </Row>
  156. </Col>
  157. </Row>
  158. );
  159. };
  160. export default LoginPage;