Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

<FileTabs /> #8

Open
wants to merge 38 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
12cc28f
- first iteration
Jan 13, 2017
7395dc6
- added onPress listener
Jan 16, 2017
aadc6f9
- added unit and e2e tests
Jan 16, 2017
dc55d6e
- updated readme
Jan 17, 2017
de41acf
<Carousel /> (#5)
Jan 17, 2017
a03438a
- first iteration
Jan 13, 2017
72fe6a5
- added unit and e2e tests
Jan 16, 2017
a3c8461
- fixes after review
Jan 17, 2017
bb5f175
- updated unit tests and paths in e2e tests
Jan 17, 2017
862c7a7
- fixes after review 2
Jan 17, 2017
2fc4eb3
- first iteration
Jan 13, 2017
59535c6
- added unit and e2e tests
Jan 16, 2017
1545afa
- first iteration
Jan 13, 2017
8e02f8b
- added unit and e2e tests
Jan 16, 2017
15a4280
- Renamed to FileTabs, make text font size larger and bold, add more …
Jan 20, 2017
e30ef36
- Used our themes for FileTabs
Jan 23, 2017
43d17b6
- first iteration
Jan 13, 2017
a7d8959
- added onPress listener
Jan 16, 2017
b45bf95
- added unit and e2e tests
Jan 16, 2017
47fbda7
- first iteration
Jan 13, 2017
70ae34c
- added unit and e2e tests
Jan 16, 2017
e77882d
- fixes after review
Jan 17, 2017
a3805fc
- updated unit tests and paths in e2e tests
Jan 17, 2017
33e2cb1
- fixes after review 2
Jan 17, 2017
f2ecbe5
- Renamed to FileTabs, make text font size larger and bold, add more …
Jan 20, 2017
39a8739
- Used our themes for FileTabs
Jan 23, 2017
b21df44
- first iteration
Jan 13, 2017
2932729
- added onPress listener
Jan 16, 2017
65c89a5
- added unit and e2e tests
Jan 16, 2017
4b06aea
- first iteration
Jan 13, 2017
b128c4b
- added unit and e2e tests
Jan 16, 2017
dfe1c47
- fixes after review
Jan 17, 2017
9565047
- updated unit tests and paths in e2e tests
Jan 17, 2017
539700d
- fixes after review 2
Jan 17, 2017
c9e24e7
- e2e test fixes
Jan 23, 2017
a63c737
- remove duplicate ColoredTabs classes and tests
Jan 23, 2017
00a6a34
Rebase done right
Jan 24, 2017
50d3316
- changes after review
Jan 27, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,54 @@ React Native Tipsi custom UI elements

## Components

### `<ColoredTabs />`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No description provided.


Customizable colored tabs.

#### ColoredTabs Props
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FileTabs


| Name | Desc | Type | Default
| --- | --- | --- | --- |
| `selected` | id of selected tab. | String | `first tab`
| `onPress` | Handle press on tab action. Receive id of selected tab as argument. | Function | `() => {}`


#### ColoredTabs.Item Props
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FileTabs


| Name | Desc | Type | Default
| --- | --- | --- | --- |
| `title` | Text of tab. | String | `undefined`
| `color` | Color of tab | String | `#82909d`
| `id` | Tab id. This id will passed to `onPress` for identify action. | String | `undefined`
| `active` | Show item as active | Boolean | `false`
| `onPress` | Handle press action | Function | `() => {}`

#### Example


```js
import React, { PureComponent } from 'react'
import { ColoredTabs } from 'tipsi-ui-kit'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FileTabs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FileTabs


class Example extends PureComponent {
handlePress = id => console.log(`Tab with id ${id} is clicked!`)

const Example = () => (
<ColoredTabs onPress={this.handlePress}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FileTabs

<ColoredTabs.Item id="0" title="One" color="crimson" />
<ColoredTabs.Item id="1" title="Two" color="orange" />
<ColoredTabs.Item id="2" title="Three" color="chartreuse" />
<ColoredTabs.Item id="3" title="Four" color="dodgerblue" />
</ColoredTabs>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FileTabs

)
}
```

#### Preview

![tabs_ios](https://cloud.githubusercontent.com/assets/4946753/22029399/1f3905c2-dce3-11e6-8c83-5142fdeb4351.png)
![tabs_android](https://cloud.githubusercontent.com/assets/4946753/22029396/1af713e6-dce3-11e6-8f1a-64e4706bf581.png)

### `<Dash />`

Component to draw customisable dashed lines
Expand Down
46 changes: 46 additions & 0 deletions __tests__/e2e/09_FileTabs.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import test from 'tape-async'
import helper from 'tipsi-appium-helper'

const { driver, select, idFromXPath } = helper

test('<FileTabs />', async (t) => {
const tabsGroupId = select({
ios: idFromXPath(`//
XCUIElementTypeScrollView[1]/*/*/
XCUIElementTypeOther[2]/XCUIElementTypeOther[1]
`),
android: idFromXPath(`//
android.widget.ScrollView[1]/android.view.View[1]/android.view.View[1]
`),
})
const tagItemId = select({
ios: idFromXPath(`
${tabsGroupId}/XCUIElementTypeOther[tabId]
`),
android: idFromXPath(`
${tabsGroupId}/android.view.View[tabId]
`),
})

try {
await helper.openExampleFor('<FileTabs />')

for (const tabId of [1, 2, 3, 4]) {
const currentTabId = select({
ios: tagItemId.replace('tabId', tabId),
android: tagItemId.replace('tabId', tabId + 1),
})
await driver.waitForVisible(currentTabId, 20000)
await driver.click(currentTabId)

t.pass(`tab ${tabId} clicked`)
}

t.pass('<FileTabs /> example should be visible')
} catch (error) {
await helper.screenshot()
await helper.source()

throw error
}
})
Loading