refactor: github and google button

feat/preact-migrate
Arik Chakma 2 years ago
parent 351e1e4509
commit 1d9cb45733
  1. 27
      src/components/Login/LoginComponent.tsx

@ -4,12 +4,8 @@ export default function LoginComponent() {
return ( return (
<div className="space-y-5"> <div className="space-y-5">
<div className="space-y-2"> <div className="space-y-2">
<Button className="bg-[#333] text-white focus:ring-[#333]"> <GithubLoginButton />
Login with Github <GoogleLoginButton />
</Button>
<Button className="bg-[#4285f4] text-white focus:ring-[#4285f4]">
Login with Google
</Button>
</div> </div>
<div className="h-px w-full bg-slate-200" /> <div className="h-px w-full bg-slate-200" />
@ -23,15 +19,22 @@ export default function LoginComponent() {
); );
} }
const Button: FunctionComponent<{ className?: string }> = ({ export const GithubLoginButton: FunctionComponent<{ className?: string }> = ({
children,
className, className,
}) => { }) => {
return ( return (
<button <button className="inline-flex h-10 w-full bg-[#333] text-white focus:ring-[#333] items-center justify-center rounded border border-slate-300 p-2 text-sm font-medium outline-none transition duration-150 ease-in-out focus:ring-2 disabled:opacity-60 focus:ring-offset-1">
className={`inline-flex h-10 w-full items-center justify-center rounded border border-slate-300 p-2 text-sm font-medium outline-none transition duration-150 ease-in-out focus:ring-2 disabled:opacity-60 focus:ring-offset-1 ${className}`} Login with Github
> </button>
{children} );
};
export const GoogleLoginButton: FunctionComponent<{ className?: string }> = ({
className,
}) => {
return (
<button className="inline-flex h-10 w-full bg-[#4285f4] text-white focus:ring-[#4285f4] items-center justify-center rounded border border-slate-300 p-2 text-sm font-medium outline-none transition duration-150 ease-in-out focus:ring-2 disabled:opacity-60 focus:ring-offset-1">
Login with Google
</button> </button>
); );
}; };

Loading…
Cancel
Save