Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created /snap route #1254

Merged
merged 3 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/assets/PushSnaps/ActiveIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions src/assets/PushSnaps/Gear.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions src/assets/PushSnaps/PushMetamaskLogo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 72 additions & 0 deletions src/assets/PushSnaps/SnapExample.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/assets/PushSnaps/spam-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion src/config/NavigationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ const NavigationList = {
},
},


receiveNotifs: {
src: 'navigation/receiveNotifOffIcon.svg',
activeSrc: 'navigation/receiveNotifOnIcon.svg',
Expand Down
69 changes: 69 additions & 0 deletions src/modules/snap/AboutSnapModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import React from 'react';
import { ReactComponent as Close } from 'assets/chat/group-chat/close.svg';
import { H2V2, ItemVV2, SpanV2 } from 'components/reusables/SharedStylingV2';
import styled from 'styled-components';


const AboutSnapModal = ({
onClose
}) => {

const InfoDetails = [
{
title: 'Step 1',
info: 'Install MetaMask Snaps by going to app.push.org/snap'
},
{
title: 'Step 2',
info: 'Connect your wallet using MetaMask to receive notifications'
},
{
title: 'Step 3',
info: 'Opt-in channels on app.push.org/channels and you’re all set.'
},
{
title: 'Step 4 (optional)',
info: 'You can visit app.push.org/snap, click on Settings and Add/Remove Wallets or Snooze Notifications. '
}
]



return (
<Container>

<Close
onClick={() => onClose()}
style={{ cursor: 'pointer' }}
/>

<ItemVV2 gap='24px'>

<ItemVV2>
<H2V2 fontSize='22px' fontWeight='500' letterSpacing='-0.44px'>Installing Push Snap</H2V2>
</ItemVV2>

{InfoDetails.map((detail) => (
<ItemVV2 alignItems='baseline'>
<H2V2 fontSize='18px' fontWeight='500' >{detail.title}</H2V2>
<SpanV2 textAlign='left' fontSize='16px' fontWeight='400' color='#62626A'>{detail.info}</SpanV2>
</ItemVV2>
))}

</ItemVV2>



</Container>
);
};

export default AboutSnapModal;

const Container = styled(ItemVV2)`
width: 375px;
padding: 32px 24px;
border-radius: 16px;
background: #FFF;
align-items: end;
`
91 changes: 91 additions & 0 deletions src/modules/snap/PushSnapModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import { Image, Section } from 'components/SharedStyling';
import React, { useState } from 'react';
import styled from 'styled-components';
import SnapExample from 'assets/PushSnaps/SnapExample.svg'
import { ButtonV2, H2V2, ItemHV2, ItemVV2, SpanV2 } from 'components/reusables/SharedStylingV2';
import InfoLogo from 'assets/PushSnaps/spam-icon.svg';
import LoaderSpinner, { LOADER_TYPE } from 'components/reusables/loaders/LoaderSpinner';

const PushSnapModal = () => {

const [loading, setLoading] = useState(false);
const [walletConnected,setWalletConnected] = useState(false);

const connectToMetamask = () => {
setLoading(!loading);
}


return (
<Container>

<ItemVV2>
<Image src={SnapExample} width='276px' height='202px' />
</ItemVV2>

<ItemVV2 gap='24px'>
<ItemVV2 gap='12px'>
<ItemVV2>
<H2V2 fontSize='34px' fontWeight='500' color='#1E1E1E' letterSpacing='-1.02px'>
Push Snap
</H2V2>
<SpanV2 fontSize='12px' fontWeight='400' color='#657795'>powered by MetaMask</SpanV2>
</ItemVV2>
<ItemVV2>
<SpanV2 fontSize='14px' fontWeight='400' color='#000'>
You’re about to install Push Snap which allows you to receive notifications from Push directly on MetaMask!
</SpanV2>
</ItemVV2>
</ItemVV2>


<ItemVV2 onClick={connectToMetamask}>
{loading ? (
<LoaderSpinner type={LOADER_TYPE.SEAMLESS} spinnerSize={44} />
) : (
<FilledButton onClick={connectToMetamask}>Connect Using MetaMask</FilledButton>
)}
</ItemVV2>

<ItemHV2 gap='7px'>
<Image src={InfoLogo} width={16} />
<SpanV2>About this Snap</SpanV2>
</ItemHV2>
</ItemVV2>


</Container>
);
};

export default PushSnapModal;

const Container = styled(Section)`
width:438px;
height:423px;
padding:48px 24px;
`

const FilledButton = styled(ButtonV2)`
min-width:230px;
height:44px;
padding: 16px 24px;
background: #D53A94;
border: 1px solid #D53A94;
border-radius: 8px;
font-size: 16px;
line-height: 141%;
letter-spacing: -0.03em;
color: #FFFFFF;
flex:none;
cursor:pointer;
border-radius: 15px;
& > div{
display:block;
}

@media(max-width:600px){
font-size: 14px;
}

`;
Loading