-
-
Notifications
You must be signed in to change notification settings - Fork 772
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Innei <[email protected]>
- Loading branch information
Showing
9 changed files
with
131 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { SVGProps } from 'react' | ||
|
||
export function AppleIcon(props: SVGProps<SVGSVGElement>) { | ||
return ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="1em" | ||
height="1em" | ||
viewBox="0 0 24 24" | ||
{...props} | ||
> | ||
<path | ||
className="fill-black dark:fill-white" | ||
d="M17.05 20.28c-.98.95-2.05.8-3.08.35c-1.09-.46-2.09-.48-3.24 0c-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8c1.18-.24 2.31-.93 3.57-.84c1.51.12 2.65.72 3.4 1.8c-3.12 1.87-2.38 5.98.48 7.13c-.57 1.5-1.31 2.99-2.54 4.09l.01-.01zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25c.29 2.58-2.34 4.5-3.74 4.25z" | ||
/> | ||
</svg> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import type { SVGProps } from 'react' | ||
|
||
export function LogosFacebook(props: SVGProps<SVGSVGElement>) { | ||
return ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="1em" | ||
height="1em" | ||
viewBox="0 0 256 256" | ||
{...props} | ||
> | ||
<path | ||
fill="#1877F2" | ||
d="M256 128C256 57.308 198.692 0 128 0C57.308 0 0 57.308 0 128c0 63.888 46.808 116.843 108 126.445V165H75.5v-37H108V99.8c0-32.08 19.11-49.8 48.348-49.8C170.352 50 185 52.5 185 52.5V84h-16.14C152.959 84 148 93.867 148 103.99V128h35.5l-5.675 37H148v89.445c61.192-9.602 108-62.556 108-126.445" | ||
/> | ||
<path | ||
fill="#FFF" | ||
d="m177.825 165l5.675-37H148v-24.01C148 93.866 152.959 84 168.86 84H185V52.5S170.352 50 156.347 50C127.11 50 108 67.72 108 99.8V128H75.5v37H108v89.445A128.959 128.959 0 0 0 128 256a128.9 128.9 0 0 0 20-1.555V165h29.825" | ||
/> | ||
</svg> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { SVGProps } from 'react' | ||
|
||
export function LogosMicrosoftIcon(props: SVGProps<SVGSVGElement>) { | ||
return ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="1em" | ||
height="1em" | ||
viewBox="0 0 256 256" | ||
{...props} | ||
> | ||
<path fill="#F1511B" d="M121.666 121.666H0V0h121.666z" /> | ||
<path fill="#80CC28" d="M256 121.666H134.335V0H256z" /> | ||
<path fill="#00ADEF" d="M121.663 256.002H0V134.336h121.663z" /> | ||
<path fill="#FBBC09" d="M256 256.002H134.335V134.336H256z" /> | ||
</svg> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import type { FC } from 'react' | ||
|
||
import { AppleIcon } from '~/components/icons/platform/AppleIcon' | ||
import { LogosFacebook } from '~/components/icons/platform/FacebookIcon' | ||
import { GitHubBrandIcon } from '~/components/icons/platform/GitHubBrandIcon' | ||
import { GoogleBrandIcon } from '~/components/icons/platform/GoogleBrandIcon' | ||
import { LogosMicrosoftIcon } from '~/components/icons/platform/MicrosoftIcon' | ||
import { TwitterIcon } from '~/components/icons/platform/Twitter' | ||
|
||
export const UserAuthStrategyIcon: FC<{ | ||
strategy: string | ||
className?: string | ||
}> = ({ strategy, className }) => { | ||
const Icon = getStrategyIconComponent(strategy) | ||
|
||
if (!strategy) { | ||
return null | ||
} | ||
|
||
if (!Icon) return null | ||
return <Icon className={className} /> | ||
} | ||
|
||
export const getStrategyIconComponent = (strategy: string) => { | ||
switch (strategy) { | ||
case 'from_oauth_github': | ||
return GitHubBrandIcon | ||
case 'from_oauth_google': | ||
return GoogleBrandIcon | ||
case 'from_oauth_apple': | ||
return AppleIcon | ||
case 'from_oauth_microsoft': | ||
return LogosMicrosoftIcon | ||
case 'from_oauth_facebook': | ||
return LogosFacebook | ||
case 'from_oauth_twitter': | ||
return TwitterIcon | ||
default: | ||
return null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28e71b4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
shiro – ./
shiro-innei.vercel.app
innei.in
springtide.vercel.app
shiro-git-main-innei.vercel.app