Skip to content

Commit

Permalink
fix(web): icon font-family
Browse files Browse the repository at this point in the history
Signed-off-by: Godefroy Ponsinet <godefroy.ponsinet@outlook.com>
  • Loading branch information
90dy committed Sep 27, 2018
1 parent 58e12fd commit 49023d0
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 54 deletions.
Expand Up @@ -91,7 +91,7 @@ class ByPublicKey extends PureComponent {
selectTextOnFocus
/>
{routeName === 'Enter a public key' && (
<Flex.Cols>
<Flex.Cols justify='center'>
<Button
icon='plus'
background={colors.blue}
Expand All @@ -101,7 +101,7 @@ class ByPublicKey extends PureComponent {
height={24}
medium
middle
justify='center'
center
onPress={async () => {
try {
await mutations.contactRequest.commit({
Expand Down
Expand Up @@ -29,50 +29,56 @@ class ByQRCode extends PureComponent {
{routeName === 'Scan a QR code' && (
<Fragment>
<QRReader />
<Button
icon='plus'
background={colors.blue}
margin
padding
rounded={23}
height={24}
medium
middle
onPress={async () => {
try {
console.log(
await commit(mutations.ContactRequest, { contactID })
)
navigation.goBack(null)
} catch (err) {
this.setState({ err })
console.error(err)
}
}}
>
ADD THIS KEY
</Button>
<Flex.Cols justify='center'>
<Button
icon='plus'
background={colors.blue}
margin
padding
rounded={23}
height={24}
medium
middle
center
onPress={async () => {
try {
console.log(
await commit(mutations.ContactRequest, { contactID })
)
navigation.goBack(null)
} catch (err) {
this.setState({ err })
console.error(err)
}
}}
>
ADD THIS KEY
</Button>
</Flex.Cols>
</Fragment>
)}
{routeName === 'View my QR code' &&
Platform.OS === 'web' && (
<Fragment>
<QRCode value={myID} logo={logo} size={256} logoWidth={100} />
<Button
icon='share'
background={colors.blue}
margin
padding
rounded={23}
height={24}
medium
middle
onPress={() => {
console.log('Share: ', myID)
}}
>
SHARE THE KEY
</Button>
<Flex.Cols justify='center'>
<Button
icon='plus'
background={colors.blue}
margin
padding
rounded={23}
height={24}
medium
middle
center
onPress={() => {
console.log('Share: ', myID)
}}
>
SHARE THE KEY
</Button>
</Flex.Cols>
</Fragment>
)}
</Flex.Rows>
Expand Down
Expand Up @@ -20,7 +20,7 @@ export default class Choice extends PureComponent {
navigation={navigation}
/>
<Item
icon='square'
icon='material-qrcode-scan'
name='QR Code'
link='contacts/add/by-qr-code'
navigation={navigation}
Expand Down
25 changes: 12 additions & 13 deletions client/react-native/web/index.web.js
@@ -1,37 +1,36 @@
import('../common/index.js')
import IconAwesome from 'react-native-vector-icons/Fonts/FontAwesome.ttf'
import IconFeather from 'react-native-vector-icons/Fonts/Feather.ttf';
import IconFeather from 'react-native-vector-icons/Fonts/Feather.ttf'
import IconMatCom from 'react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf'
import('../common/index.js')

/******* Fonts ***********/
/** ***** Fonts ***********/

// Generate required css
const iconFontStyles = `
@font-face {
src: url(${IconAwesome});
font-family: Feather;
font-family: FontAwesome;
}
@font-face {
src: url(${IconFeather});
font-family: Feather;
}
@font-face {
src: url(${IconMatCom});
font-family: Feather;
font-family: MaterialCommunityIcons;
}
`;
`

// Create stylesheet
const style = document.createElement('style');
style.type = 'text/css';
const style = document.createElement('style')
style.type = 'text/css'
if (style.styleSheet) {
style.styleSheet.cssText = iconFontStyles;
style.styleSheet.cssText = iconFontStyles
} else {
style.appendChild(document.createTextNode(iconFontStyles));
style.appendChild(document.createTextNode(iconFontStyles))
}

// Inject stylesheet
document.head.appendChild(style);

document.head.appendChild(style)

/************ End fonts **********/
/** ********** End fonts **********/

0 comments on commit 49023d0

Please sign in to comment.