tuckerconnelly / carbon-ui

React Native Material Design library for all platforms
MIT License
210 stars 17 forks source link

Added icons to web. Did not tackle styles to minimize commit complexity. #20

Closed mattferrin closed 7 years ago

mattferrin commented 7 years ago

Meant to be as simple as possible. Attempted to limit complexity and diff size, so more could be done after, if this is accepted.

tuckerconnelly commented 7 years ago

Hey thanks for the PR :) Don't icons already work on web? If you include the <WebStyles /> component?

mattferrin commented 7 years ago

I might have missed something. This didn't work for me in "evergreen" Chrome:

import {
  App
} from './index/app'
import { WebStyles } from 'carbon-ui'
import React from 'react'
import {
  AppRegistry
} from 'react-native'

const AppWithStyles = () => <App><WebStyles /></App>
AppRegistry.registerComponent('AnonymousAppName', () => AppWithStyles)
AppRegistry.runApplication('AnonymousAppName', { rootTag: document.getElementById('react_root') })

I followed these: https://google.github.io/material-design-icons/, instructions and made these small changes to support it.

mattferrin commented 7 years ago

Just double checked MaterialIcons-Regular.ttf in Xcode. I'll need to wait till I have more time to check if maybe <WebStyles /> isn't rendering, but the fonts are working to the best of my knowledge as everything runs fine.

tuckerconnelly commented 7 years ago

Closing for inactivity! Lemme know if you still wanna merge this

mattferrin commented 7 years ago

The icons did not work for me without it, but it's good that you are closing this because I haven't had time to look at <WebStyles /> myself. The momentum behind NativeBase seems strong, so I've started to use that more myself.

It's not ideal though because it doesn't support web yet and I have to duplicate more code to support both. Plus, I like Material Design on iOS :)