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.

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