Browse Source

Align Icon in Button

master
Loëck Vézien 7 years ago
parent
commit
8e0c59598b
No known key found for this signature in database GPG Key ID: CBCDCE384E853AC4
  1. 5
      electron-builder.yml
  2. 4
      src/components/AccountPage.js
  3. 5
      src/components/ReceiveBox.js
  4. 9
      src/components/base/Button/index.js
  5. 7
      src/main/app.js

5
electron-builder.yml

@ -1,5 +1,10 @@
appId: com.electron.ledger appId: com.electron.ledger
protocols:
name: Ledger Wallet Desktop
schemes:
- ledgerhq
mac: mac:
category: public.app-category.utilities category: public.app-category.utilities
linux: linux:

4
src/components/AccountPage.js

@ -51,7 +51,7 @@ class AccountPage extends PureComponent<Props> {
<Box horizontal align="center" justify="flex-end" grow flow={20}> <Box horizontal align="center" justify="flex-end" grow flow={20}>
<Box> <Box>
<Button primary onClick={() => openModal(MODAL_SEND, { account })}> <Button primary onClick={() => openModal(MODAL_SEND, { account })}>
<Box horizontal flow={2}> <Box horizontal flow={2} align="center">
<Box> <Box>
<Icon name="upload" /> <Icon name="upload" />
</Box> </Box>
@ -61,7 +61,7 @@ class AccountPage extends PureComponent<Props> {
</Box> </Box>
<Box> <Box>
<Button primary onClick={() => openModal(MODAL_RECEIVE, { account })}> <Button primary onClick={() => openModal(MODAL_RECEIVE, { account })}>
<Box horizontal flow={2}> <Box horizontal flow={2} align="center">
<Box> <Box>
<Icon name="download" /> <Icon name="download" />
</Box> </Box>

5
src/components/ReceiveBox.js

@ -27,9 +27,10 @@ const AddressBox = styled(Box).attrs({
` `
const Action = styled(Box).attrs({ const Action = styled(Box).attrs({
flow: 1, align: 'center',
flex: 1,
color: 'mouse', color: 'mouse',
flex: 1,
flow: 1,
fontSize: 0, fontSize: 0,
})` })`
font-weight: bold; font-weight: bold;

9
src/components/base/Button/index.js

@ -4,6 +4,7 @@ import React from 'react'
import styled from 'styled-components' import styled from 'styled-components'
import { borderColor, borderWidth, space, fontSize, fontWeight, color } from 'styled-system' import { borderColor, borderWidth, space, fontSize, fontWeight, color } from 'styled-system'
import Box from 'components/base/Box'
import Icon from 'components/base/Icon' import Icon from 'components/base/Icon'
const Base = styled.button` const Base = styled.button`
@ -27,7 +28,13 @@ type Props = {
} }
const Button = ({ primary, children, icon, ...props }: Props) => { const Button = ({ primary, children, icon, ...props }: Props) => {
children = icon ? <Icon name={icon} /> : children children = icon ? (
<Box align="center" justify="center">
<Icon name={icon} />
</Box>
) : (
children
)
props = { props = {
...props, ...props,

7
src/main/app.js

@ -78,6 +78,13 @@ const installExtensions = async () => {
).catch(console.log) // eslint-disable-line ).catch(console.log) // eslint-disable-line
} }
app.setAsDefaultProtocolClient('ledgerhq')
app.on('open-url', (e, url) => {
e.preventDefault()
console.log('open url', e, url)
})
app.on('ready', async () => { app.on('ready', async () => {
if (__DEV__) { if (__DEV__) {
await installExtensions() await installExtensions()

Loading…
Cancel
Save