-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dapp-connector): Add CIP-30 support (#3225)
- Loading branch information
1 parent
d0e561e
commit 5d72fe9
Showing
43 changed files
with
1,771 additions
and
335 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react' | ||
import Svg, {Path} from 'react-native-svg' | ||
|
||
type Props = { | ||
size?: number | ||
color?: string | ||
} | ||
|
||
export const Connection = ({size = 36, color = '#000000'}: Props) => { | ||
return ( | ||
<Svg width={size} height={size} viewBox="0 0 21 20" fill="none"> | ||
<Path | ||
d="M16.207.293a1 1 0 10-1.414 1.414L17.086 4H7.5a1 1 0 000 2h9.586l-2.293 2.293a1 1 0 001.414 1.414l4-4a1 1 0 000-1.414l-4-4zM6.207 10.293a1 1 0 010 1.414L3.914 14H13.5a1 1 0 110 2H3.914l2.293 2.293a1 1 0 11-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" | ||
fill={color} | ||
/> | ||
</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,34 @@ | ||
import React from 'react' | ||
import Svg, {Defs, LinearGradient, Path, Rect, Stop} from 'react-native-svg' | ||
|
||
type Props = { | ||
size?: number | ||
} | ||
|
||
export const YoroiApp = ({size = 36}: Props) => { | ||
return ( | ||
<Svg width={size} height={size} viewBox="0 0 49 48" fill="none"> | ||
<Rect x={0.5} width={48} height={48} rx={8} fill="url(#paint0_linear_16084_126466)" /> | ||
|
||
<Path | ||
d="M23.702 21.15L10 11h4.304l10.16 7.293L34.674 11H39L25.23 21.15a1.318 1.318 0 01-1.527 0zM29.06 32.771L12.298 20.762v-3.44l19.465 13.834-2.703 1.615zM29.871 25.748l5.948-4.424v-3.3l-8.246 6.039 2.298 1.685zM35.143 29.54l.676-.561v-3.23l-2.974 2.106 2.298 1.686zM12.298 28.205L23.383 36l2.77-1.545-13.855-9.832v3.582z" | ||
fill="#fff" | ||
/> | ||
|
||
<Defs> | ||
<LinearGradient | ||
id="paint0_linear_16084_126466" | ||
x1={50.6518} | ||
y1={77.0646} | ||
x2={108.781} | ||
y2={-23.2391} | ||
gradientUnits="userSpaceOnUse" | ||
> | ||
<Stop stopColor="#244ABF" /> | ||
|
||
<Stop offset={1} stopColor="#4760FF" /> | ||
</LinearGradient> | ||
</Defs> | ||
</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
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
39 changes: 39 additions & 0 deletions
39
apps/wallet-mobile/src/features/Discover/common/ConfirmConnectionModal.stories.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,39 @@ | ||
import {action} from '@storybook/addon-actions' | ||
import {storiesOf} from '@storybook/react-native' | ||
import * as React from 'react' | ||
import {View} from 'react-native' | ||
|
||
import {Button} from '../../../components' | ||
import {ConfirmConnectionModal, useOpenConfirmConnectionModal} from './ConfirmConnectionModal' | ||
|
||
storiesOf('Discover ConfirmConnectionModal', module) | ||
.addDecorator((story) => <View style={{padding: 20}}>{story()}</View>) | ||
.add('initial', () => <Initial />) | ||
.add('With Button', () => <WithButton />) | ||
|
||
const Initial = () => { | ||
return ( | ||
<ConfirmConnectionModal | ||
logo="https://daehx1qv45z7c.cloudfront.net/cardano-spot.png" | ||
onConfirm={action('onConfirm')} | ||
name="Example DApp" | ||
website="example.com" | ||
/> | ||
) | ||
} | ||
|
||
const WithButton = () => { | ||
const {openConfirmConnectionModal} = useOpenConfirmConnectionModal() | ||
|
||
const handleOnPress = () => { | ||
openConfirmConnectionModal({ | ||
onConfirm: action('onConfirm'), | ||
website: 'example.com', | ||
name: 'Example DApp', | ||
logo: 'https://daehx1qv45z7c.cloudfront.net/cardano-spot.png', | ||
onClose: action('onClose'), | ||
}) | ||
} | ||
|
||
return <Button title="Open Modal" shelleyTheme onPress={handleOnPress} /> | ||
} |
Oops, something went wrong.