-
Notifications
You must be signed in to change notification settings - Fork 20
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
7 changed files
with
131 additions
and
224 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
62 changes: 62 additions & 0 deletions
62
packages/ui/src/components/LandingComponents/ConnectButtons.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,62 @@ | ||
import { createSearchParams, useNavigate, useSearchParams } from 'react-router-dom' | ||
import { Button } from '../library' | ||
import { WATCH_ACCOUNT_ANCHOR } from '../../pages/Settings/Settings' | ||
import { useAccounts } from '../../contexts/AccountsContext' | ||
import { styled } from '@mui/material' | ||
|
||
export const ConnectButtons = () => { | ||
const navigate = useNavigate() | ||
const [searchParams] = useSearchParams() | ||
const { isAllowedToConnectToExtension, allowConnectionToExtension } = useAccounts() | ||
|
||
return ( | ||
<ButtonWrapperStyled> | ||
{isAllowedToConnectToExtension ? ( | ||
<Button | ||
variant="primary" | ||
onClick={() => { | ||
navigate({ | ||
pathname: '/create', | ||
search: createSearchParams(searchParams).toString() | ||
}) | ||
}} | ||
data-cy="button-create-one" | ||
> | ||
Create one | ||
</Button> | ||
) : ( | ||
<Button | ||
variant="primary" | ||
onClick={allowConnectionToExtension} | ||
data-cy="button-connect-wallet" | ||
> | ||
Connect Wallet | ||
</Button> | ||
)} | ||
or | ||
<Button | ||
onClick={() => { | ||
navigate({ | ||
pathname: '/settings', | ||
search: createSearchParams(searchParams).toString(), | ||
hash: WATCH_ACCOUNT_ANCHOR | ||
}) | ||
}} | ||
data-cy="button-watch-account" | ||
> | ||
Watch account | ||
</Button> | ||
</ButtonWrapperStyled> | ||
) | ||
} | ||
|
||
const ButtonWrapperStyled = styled('div')` | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
padding: 1rem 0; | ||
button { | ||
margin: 0 0.5rem; | ||
} | ||
` |
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,21 @@ | ||
import { styled } from '@mui/material' | ||
import { ReactNode } from 'react' | ||
|
||
interface Props { | ||
children: ReactNode | ||
} | ||
|
||
export const Hero = ({ children }: Props) => { | ||
return <StyledHero>{children}</StyledHero> | ||
} | ||
|
||
const StyledHero = styled('div')` | ||
background-color: ${({ theme }) => theme.palette.primary.main}; | ||
color: white; | ||
border-radius: ${({ theme }) => theme.custom.borderRadius}; | ||
display: flex; | ||
border-radius: 1rem; | ||
flex-direction: column; | ||
justify-items: center; | ||
padding: 2rem; | ||
` |
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,30 @@ | ||
import { styled } from '@mui/material' | ||
import { ConnectButtons } from './ConnectButtons' | ||
import { Hero } from './Hero' | ||
|
||
export const Landing = () => { | ||
return ( | ||
<WrapperStyled> | ||
<Hero> | ||
<h1 data-cy="header-multix-introduction"> | ||
Multix is an interface to easily manage complex multisigs. | ||
</h1> | ||
<div data-cy="label-interaction-prompt"> | ||
Connect a wallet to interact with Multix or watch an account. | ||
</div> | ||
<ConnectButtons /> | ||
</Hero> | ||
</WrapperStyled> | ||
) | ||
} | ||
|
||
const WrapperStyled = styled('div')` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
flex-direction: column; | ||
h1 { | ||
text-align: center; | ||
} | ||
` |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
export { default as Creation } from './Creation' | ||
export { default as Home } from './Home/Home' | ||
export { default as About } from './About' | ||
export { default as Overview } from './Overview' | ||
export { default as Settings } from './Settings/Settings' |
Oops, something went wrong.