From 45ac17037936af5ab42a3386ffecdd55f229de4b Mon Sep 17 00:00:00 2001 From: Ayush Gupta Date: Thu, 5 Oct 2023 15:44:24 +0530 Subject: [PATCH 1/2] Modify login buttons --- src/pages/sign-in.tsx | 18 +++++++++++++----- src/utils/getIcon.ts | 10 ++++++++++ 2 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 src/utils/getIcon.ts diff --git a/src/pages/sign-in.tsx b/src/pages/sign-in.tsx index 3aecd91e..67db1563 100644 --- a/src/pages/sign-in.tsx +++ b/src/pages/sign-in.tsx @@ -8,6 +8,7 @@ import { getProviders, signIn } from "next-auth/react"; import { getServerSession } from "next-auth"; import { authOptions } from "~/server/auth"; import Link from "next/link"; +import getIcon from "~/utils/getIcon"; const SignIn = ({ providers, @@ -25,14 +26,14 @@ const SignIn = ({
- + {/* Sign in with - -
+ */} +
{Object.values(providers).map((provider) => ( ))} diff --git a/src/utils/getIcon.ts b/src/utils/getIcon.ts new file mode 100644 index 00000000..6c63b871 --- /dev/null +++ b/src/utils/getIcon.ts @@ -0,0 +1,10 @@ +const icons: { [key: string]: string } = { + Google: + "https://www.svgrepo.com/show/475656/google-color.svg", + GitHub: + "https://www.svgrepo.com/show/512317/github-142.svg" +}; + +export default function getIcon(iconName: string) { + return icons[iconName]; +} From 25a74575e5549f324b895a80d6f9090de4a49eea Mon Sep 17 00:00:00 2001 From: Ayush Gupta Date: Sun, 8 Oct 2023 12:17:00 +0530 Subject: [PATCH 2/2] Add buttons to assets --- src/assets/Github button icon.svg | 19 +++++++++++++++++++ src/assets/Google button icon.svg | 27 +++++++++++++++++++++++++++ src/pages/sign-in.tsx | 9 ++++++--- src/utils/getIcon.ts | 13 +++++++------ 4 files changed, 59 insertions(+), 9 deletions(-) create mode 100644 src/assets/Github button icon.svg create mode 100644 src/assets/Google button icon.svg diff --git a/src/assets/Github button icon.svg b/src/assets/Github button icon.svg new file mode 100644 index 00000000..dce1c59d --- /dev/null +++ b/src/assets/Github button icon.svg @@ -0,0 +1,19 @@ + + + + + github [#142] + Created with Sketch. + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/Google button icon.svg b/src/assets/Google button icon.svg new file mode 100644 index 00000000..56cb5e20 --- /dev/null +++ b/src/assets/Google button icon.svg @@ -0,0 +1,27 @@ + + + + Google-color + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/pages/sign-in.tsx b/src/pages/sign-in.tsx index 67db1563..da2b0631 100644 --- a/src/pages/sign-in.tsx +++ b/src/pages/sign-in.tsx @@ -9,6 +9,8 @@ import { getServerSession } from "next-auth"; import { authOptions } from "~/server/auth"; import Link from "next/link"; import getIcon from "~/utils/getIcon"; +import Image from "next/image"; + const SignIn = ({ providers, @@ -33,7 +35,7 @@ const SignIn = ({ {Object.values(providers).map((provider) => (