Skip to content

Commit

Permalink
feat(icons): add MaterialIcons and Octicons
Browse files Browse the repository at this point in the history
  • Loading branch information
nampdn committed Apr 21, 2019
1 parent b57f9ee commit bf36cf8
Show file tree
Hide file tree
Showing 50 changed files with 399 additions and 977 deletions.
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build
/dist

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
22 changes: 22 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
language: node_js

cache:
yarn: true
directories:
- node_modules

notifications:
email: false

node_js:
- node

before_install:
- echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc

script:
- yarn build
- yarn compile

after_success:
- npx semantic-release
19 changes: 19 additions & 0 deletions @types/react-native-vector-icons/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
declare module 'react-native-vector-icons' {
export * from 'react-native-vector-icons'
}

declare module 'react-native-vector-icons/dist/MaterialIcons' {

}

declare module 'react-native-vector-icons/dist/Octicons' {

}

declare module 'react-native-vector-icons/Fonts/MaterialIcons.ttf' {

}

declare module 'react-native-vector-icons/Fonts/Octicons.ttf' {

}
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bara-react-icons",
"license": "MIT",
"description": "BaraJS for React creative",
"description": "BaraJS React vector icons for cross-platform!",
"homepage": "https://barajs.dev",
"repository": "https://github.com/barajs/bara-react-icons",
"version": "0.0.0",
Expand All @@ -16,19 +16,20 @@
"src/lib"
],
"dependencies": {
"bara": "2.2.0",
"fbemitter": "2.1.1",
"bara": "2.3.1",
"bara-react": "2.0.1",
"react-native-vector-icons": "6.4.2",
"react-native-web": "0.11.2"
},
"devDependencies": {
"@semantic-release/changelog": "3.0.2",
"@semantic-release/git": "7.0.8",
"@types/fbemitter": "2.0.32",
"@types/jest": "24.0.11",
"@types/node": "11.13.5",
"@types/react": "16.8.12",
"@types/react-dom": "16.8.3",
"@types/react-native": "0.57.42",
"@types/react-native-vector-icons": "6.4.0",
"@typescript-eslint/typescript-estree": "1.6.0",
"react": "16.8.6",
"react-dom": "16.8.6",
Expand Down
23 changes: 14 additions & 9 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import { useBarn } from 'bara'
import { BaraProvider, Touchable, View, Text, TouchableOpacity } from 'bara-react'
import React, { Component, ReactNode, useState, useEffect } from 'react'

import { StyleSheet } from 'react-native'

import { BaraProvider } from './lib/context'
import { Touchable } from './lib/exports/Touchable'
import { View } from './lib/exports/View'
import { Text } from './lib/exports/Text'
import { TouchableOpacity } from './lib/exports/TouchableOpacity'
import { WelcomeText } from './examples/components/WelcomeText'
import { MaterialIcons as Icon, Octicons } from './lib'

const styles = StyleSheet.create({
view: {
Expand All @@ -35,15 +31,24 @@ const App = () => {
return (
<BaraProvider>
<View style={styles.view}>
<Text name="version">Version: {version}</Text>
<Text name="version">
Version: {version}</Text>
<View style={styles.button}>
<Touchable name="welcome-button">
<Text>Welcome!</Text>
<Text>Material Icons</Text>
<Icon name="star" size={30} />
<Icon name="accessible" size={30} />
<Icon name="stop" size={30} />

</Touchable>
</View>
<View style={styles.button}>
<TouchableOpacity name="greet-button">
<Text>No Greet</Text>
<Text>Octicons</Text>
<Text>gear</Text>
<Octicons name="gear" size={30} />
<Text>chevron-right</Text>
<Octicons name="chevron-right" size={30} />
</TouchableOpacity>
</View>
<View>
Expand Down
2 changes: 1 addition & 1 deletion src/examples/components/WelcomeText.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { Text, Touchable, useBarnState, View } from '../../lib'
import { Text, Touchable, useBarnState, View } from 'bara-react'

export const WelcomeText = () => {
const [message, setMessage] = useBarnState('welcome', 'Welcome to Bara App!')
Expand Down
12 changes: 6 additions & 6 deletions src/examples/features/welcome.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useInit, useBarn, useTimerElapsed } from 'bara'
import { useInit, useBarn, useTimerElapsed, setBarnState } from 'bara'

import {
nameOfTouchable,
Expand All @@ -7,11 +7,11 @@ import {
useTouchableOpacityPress,
useTextPress,
nameOfText,
} from '../../lib'
} from 'bara-react'

export function welcomeTrigger(setState: (key: string, value: any) => void) {
export function welcomeTrigger() {
useInit(() => {
setState('welcome', `Loading...`)
setBarnState('welcome', `Loading...`)
useBarn('welcome', newMessage => {
})
})
Expand All @@ -21,7 +21,7 @@ export function welcomeTrigger(setState: (key: string, value: any) => void) {
nameOf: nameOfTouchable('welcome-button'),
},
({ name }) => {
setState('welcome', `You (${name}) are already welcomed!`)
setBarnState('welcome', `You (${name}) are already welcomed!`)
},
)

Expand All @@ -36,7 +36,7 @@ export function welcomeTrigger(setState: (key: string, value: any) => void) {
)

useTimerElapsed(5, () => {
setState('welcome', `Who are you?`)
setBarnState('welcome', `Who are you?`)
})

useBarn('welcome', newMessage => {
Expand Down
11 changes: 5 additions & 6 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
import { register, useBarnStream } from 'bara'
import { register, useBarnStream, useInitStream } from 'bara'
import App from './App'
import './index.css'
import {
mapBarnWithReact,
useReactApp,
useTextStream,
useTouchableOpacityStream,
useTouchableStream,
useViewStream,
} from './lib'
} from 'bara-react'

import { welcomeTrigger } from './examples/features/welcome'

const BaraApp = () => {
const [setState] = useBarnStream({
useInitStream()
useBarnStream({
version: '1.0.0',
welcome: 'Welcome to Bara React App!',
})
useReactApp({ name: 'bara-app', App })
mapBarnWithReact(setState)
useViewStream()
useTouchableStream()
useTouchableOpacityStream()
useTextStream()
welcomeTrigger(setState)
welcomeTrigger()
}

const bara = register(BaraApp)
Expand Down
52 changes: 0 additions & 52 deletions src/lib/context.tsx

This file was deleted.

28 changes: 0 additions & 28 deletions src/lib/exports/Text/Text.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions src/lib/exports/Text/condition.ts

This file was deleted.

23 changes: 0 additions & 23 deletions src/lib/exports/Text/event.ts

This file was deleted.

9 changes: 0 additions & 9 deletions src/lib/exports/Text/hook.ts

This file was deleted.

6 changes: 0 additions & 6 deletions src/lib/exports/Text/index.ts

This file was deleted.

Loading

0 comments on commit bf36cf8

Please sign in to comment.