From 41e6816db3b7026dfe06358eeca058fb7f5afcc4 Mon Sep 17 00:00:00 2001 From: Melnik George Date: Sun, 1 Dec 2024 18:46:59 +0300 Subject: [PATCH] Added signin/signup pages --- .../src/app/components/Input/Input.tsx | 38 +++++ landing_page/src/app/components/NavBar.tsx | 9 +- .../src/app/components/Select/Select.tsx | 159 ++++++++++++++++++ landing_page/src/app/globals.css | 3 +- landing_page/src/app/lib/utils/index.ts | 6 + landing_page/src/app/signin/page.tsx | 58 +++++++ landing_page/src/app/signup/page.tsx | 84 +++++++++ 7 files changed, 351 insertions(+), 6 deletions(-) create mode 100644 landing_page/src/app/components/Input/Input.tsx create mode 100644 landing_page/src/app/components/Select/Select.tsx create mode 100644 landing_page/src/app/lib/utils/index.ts create mode 100644 landing_page/src/app/signin/page.tsx create mode 100644 landing_page/src/app/signup/page.tsx diff --git a/landing_page/src/app/components/Input/Input.tsx b/landing_page/src/app/components/Input/Input.tsx new file mode 100644 index 00000000..bd743e7b --- /dev/null +++ b/landing_page/src/app/components/Input/Input.tsx @@ -0,0 +1,38 @@ +import React from 'react'; + +interface InputProps extends React.InputHTMLAttributes { + label?: string; + error?: string; + rightElement?: React.ReactNode; +} + +export const Input = React.forwardRef( + ({ label, error, rightElement, className = '', ...props }, ref) => { + return ( +
+ {label && ( + + )} +
+ + {rightElement && ( +
+ {rightElement} +
+ )} +
+ {error &&

{error}

} +
+ ); + } +); + +Input.displayName = 'Input'; diff --git a/landing_page/src/app/components/NavBar.tsx b/landing_page/src/app/components/NavBar.tsx index 7a0af43e..dd6ecb07 100644 --- a/landing_page/src/app/components/NavBar.tsx +++ b/landing_page/src/app/components/NavBar.tsx @@ -3,7 +3,6 @@ import React, { useState } from "react"; import Image from "next/image"; import Link from "next/link"; import { Menu, X } from "lucide-react"; -import Button from "./Button/Button"; const NavBar = () => { const [isMenuOpen, setIsMenuOpen] = useState(false); @@ -33,12 +32,12 @@ const NavBar = () => {
Login - + Sign Up
@@ -78,14 +77,14 @@ const NavBar = () => {
setIsMenuOpen(false)} > Login
- + Sign Up
diff --git a/landing_page/src/app/components/Select/Select.tsx b/landing_page/src/app/components/Select/Select.tsx new file mode 100644 index 00000000..850e6ca7 --- /dev/null +++ b/landing_page/src/app/components/Select/Select.tsx @@ -0,0 +1,159 @@ +"use client" + +import * as React from "react" +import * as SelectPrimitive from "@radix-ui/react-select" +import { Check, ChevronDown, ChevronUp } from "lucide-react" + +import { cn } from "../../lib/utils" + +const Select = SelectPrimitive.Root + +const SelectGroup = SelectPrimitive.Group + +const SelectValue = SelectPrimitive.Value + +const SelectTrigger = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + span]:line-clamp-1 disabled:cursor-not-allowed disabled:opacity-50 bg-white data-[placeholder]:text-[#797979]", + className + )} + {...props} + > + {children} + + + + +)) +SelectTrigger.displayName = SelectPrimitive.Trigger.displayName + +const SelectScrollUpButton = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + + + +)) +SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName + +const SelectScrollDownButton = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + + + +)) +SelectScrollDownButton.displayName = + SelectPrimitive.ScrollDownButton.displayName + +const SelectContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, position = "popper", ...props }, ref) => ( + + + + + {children} + + + + +)) +SelectContent.displayName = SelectPrimitive.Content.displayName + +const SelectLabel = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +SelectLabel.displayName = SelectPrimitive.Label.displayName + +const SelectItem = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + + + + + + + {children} + +)) +SelectItem.displayName = SelectPrimitive.Item.displayName + +const SelectSeparator = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +SelectSeparator.displayName = SelectPrimitive.Separator.displayName + +export { + Select, + SelectGroup, + SelectValue, + SelectTrigger, + SelectContent, + SelectLabel, + SelectItem, + SelectSeparator, + SelectScrollUpButton, + SelectScrollDownButton, +} diff --git a/landing_page/src/app/globals.css b/landing_page/src/app/globals.css index defeae86..bc31d736 100644 --- a/landing_page/src/app/globals.css +++ b/landing_page/src/app/globals.css @@ -27,4 +27,5 @@ body { } *{ @apply transition-colors duration-200 -} \ No newline at end of file +} + diff --git a/landing_page/src/app/lib/utils/index.ts b/landing_page/src/app/lib/utils/index.ts new file mode 100644 index 00000000..18f72e02 --- /dev/null +++ b/landing_page/src/app/lib/utils/index.ts @@ -0,0 +1,6 @@ +import { type ClassValue, clsx } from 'clsx'; +import { twMerge } from 'tailwind-merge'; + +export function cn(...inputs: ClassValue[]) { + return twMerge(clsx(inputs)); +} \ No newline at end of file diff --git a/landing_page/src/app/signin/page.tsx b/landing_page/src/app/signin/page.tsx new file mode 100644 index 00000000..49694ceb --- /dev/null +++ b/landing_page/src/app/signin/page.tsx @@ -0,0 +1,58 @@ +'use client'; + +import { useState } from 'react'; +import Button from '../components/Button/Button'; +import { Input } from '../components/Input/Input'; + +export default function LoginPage() { + const [showPassword, setShowPassword] = useState(false); + + return ( +
+
+
+

Sign in

+

+ Hey, Enter your details to login to your account +

+
+ +
+ + + setShowPassword(!showPassword)} + className="" + > + {showPassword? 'Hide' : 'Show'} + + } + /> + + +
+ Don't have an account yet? + + Register now! + +
+ + +
+
+
+ ) +} diff --git a/landing_page/src/app/signup/page.tsx b/landing_page/src/app/signup/page.tsx new file mode 100644 index 00000000..be0b0a36 --- /dev/null +++ b/landing_page/src/app/signup/page.tsx @@ -0,0 +1,84 @@ +'use client'; + +import { useState } from 'react'; +import Button from '../components/Button/Button'; +import { Input } from '../components/Input/Input'; +import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from '../components/Select/Select'; + +export default function SignupPage() { + const [showPassword, setShowPassword] = useState(false); + const [showConfirmPassword, setShowConfirmPassword] = useState(false); + + return ( +
+
+
+

Let's set up

+

+ Hey, Enter your details to login to your account +

+
+ +
+ + + setShowPassword(!showPassword)} + className="" + > + {showPassword? 'Hide' : 'Show'} + + } + /> + + setShowConfirmPassword(!showConfirmPassword)} + className="" + > + {showConfirmPassword? 'Hide' : 'Show'} + + } + /> + + +
+ Already have an account? + + Sing in! + +
+ + +
+
+
+ ) +}