This repository has been archived by the owner on Nov 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'safe-app-landing-page' of github.com:gnosis/safe-react …
…into feat/create-safe-apps-redirect
- Loading branch information
Showing
5 changed files
with
230 additions
and
191 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
52 changes: 52 additions & 0 deletions
52
src/routes/SafeAppLandingPage/components/ConnectWallet.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,52 @@ | ||
import { ReactElement } from 'react' | ||
import ClickAwayListener from '@material-ui/core/ClickAwayListener' | ||
import styled from 'styled-components' | ||
import List from '@material-ui/core/List' | ||
import Popper from '@material-ui/core/Popper' | ||
|
||
import { useStateHandler } from 'src/logic/hooks/useStateHandler' | ||
import { grey400 } from 'src/theme/variables' | ||
import ProviderDisconnected from 'src/components/AppLayout/Header/components/ProviderInfo/ProviderDisconnected' | ||
import Provider from 'src/components/AppLayout/Header/components/Provider' | ||
import ConnectDetails from 'src/components/AppLayout/Header/components/ProviderDetails/ConnectDetails' | ||
|
||
const ConnectWallet = (): ReactElement => { | ||
const { clickAway, open, toggle } = useStateHandler() | ||
|
||
return ( | ||
<StyledProvider> | ||
<Provider | ||
info={<ProviderDisconnected />} | ||
open={open} | ||
toggle={toggle} | ||
render={(providerRef) => ( | ||
<StyledPopper | ||
anchorEl={providerRef.current} | ||
open={open} | ||
placement="bottom" | ||
popperOptions={{ positionFixed: true }} | ||
> | ||
<ClickAwayListener onClickAway={clickAway} touchEvent={false}> | ||
<List component="div"> | ||
<ConnectDetails /> | ||
</List> | ||
</ClickAwayListener> | ||
</StyledPopper> | ||
)} | ||
/> | ||
</StyledProvider> | ||
) | ||
} | ||
|
||
export default ConnectWallet | ||
|
||
const StyledProvider = styled.div` | ||
width: 300px; | ||
height: 56px; | ||
margin: 0 auto; | ||
border-radius: 8px; | ||
border: 2px solid ${grey400}; | ||
` | ||
const StyledPopper = styled(Popper)` | ||
z-index: 1301; | ||
` |
31 changes: 31 additions & 0 deletions
31
src/routes/SafeAppLandingPage/components/CreateNewSafe.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,31 @@ | ||
import { Button, Text } from '@gnosis.pm/safe-react-components' | ||
import styled from 'styled-components' | ||
|
||
import { OPEN_SAFE_ROUTE, SAFE_ROUTES } from 'src/routes/routes' | ||
import Img from 'src/components/layout/Img' | ||
import Link from 'src/components/layout/Link' | ||
import SuccessSvg from 'src/assets/icons/safe-created.svg' | ||
|
||
const CreateNewSafe = ({ safeAppUrl }: { safeAppUrl: string }): React.ReactElement => { | ||
const openSafeLink = `${OPEN_SAFE_ROUTE}?redirect=${encodeURIComponent(`${SAFE_ROUTES.APPS}?appUrl=${safeAppUrl}`)}` | ||
|
||
return ( | ||
<> | ||
<BodyImage> | ||
<Img alt="Vault" height={92} src={SuccessSvg} /> | ||
</BodyImage> | ||
|
||
<Button size="lg" color="primary" variant="contained" component={Link} to={openSafeLink}> | ||
<Text size="xl" color="white"> | ||
Create new Safe | ||
</Text> | ||
</Button> | ||
</> | ||
) | ||
} | ||
|
||
export default CreateNewSafe | ||
|
||
const BodyImage = styled.div` | ||
margin: 30px 0; | ||
` |
Oops, something went wrong.