Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update auth pages ver 1.0.0 #4

Merged
merged 4 commits into from
Jul 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/ghost.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 2 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" href="/assets/icon.ico" type="image/x-icon">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<title>Blog App</title>
<link rel="shortcut icon" href="/assets/ghost.png" type="image/x-icon">
<title>Welcome to Blog</title>
</head>
<body>
<div id="root"></div>
Expand Down
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,21 @@
"react-markdown": "^8.0.3",
"react-router-dom": "^6.3.0",
"react-toastify": "^9.0.5",
"remark-align": "^1.2.14",
"remark-gfm": "^3.0.1",
"remark-utf8": "^1.1.0",
"yup": "^0.32.11"
},
"devDependencies": {
"@types/node": "^18.0.3",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@vitejs/plugin-react": "^1.3.0",
"autoprefixer": "^10.4.7",
"postcss": "^8.4.14",
"prettier": "^2.7.1",
"sass": "^1.53.0",
"tailwindcss": "^3.1.6",
"typescript": "^4.6.3",
"vite": "^2.9.9"
}
Expand Down
6 changes: 6 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
14 changes: 0 additions & 14 deletions src/App.tsx

This file was deleted.

22 changes: 22 additions & 0 deletions src/components/button/Button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React, { ReactNode } from "react";

interface IProps {
type: "button" | "submit" | "reset" | undefined;
children: ReactNode;
disabled?: boolean;
className?: string;
}

const Button = ({ type, children, disabled, className = "" }: IProps) => {
return (
<button
className={`text-white font-semibold text-[16px] w-full py-[13px] bg-[#1DC071] rounded-lg shadow-md ${className}`}
type={type}
disabled={disabled}
>
{children}
</button>
);
};

export default Button;
11 changes: 0 additions & 11 deletions src/components/error/ErrorInput.tsx

This file was deleted.

13 changes: 13 additions & 0 deletions src/components/errors/ErrorInput.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React, { ReactNode } from "react";

interface IProps {
children: ReactNode;
}

const ErrorInput = ({ children }: IProps) => {
return (
<span className="text-red-500 text-[14px] font-medium">{children}</span>
);
};

export default ErrorInput;
11 changes: 11 additions & 0 deletions src/components/field/Field.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React, { ReactNode } from "react";

interface IProps {
children: ReactNode;
}

const Field = ({ children }: IProps) => {
return <div className="flex flex-col gap-y-[10px]">{children}</div>;
};

export default Field;
19 changes: 19 additions & 0 deletions src/components/heading/Heading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { ReactNode } from "react";

interface IProps {
content: string;
children: ReactNode;
}

const Heading = ({ content, children }: IProps) => {
return (
<div className="flex flex-col gap-y-[5px] lg:gap-y-[10px] text-center">
<h1 className="font-semibold text-[18px] lg:text-[20px] text-white">
{content}
</h1>
{children}
</div>
);
};

export default Heading;
21 changes: 21 additions & 0 deletions src/components/heading/SubHeading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from "react";
import { NavLink } from "react-router-dom";

interface IProps {
content: string;
hrefText: string;
to: string;
}

const SubHeading = ({ content, to, hrefText }: IProps) => {
return (
<p className="text-[#808191] text-[14px]">
{content}{" "}
<span className="text-[#1DC071] font-medium underline">
<NavLink to={to}>{hrefText}</NavLink>
</span>
</p>
);
};

export default SubHeading;
20 changes: 0 additions & 20 deletions src/components/icons/IconMenu.tsx

This file was deleted.

24 changes: 8 additions & 16 deletions src/components/input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,24 @@ import React from "react";
import { Control, useController } from "react-hook-form";

interface IProps {
name: string;
type: string;
placeholder: string;
control: Control;
className: string;
defaultValue?: string;
name: string;
placeholder?: string;
}

const Input = ({
control,
type,
placeholder,
name,
className,
defaultValue,
}: IProps) => {
const Input = ({ type, control, name, placeholder }: IProps) => {
const { field } = useController({
control,
name,
defaultValue: defaultValue,
control: control,
name: name,
defaultValue: "",
});

return (
<input
id={name}
type={type}
className={className}
className="border border-[#3A3A43] rounded-md w-full p-[15px] shadow outline-none text-white font-medium text-[14px] placeholder:text-[#4B5264] bg-transparent"
placeholder={placeholder}
{...field}
/>
Expand Down
11 changes: 5 additions & 6 deletions src/components/label/Label.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import React, { ReactNode } from "react";
import React from "react";

interface IProps {
text: string;
htmlFor: string;
children: ReactNode;
className: string;
}

const Label = ({ htmlFor, children, className }: IProps) => {
const Label = ({ text, htmlFor }: IProps) => {
return (
<label className={className} htmlFor={htmlFor}>
{children}
<label htmlFor={htmlFor} className="text-[#808191] font-medium text-[14px]">
{text}
</label>
);
};
Expand Down
24 changes: 24 additions & 0 deletions src/components/layouts/AuthLayout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React, { ReactNode } from "react";
import logo from "../../../assets/ghost.png";
import { NavLink } from "react-router-dom";

interface IProps {
children: ReactNode;
}

const AuthLayout = ({ children }: IProps) => {
return (
<div className="block p-6 lg-[40px] relative w-full h-screen flex items-center justify-center">
<NavLink to={"/"}>
<img
className="absolute w-10 lg:w-[56px] h-10 lg:h-[56px] object-cover top-10 left-10"
src={logo}
alt="logo blog"
/>
</NavLink>
{children}
</div>
);
};

export default AuthLayout;
5 changes: 2 additions & 3 deletions src/components/layouts/CommonLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ import React, { ReactNode } from "react";
import Header from "./Header";

interface IProps {
children?: ReactNode;
children: ReactNode;
}

const CommonLayout = ({ children }: IProps) => {
return (
<div className="container">
<div className="px-6 py-[26px] lg:p-10 flex flex-col gap-y-5 lg:gap-y-[30px] text-white">
<Header />
{children}
<footer className="footer"></footer>
</div>
);
};
Expand Down
Loading