Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
631 additions
and
484 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,4 @@ | ||
export * from './masa-interface'; | ||
export * from './masa-loading'; | ||
export * from './modal'; | ||
export * from './spinner'; |
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 @@ | ||
export * from './masa-interface'; |
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
53 changes: 53 additions & 0 deletions
53
src/common/components/masa-interface/pages/authenticate/authenticate.tsx
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,53 @@ | ||
import React, { useMemo } from 'react'; | ||
import { useMasa } from '../../../../helpers/provider/use-masa'; | ||
import { Spinner } from '../../../spinner'; | ||
|
||
export const InterfaceAuthenticate = (): JSX.Element => { | ||
const { handleLogin, walletAddress, identity, loading } = useMasa(); | ||
|
||
const hasIdentity = useMemo(() => { | ||
return identity && identity?.identityId; | ||
}, [identity]); | ||
const shortAddress = useMemo(() => { | ||
return `${walletAddress?.substring(0, 2)}...${walletAddress?.substring( | ||
walletAddress.length - 4, | ||
walletAddress.length - 1 | ||
)}`; | ||
}, [walletAddress]); | ||
|
||
if (loading) { | ||
return <Spinner />; | ||
} | ||
return ( | ||
<div className="interface-authenticate"> | ||
<div> | ||
<h3 className="title">Wallet connected!</h3> | ||
<p className="connected-wallet"> | ||
Your wallet is connected you can now create an account by minting a | ||
Masa Soulbound Identity and Masa Soulname! | ||
</p> | ||
|
||
<p className="connected-wallet with-wallet"> | ||
You are connected with the following wallet | ||
<span>{shortAddress}</span> | ||
</p> | ||
</div> | ||
<div> | ||
<button | ||
className="masa-button authenticate-button" | ||
onClick={handleLogin} | ||
> | ||
{loading ? 'loading...' : hasIdentity ? 'Sign in' : 'Register'} | ||
</button> | ||
<div className="dont-have-a-wallet"> | ||
<a> | ||
<p> | ||
Want to use a different wallet? Close this window and disconnect | ||
your wallet in Metamask to connect a new wallet | ||
</p> | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; |
54 changes: 1 addition & 53 deletions
54
src/common/components/masa-interface/pages/authenticate/index.tsx
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 |
---|---|---|
@@ -1,53 +1 @@ | ||
import React, { useMemo } from 'react'; | ||
import { useMasa } from '../../../../helpers/provider/use-masa'; | ||
import { Spinner } from '../../../spinner'; | ||
|
||
export const InterfaceAuthenticate = () => { | ||
const { handleLogin, walletAddress, identity, loading } = useMasa(); | ||
|
||
const hasIdentity = useMemo(() => { | ||
return identity && identity?.identityId; | ||
}, [identity]); | ||
const shortAddress = useMemo(() => { | ||
return `${walletAddress?.substring(0, 2)}...${walletAddress?.substring( | ||
walletAddress.length - 4, | ||
walletAddress.length - 1 | ||
)}`; | ||
}, [walletAddress]); | ||
|
||
if (loading) { | ||
return <Spinner />; | ||
} | ||
return ( | ||
<div className="interface-authenticate"> | ||
<div> | ||
<h3 className="title">Wallet connected!</h3> | ||
<p className="connected-wallet"> | ||
Your wallet is connected you can now create an account by minting a | ||
Masa Soulbound Identity and Masa Soulname! | ||
</p> | ||
|
||
<p className="connected-wallet with-wallet"> | ||
You are connected with the following wallet | ||
<span>{shortAddress}</span> | ||
</p> | ||
</div> | ||
<div> | ||
<button | ||
className="masa-button authenticate-button" | ||
onClick={handleLogin} | ||
> | ||
{loading ? 'loading...' : hasIdentity ? 'Sign in' : 'Register'} | ||
</button> | ||
<div className="dont-have-a-wallet"> | ||
<a> | ||
<p> | ||
Want to use a different wallet? Close this window and disconnect | ||
your wallet in Metamask to connect a new wallet | ||
</p> | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
export { InterfaceAuthenticate } from './authenticate'; |
27 changes: 27 additions & 0 deletions
27
src/common/components/masa-interface/pages/connected/connected.tsx
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,27 @@ | ||
import React, { useEffect } from 'react'; | ||
import { useMasa } from '../../../../helpers/provider/use-masa'; | ||
import { MasaLoading } from '../../../masa-loading'; | ||
import { Spinner } from '../../../spinner'; | ||
|
||
export const InterfaceConnected = () => { | ||
const { company, loading, closeModal } = useMasa(); | ||
|
||
useEffect(() => { | ||
if (!loading) { | ||
setTimeout(() => { | ||
closeModal?.(); | ||
}, 3000); | ||
} | ||
}, [loading]); | ||
|
||
if (loading) return <MasaLoading />; | ||
return ( | ||
<div className="interface-connected"> | ||
<div> | ||
<h3 className="title">We are taking you to {company}</h3> | ||
|
||
<Spinner /> | ||
</div> | ||
</div> | ||
); | ||
}; |
28 changes: 1 addition & 27 deletions
28
src/common/components/masa-interface/pages/connected/index.tsx
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 |
---|---|---|
@@ -1,27 +1 @@ | ||
import React, { useEffect } from 'react'; | ||
import { useMasa } from '../../../../helpers/provider/use-masa'; | ||
import { MasaLoading } from '../../../masa-loading'; | ||
import { Spinner } from '../../../spinner'; | ||
|
||
export const InterfaceConnected = () => { | ||
const { company, loading, closeModal } = useMasa(); | ||
|
||
useEffect(() => { | ||
if (!loading) { | ||
setTimeout(() => { | ||
closeModal?.(); | ||
}, 3000); | ||
} | ||
}, [loading]); | ||
|
||
if (loading) return <MasaLoading />; | ||
return ( | ||
<div className="interface-connected"> | ||
<div> | ||
<h3 className="title">We are taking you to {company}</h3> | ||
|
||
<Spinner /> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
export { InterfaceConnected } from './connected'; |
48 changes: 48 additions & 0 deletions
48
src/common/components/masa-interface/pages/connector/connector.tsx
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,48 @@ | ||
import React from 'react'; | ||
import { useMetamask } from '../../../../helpers/provider/use-metamask'; | ||
|
||
export const InterfaceConnector = ({ disable }: { disable?: boolean }) => { | ||
const { connect } = useMetamask({ disable }); | ||
|
||
return ( | ||
<div className="interface-connect"> | ||
<div> | ||
<h3 className="title">Select a wallet</h3> | ||
<p> | ||
By connecting your wallet, you agree to our <a>Terms of Service</a>{' '} | ||
and <a>Privacy Policy</a> | ||
</p> | ||
</div> | ||
<div className="masa-connectors"> | ||
<div className="connector" onClick={connect}> | ||
<p>MetaMask</p> | ||
<img | ||
src={ | ||
'https://upload.wikimedia.org/wikipedia/commons/thumb/3/36/MetaMask_Fox.svg/2048px-MetaMask_Fox.svg.png' | ||
} | ||
className="connector-image" | ||
/> | ||
</div> | ||
<div className="connector disabled"> | ||
<p>WalletConnect</p> | ||
<img | ||
src={'https://example.walletconnect.org/favicon.ico'} | ||
className="connector-image" | ||
/> | ||
</div> | ||
<div className="connector disabled"> | ||
<p>Ciubvase Wallet</p> | ||
<img | ||
src={'https://avatars.githubusercontent.com/u/18060234?s=280&v=4'} | ||
className="connector-image" | ||
/> | ||
</div> | ||
</div> | ||
<div className="dont-have-a-wallet"> | ||
<a> | ||
<p>I don't have a Wallet</p> | ||
</a> | ||
</div> | ||
</div> | ||
); | ||
}; |
49 changes: 1 addition & 48 deletions
49
src/common/components/masa-interface/pages/connector/index.tsx
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 |
---|---|---|
@@ -1,48 +1 @@ | ||
import React from 'react'; | ||
import { useMetamask } from '../../../../helpers/provider/use-metamask'; | ||
|
||
export const InterfaceConnector = ({ disable }: { disable?: boolean }) => { | ||
const { connect } = useMetamask({ disable }); | ||
|
||
return ( | ||
<div className="interface-connect"> | ||
<div> | ||
<h3 className="title">Select a wallet</h3> | ||
<p> | ||
By connecting your wallet, you agree to our <a>Terms of Service</a>{' '} | ||
and <a>Privacy Policy</a> | ||
</p> | ||
</div> | ||
<div className="masa-connectors"> | ||
<div className="connector" onClick={connect}> | ||
<p>MetaMask</p> | ||
<img | ||
src={ | ||
'https://upload.wikimedia.org/wikipedia/commons/thumb/3/36/MetaMask_Fox.svg/2048px-MetaMask_Fox.svg.png' | ||
} | ||
className="connector-image" | ||
/> | ||
</div> | ||
<div className="connector disabled"> | ||
<p>WalletConnect</p> | ||
<img | ||
src={'https://example.walletconnect.org/favicon.ico'} | ||
className="connector-image" | ||
/> | ||
</div> | ||
<div className="connector disabled"> | ||
<p>Ciubvase Wallet</p> | ||
<img | ||
src={'https://avatars.githubusercontent.com/u/18060234?s=280&v=4'} | ||
className="connector-image" | ||
/> | ||
</div> | ||
</div> | ||
<div className="dont-have-a-wallet"> | ||
<a> | ||
<p>I don't have a Wallet</p> | ||
</a> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
export { InterfaceConnector } from './connector'; |
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
1 change: 1 addition & 0 deletions
1
src/common/components/masa-interface/pages/create-identity-/index.ts
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 @@ | ||
export { InterfaceCreateIdentity } from './create-identity'; |
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,5 @@ | ||
export * from './authenticate'; | ||
export * from './connected'; | ||
export * from './connector'; | ||
export * from './create-credit-score'; | ||
export * from './create-identity-'; |
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 @@ | ||
export * from './masa-loading'; |
File renamed without changes.
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 @@ | ||
export * from './modal'; |
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
Oops, something went wrong.