♻️ create dinamic 3rd auth provider
This commit is contained in:
@ -3,25 +3,40 @@ import { Icon } from "@iconify/react";
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
const ContinueWithProviders = () => {
|
const ContinueWithProviders = () => {
|
||||||
|
// set to true if there are other providers coming soon
|
||||||
|
const comingSoonProviders: boolean = true;
|
||||||
|
|
||||||
|
// Provider for third-party auth
|
||||||
|
const oAuthProviders = [
|
||||||
|
{
|
||||||
|
name: "Google",
|
||||||
|
icon: "logos:google-icon",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Discord",
|
||||||
|
icon: "logos:discord-icon",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="w-full flex flex-col gap-2 mt-4">
|
<div className="w-full flex flex-col gap-2 mt-4">
|
||||||
|
{oAuthProviders.map((provider) => {
|
||||||
|
return (
|
||||||
<Button
|
<Button
|
||||||
className="w-full hover:bg-neutral-800"
|
className="w-full hover:bg-neutral-800"
|
||||||
variant="bordered"
|
variant="bordered"
|
||||||
startContent={<Icon icon="logos:google-icon" />}
|
startContent={<Icon icon={provider.icon} />}
|
||||||
>
|
>
|
||||||
Continue with Google
|
Continue with {provider.name}
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
className="w-full hover:bg-neutral-800"
|
|
||||||
variant="bordered"
|
|
||||||
startContent={<Icon icon="logos:discord-icon" />}
|
|
||||||
>
|
|
||||||
Continue with Discord
|
|
||||||
</Button>
|
</Button>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
|
||||||
|
{comingSoonProviders && (
|
||||||
<Button className="w-full" variant="ghost" isDisabled>
|
<Button className="w-full" variant="ghost" isDisabled>
|
||||||
Other login options will come soon
|
Other login options will come soon
|
||||||
</Button>
|
</Button>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user