Skip to content

Commit

Permalink
use isSocialLogin instead of isMagicConnection
Browse files Browse the repository at this point in the history
  • Loading branch information
kuruk-mm committed Nov 20, 2024
1 parent 4155925 commit b244cbd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/components/Connection/Connection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import {
ConnectionProps,
MetamaskEthereumWindow,
connectionOptionTitles,
isMagicConnection
} from './Connection.types'
import styles from './Connection.module.css'
import { isSocialLogin } from '../Pages/LoginPage/utils'

const Primary = ({
message,
Expand Down Expand Up @@ -113,7 +113,7 @@ export const Connection = (props: ConnectionProps): JSX.Element => {
: undefined
}
message={
isMagicConnection(option) ? (
isSocialLogin(option) ? (
<>
{i18n.socialMessage(<div className={styles.primaryMagic} role="img" aria-label="Magic" />)}
<span className={styles.primaryLearnMore} role="button" onClick={() => onLearnMore(option)}>
Expand All @@ -129,7 +129,7 @@ export const Connection = (props: ConnectionProps): JSX.Element => {
)
}
>
<>{isMagicConnection(option) ? i18n.accessWith(option) : i18n.connectWith(option)}</>
<>{isSocialLogin(option) ? i18n.accessWith(option) : i18n.connectWith(option)}</>
</Primary>
)

Expand Down
9 changes: 0 additions & 9 deletions src/components/Connection/Connection.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@ export const connectionOptionTitles: { [key in ConnectionOptionType]: string } =
[ConnectionOptionType.X]: 'X'
}

export function isMagicConnection(option: ConnectionOptionType): boolean {
return (
option === ConnectionOptionType.X ||
option === ConnectionOptionType.APPLE ||
option === ConnectionOptionType.GOOGLE ||
option === ConnectionOptionType.DISCORD
)
}

export type MetamaskEthereumWindow = typeof window.ethereum & { isMetaMask?: boolean }

export type ConnectionI18N = {
Expand Down

0 comments on commit b244cbd

Please sign in to comment.