Skip to content

Commit

Permalink
v1.0.0-beta4
Browse files Browse the repository at this point in the history
  • Loading branch information
iRoachie authored Apr 2, 2018
2 parents 484d784 + 7b02f00 commit ef403af
Show file tree
Hide file tree
Showing 111 changed files with 14,711 additions and 4,184 deletions.
28 changes: 28 additions & 0 deletions .ci/expo-ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

# Configure user
git config --global user.name "React Native Elements CI"
echo -e "machine github.com\n login react-native-elements-ci\n password $GITHUB_TOKEN" >> ~/.netrc

# Expo auto deployment for PRs
if [ "$TRAVIS_PULL_REQUEST" != "false" -a "$TRAVIS_PULL_REQUEST_SLUG" == "react-native-training/react-native-elements" ]; then
set -x

# Clone example app and install modules
git clone "https://github.com/react-native-training/react-native-elements-app.git"
cd react-native-elements-app
yarn add "https://github.com/${TRAVIS_PULL_REQUEST_SLUG}.git#${TRAVIS_PULL_REQUEST_SHA}"
yarn
yarn global add exp

# Login into expo and publish the example app
set +x
exp login -u "$EXPO_LOGIN" -p "$EXPO_PASSWORD" --non-interactive
set -x
exp publish --release-channel ${TRAVIS_PULL_REQUEST_SHA}

# Comment the PR
cd ../.ci
yarn
node index.js
fi
53 changes: 53 additions & 0 deletions .ci/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
const octokit = require('@octokit/rest')()

const TRAVIS_PULL_REQUEST = process.env.TRAVIS_PULL_REQUEST
const TRAVIS_PULL_REQUEST_SHA = process.env.TRAVIS_PULL_REQUEST_SHA
const owner = 'react-native-training'
const repo = 'react-native-elements'

async function commentPullRequest() {
// Synchronous, just set the credentials
octokit.authenticate({
type: 'token',
token: process.env.GITHUB_TOKEN,
})

// Get the comments of the pull request
const result = await octokit.issues.getComments({
owner,
repo,
page: 1,
number: TRAVIS_PULL_REQUEST,
per_page: 100 // This is the maximum. Hopefully, the CI comment should be there
})

// Set the body of the comment
const expo_url = `https://exp.host/@rn-elements/react-native-elements-app?release-channel=${TRAVIS_PULL_REQUEST_SHA}`
const qr_code_url = `![QR Code](https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${expo_url})`
const body = `Example app for the last commit (${TRAVIS_PULL_REQUEST_SHA}):\n\n${qr_code_url}\n\n${expo_url}`

// If there is already a CI comment, just update it, if no, comment the PR
const comment = result.data.find(comment => comment.user.login === 'react-native-elements-ci');
if (comment != null) {
// Update comment
const result = await octokit.issues.editComment({
owner,
repo,
id: comment.id,
body,
})
console.log(`Updated comment #${comment.id}`)
}
else {
// Post new comment
const result = await octokit.issues.createComment({
owner,
repo,
number: TRAVIS_PULL_REQUEST,
body,
})
console.log("Posted new comment")
}
}

commentPullRequest()
11 changes: 11 additions & 0 deletions .ci/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "react-native-elements-ci",
"version": "1.0.0",
"description": "Script for CI on React Native Elements ",
"main": "index.js",
"author": "",
"license": "ISC",
"dependencies": {
"@octokit/rest": "15.2.5"
}
}
15 changes: 5 additions & 10 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,8 @@
"env": {
"browser": true
},
"plugins": [
"react",
"react-native"
],
"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
"plugins": ["react", "react-native"],
"extends": ["eslint:recommended", "plugin:react/recommended"],
"globals": {
"describe": false,
"it": false,
Expand All @@ -19,10 +13,11 @@
"before": false,
"afterEach": false,
"after": false,
"jest": false
"jest": false,
"global": false
},
"rules": {
"quotes": ["error", "single", { "allowTemplateLiterals": true } ],
"quotes": ["error", "single", { "allowTemplateLiterals": true }],
"semi": ["error", "always"]
}
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ site
coverage
jsconfig.json
.vscode/
.idea/
website/build
.idea/
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
package.json
*.md
13 changes: 6 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ install:
- yarn
script:
- yarn run test && codecov
after_script:
- ./.ci/expo-ci.sh
after_success:
- if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_BRANCH" != "master" ]; then exit
0; fi
- git config --global user.email "kroach.work@gmail.com"
- git config --global user.name "Kyle Roach"
- echo "machine github.com login iroachie password $GITHUB_TOKEN" > ~/.netrc
- cd website && yarn && GIT_USER=iroachie yarn run publish-gh-pages

- |
if [ "$TRAVIS_PULL_REQUEST" == "false" -a "$TRAVIS_BRANCH" == "master" ]; then
cd website && yarn && GIT_USER=react-native-elements-ci yarn run publish-gh-pages
fi
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ If you are looking to contribute to the React Native Elements App, click [here](

## v1.0 Roadmap 🏃 🏎 🏇

Current release: `1.0.0-beta2`
Current release: `1.0.0-beta4`

### New Features:

Expand Down Expand Up @@ -133,11 +133,11 @@ The official `v1.0.0` will be released around mid-March 2018 🎉

### Test v1.0 components

You can test new features of the `v1.0.0` beta releases on [Expo Snack](https://snack.expo.io/) by doing this:
You can test new features of the `v1.0.0` beta releases on [Expo Snack](https://snack.expo.io/) by modifying the `package.json` file:

`import { Button } from 'react-native-elements'; // 1.0.0-beta2`
`"react-native-elements": "^1.0.0-beta"`

This will install the `v1.0.0-beta2` version of React Native Elements.
This will install the latest beta release of React Native Elements.

## Documentation

Expand Down
200 changes: 178 additions & 22 deletions docs/avatar.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ title: Avatar

<img src="/react-native-elements/img/avatar_all.png" width="500" >

#### Avatars

<img src="/react-native-elements/img/avatar_with_images.png" width="500" >

```js
Expand Down Expand Up @@ -110,23 +108,181 @@ title: Avatar
/>
```

### Avatar Props

| prop | default | type | description |
| --------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
| component | TouchableOpacity | function | component for enclosing element (eg: TouchableHighlight, View, etc) |
| width | 34 | number | width for the Avatar |
| height | 34 | number | height for the Avatar |
| onPress | none | function | callback function when pressing component |
| onLongPress | none | function | callback function when long pressing component |
| containerStyle | none | object (style) | styling for outer container |
| source | none | object (image) | image source |
| avatarStyle | none | object (style) | style for avatar image |
| imageProps | none | object (ImageProperties) | optional properties to pass to the avatar e.g "resizeMode" |
| rounded | false | boolean | determines the shape of avatar |
| title | none | string | renders title in the avatar |
| titleStyle | none | object (style) | style for the title |
| overlayContainerStyle | none | object (style) | style for the view outside image or icon |
| activeOpacity | 0.2 | number | opacity when pressed |
| icon | none | object {name: string, color: string, size: number, type: string (default is material-community, or choose one of simple-line-icon, zocial, font-awesome, octicon, ionicon, foundation, evilicon, or entypo), iconStyle: object(style)} |
| iconStyle | none | object (style) | extra styling for icon component (optional) |
### Props

* [`activeOpacity`](#activeopacity)
* [`avatarStyle`](#avatarstyle)
* [`component`](#component)
* [`containerStyle`](#containerstyle)
* [`height`](#height)
* [`icon`](#icon)
* [`iconStyle`](#iconstyle)
* [`imageProps`](#imageprops)
* [`onLongPress`](#onlongpress)
* [`onPress`](#onpress)
* [`overlayContainerStyle`](#overlaycontainerstyle)
* [`rounded`](#rounded)
* [`source`](#source)
* [`title`](#title)
* [`titleStyle`](#titlestyle)
* [`width`](#width)

---

# Reference

### `activeOpacity`

Opacity when pressed

| Type | Default |
| :----: | :-----: |
| number | 0.2 |

---

### `avatarStyle`

Style for avatar image

| Type | Default |
| :------------: | :-----: |
| object (style) | none |

---

### `component`

Component for enclosing element (eg: TouchableHighlight, View, etc)

| Type | Default |
| :------: | :----------------: |
| function | TouchableHighlight |

---

### `containerStyle`

Styling for outer container

| Type | Default |
| :------------: | :-----: |
| object (style) | none |

---

### `height`

Height of the Avatar

| Type | Default |
| :----: | :-----: |
| number | 34 |

---

### `icon`

| Type | Default |
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----: |
| object {name: string, color: string, size: number, type: string (default is material-community, or choose one of simple-line-icon, zocial, font-awesome, octicon, ionicon, foundation, evilicon, or entypo), iconStyle: object(style)} | none |

---

### `iconStyle`

Extra styling for icon component (optional)

| Type | Default |
| :------------: | :-----: |
| object (style) | none |

---

### `imageProps`

Optional properties to pass to the avatar e.g "resizeMode"

| Type | Default |
| :----------------------: | :-----: |
| object (imageProperties) | none |

---

### `onLongPress`

Callback function when long pressing component

| Type | Default |
| :------: | :-----: |
| function | none |

---

### `onPress`

Callback function when pressing component

| Type | Default |
| :------: | :-----: |
| function | none |

---

### `overlayContainerStyle`

Style for the view outside image or icon

| Type | Default |
| :------------: | :-----: |
| object (style) | none |

---

### `rounded`

Makes the avatar circular

| Type | Default |
| :-----: | :-----: |
| boolean | false |

---

### `source`

Image source

| Type | Default |
| :------------: | :-----: |
| object (style) | none |

---

### `title`

Renders title in the avatar

| Type | Default |
| :----: | :-----: |
| string | none |

---

### `titleStyle`

Style for the title

| Type | Default |
| :------------: | :-----: |
| object (style) | none |

---

### `width`

Width of the avatar

| Type | Default |
| :----: | :-----: |
| number | 34 |
Loading

0 comments on commit ef403af

Please sign in to comment.