-
Notifications
You must be signed in to change notification settings - Fork 130
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
Developer UI: Safe page #136
Merged
Merged
Changes from 87 commits
Commits
Show all changes
88 commits
Select commit
Hold shift + click to select a range
97edeb8
signer wip
mmv08 4d3a267
signer wip
mmv08 049b696
signer wip
mmv08 a17b80f
wip
mmv08 267341e
da mvp
mmv08 fdcd83c
dep bump
mmv08 10b15ef
Merge branch 'development' of github.com:gnosis/safe-apps-sdk into fe…
mmv08 64a64f8
Signer wip
mmv08 80cd04d
Merge branch 'development' of github.com:gnosis/safe-apps-sdk into fe…
mmv08 893b792
ethers signer
mmv08 231b769
remove yalc from signer
mmv08 58ae5d8
remove console.logs
mmv08 01510e3
change ethersprovider version
mmv08 7bc2323
add docs
mmv08 fc28d95
Merge branch 'development' of github.com:gnosis/safe-apps-sdk into fe…
mmv08 a804dde
type fixes
mmv08 f4f3fcd
utils/poll: remove double increment
mmv08 8fe85e2
dep updatE
mmv08 d46985f
doc fix
mmv08 6fce81b
remove jsonrpc error check logic in checkError
mmv08 ef5fd35
ui: hello world
mmv08 22033b4
safe dev ui: hello world
mmv08 4b0fea4
pin jest version to the one required by react-scripts
mmv08 d382f58
test script fix
mmv08 ca851ac
dep bump
mmv08 a327276
use jest 26.6.0
mmv08 c223968
bootstrapping
mmv08 787cb46
wip
mmv08 a010adb
wip
mmv08 bafe43f
wip
mmv08 d8728b1
dep bump
mmv08 bb7b222
wip
mmv08 0b6fa02
trying to make header work
mmv08 9399b91
got this thing to render
mmv08 9e679a3
logo alignment
mmv08 ea25d98
a battle with changing default font family in mui
mmv08 b7b7a31
a battle with font scaling
mmv08 61c4a55
header
mmv08 b2232d8
header battle continues
mmv08 ef3ee32
material ui warning fixes
mmv08 5667c70
Fix web3modal
mmv08 b3f81cf
provider store wip
mmv08 e51e18f
provider store wip
mmv08 87b531d
provider details wip
mmv08 3e3cd42
provider details wip
mmv08 884dc57
Merge branch 'feature/dev-ui' of github.com:gnosis/safe-apps-sdk into…
mmv08 b8b1fd9
wip:
mmv08 3368b3c
connected account details
mmv08 59bd4f9
connect/disconnect provider
mmv08 b5839db
welcome page layout
mmv08 9fbf9f3
welcome page layout
mmv08 cd043af
welcome page layout wip
mmv08 16c0bfe
welcome page layout done
mmv08 f0f86b1
welcome page connect provider
mmv08 4e12f58
deploy contracts wip
mmv08 8fa6b16
save contract addresses to state
mmv08 1b65f75
save contract addresses to localstorage
mmv08 f84f824
deploying safe wip
mmv08 d0b5692
deploy safe function
mmv08 b9bc7c9
dep bump
mmv08 c4d2a27
Merge branch 'development' of github.com:gnosis/safe-apps-sdk into fe…
mmv08 76d301e
dep bump
mmv08 bb7ae9b
update package json
mmv08 1eec182
deploy safe and redirect to safe page
mmv08 d3c6e15
disable btn
mmv08 f7330fa
safe page wip
mmv08 aeb56fc
type fixes
mmv08 d92f95c
cache provider
mmv08 93b07d0
sidebar wip
mmv08 daf89f4
sidebar wip
mmv08 45060a1
mui theme fixes, sidebar wip
mmv08 20ecf86
sidebar wip
mmv08 52db5a8
redirects and stuff
mmv08 934d663
use borderbox box sizing
mmv08 c874477
loading app
mmv08 b6faf2d
dep bump
mmv08 dd44e49
wip
mmv08 199d3fa
display safe app in an iframe
mmv08 48c6cd9
safe app connector
mmv08 1e1a71a
connector wip
mmv08 636ba1e
getSafeInfo handler
mmv08 0b3a450
Handle rpc calls
mmv08 9319b20
Merge branch 'development' of github.com:gnosis/safe-apps-sdk into fe…
mmv08 9ab28b6
fix eslint errors
mmv08 1e7e42a
regen yarn lock
mmv08 01a32c1
fix tsts
mmv08 7646460
fix tsts
mmv08 7e13096
feedback fixes
mmv08 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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
27 changes: 27 additions & 0 deletions
27
packages/safe-apps-developer-ui/src/components/Sidebar/SafeHeader.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 from 'react'; | ||
import styled from 'styled-components'; | ||
import { Identicon } from 'src/components/Identicon'; | ||
import { textShortener } from 'src/utils/strings'; | ||
|
||
type Props = { | ||
network: string; | ||
safeAddress: string; | ||
}; | ||
|
||
const Container = styled.div` | ||
display: flex; | ||
align-items: center; | ||
flex-direction: column; | ||
`; | ||
|
||
const SafeHeader = ({ network, safeAddress }: Props): React.ReactElement => { | ||
return ( | ||
<Container> | ||
<p>{network}</p> | ||
<Identicon size={40} address={safeAddress} /> | ||
<p>{textShortener(safeAddress, 6, 4)}</p> | ||
</Container> | ||
); | ||
}; | ||
|
||
export { SafeHeader }; |
9 changes: 9 additions & 0 deletions
9
packages/safe-apps-developer-ui/src/components/Sidebar/apps.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
82 changes: 82 additions & 0 deletions
82
packages/safe-apps-developer-ui/src/components/Sidebar/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 |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import React from 'react'; | ||
import { useParams, NavLink, NavLinkProps, useRouteMatch } from 'react-router-dom'; | ||
import styled from 'styled-components'; | ||
import List from '@material-ui/core/List'; | ||
import ListItem from '@material-ui/core/ListItem'; | ||
import ListItemIcon from '@material-ui/core/ListItemIcon'; | ||
import ListItemText from '@material-ui/core/ListItemText'; | ||
import { ETHEREUM_NETWORK_TO_ID } from 'src/api/provider'; | ||
import { useProviderStore } from 'src/stores/provider'; | ||
import { upperFirst } from 'src/utils/strings'; | ||
import { connected, headerHeight, sm } from 'src/styles/variables'; | ||
import { SafeHeader } from './SafeHeader'; | ||
import ÅppsIcon from './apps.svg'; | ||
|
||
const SidebarContainer = styled.aside` | ||
width: 200px; | ||
height: calc(100vh - ${headerHeight}); | ||
background-color: white; | ||
border-right: ${(props) => `2px solid ${props.theme.colors.separator}`}; | ||
padding: ${sm}; | ||
|
||
display: flex; | ||
flex-direction: column; | ||
`; | ||
|
||
const Line = styled.hr` | ||
width: 100%; | ||
background-color: ${(props) => props.theme.colors.separator}; | ||
height: 2px; | ||
border: none; | ||
`; | ||
|
||
interface ListItemLinkProps { | ||
icon?: React.ReactElement; | ||
primary: string; | ||
to: string; | ||
} | ||
|
||
// https://material-ui.com/ru/guides/composition/#list | ||
const ListItemLink = (props: ListItemLinkProps): React.ReactElement => { | ||
const { icon, primary, to } = props; | ||
|
||
const renderLink = React.useMemo( | ||
() => | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
React.forwardRef<any, Omit<NavLinkProps, 'to'>>((itemProps, ref) => ( | ||
<NavLink activeStyle={{ color: connected }} to={to} ref={ref} {...itemProps} /> | ||
)), | ||
[to], | ||
); | ||
|
||
return ( | ||
<li> | ||
<ListItem button component={renderLink}> | ||
{icon ? <ListItemIcon>{icon}</ListItemIcon> : null} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In case you feel like changing it |
||
<ListItemText primary={primary} /> | ||
</ListItem> | ||
</li> | ||
); | ||
}; | ||
|
||
const Sidebar = (): React.ReactElement => { | ||
const networkId = useProviderStore((state) => state.networkId); | ||
const params = useParams<{ safeAddress: string }>(); | ||
const { url } = useRouteMatch(); | ||
|
||
return ( | ||
<SidebarContainer> | ||
<SafeHeader network={upperFirst(ETHEREUM_NETWORK_TO_ID[networkId])} safeAddress={params.safeAddress} /> | ||
<Line /> | ||
<List component="nav" aria-label="main safe features navigation"> | ||
<ListItemLink | ||
to={`${url}/apps`} | ||
primary="Apps" | ||
icon={<img src={ÅppsIcon} alt="Apps Icon" style={{ width: 24, fill: '#5D7274' }} />} | ||
/> | ||
</List> | ||
</SidebarContainer> | ||
); | ||
}; | ||
|
||
export { Sidebar }; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Å