Skip to content

Commit

Permalink
Merge branch 'master' into docs/overview-examples
Browse files Browse the repository at this point in the history
  • Loading branch information
32penkin committed Aug 20, 2019
2 parents 819a603 + 1b2211c commit e65bcaa
Show file tree
Hide file tree
Showing 113 changed files with 7,313 additions and 2,443 deletions.
28 changes: 5 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,14 @@ There is a huge variety of customizable layouts, use “as is” or add new bloc

## Quick Start

Install UI Kitten and Eva Design System packages via npm:
Start a new app with UI Kitten template from a scratch:

```bash
npm i react-native-ui-kitten @eva-design/eva
react-native init --template ui-kitten
```

Modify your application root:

```jsx
import React from 'react';
import { mapping, light as lightTheme } from '@eva-design/eva';
import { ApplicationProvider, Layout } from 'react-native-ui-kitten';

const App = () => (
<ApplicationProvider
mapping={mapping}
theme={lightTheme}>
<Layout style={{flex: 1}}/>
</ApplicationProvider>
);

export default App;
```

The code above will configure your application component to apply Eva Design System styling magic.
Read the [Design System guide][link:doc-theme-system] for more details.
This will setup a new React Native application configured with UI Kitten.
Refer to the [Documentation][link:doc-where-start] for more options to start.

## How can I support the developers?
- Star our GitHub repo :star:
Expand All @@ -83,7 +65,7 @@ We're always happy to receive your feedback!
[link:travis]: https://travis-ci.com/akveo/react-native-ui-kitten
[link:coveralls]: https://coveralls.io/github/akveo/react-native-ui-kitten?branch=master
[link:doc-homepage]: https://akveo.github.io/react-native-ui-kitten
[link:doc-theme-system]: https://akveo.github.io/react-native-ui-kitten/docs/design-system/eva-design-system-intro
[link:doc-where-start]: https://akveo.github.io/react-native-ui-kitten/docs/getting-started/where-to-start
[link:kitten-tricks]: https://github.com/akveo/kittenTricks
[link:eva-icons]: https://github.com/akveo/eva-icons
[link:akveo-homepage]: https://akveo.com
Expand Down
17 changes: 11 additions & 6 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
const path = require('path');

const kittenPath = path.resolve('./src/framework');

// FIXME: Resolve `transform[stderr]: Could not resolve` command-line warnings.
// FIXME: Reproducible when starting with clearing cache (npm start -- -c)
/**
* UI Kitten modules aliases.
* Allows importing framework modules into playground
*/
const moduleAliases = {
'react-native-ui-kitten': path.resolve(__dirname, './src/framework'),
'@kitten/theme': path.resolve(__dirname, './src/framework'),
'@kitten/ui': path.resolve(__dirname, './src/framework'),
'@ui-kitten/eva-icons': path.resolve(__dirname, './src/eva-icons'),
};

const moduleResolverConfig = {
root: path.resolve('./'),
alias: {
'@kitten/theme': path.resolve(kittenPath, 'theme'),
'@kitten/ui': path.resolve(kittenPath, 'ui'),
...moduleAliases,
},
};

Expand Down
1 change: 0 additions & 1 deletion config/dev.env.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const evaPath = path.resolve(__dirname, '../../eva');

module.exports = {
ENV: 'dev',
KITTEN_PATH: path.resolve(__dirname, '../src/framework'),
MAPPING_PATH: path.resolve(evaPath, 'packages/eva'),
PROCESSOR_PATH: path.resolve(evaPath, 'packages/processor')
};
1 change: 0 additions & 1 deletion config/prod.env.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const playgroundPath = path.resolve(__dirname, '../src/playground');

module.exports = {
ENV: 'prod',
KITTEN_PATH: path.resolve(__dirname, '../src/framework'),
MAPPING_PATH: path.resolve(playgroundPath, 'node_modules/@eva-design/eva'),
PROCESSOR_PATH: path.resolve(__dirname, '../node_modules/@eva-design/processor')
};
7 changes: 5 additions & 2 deletions docs/src/articles/getting-started/where-to-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ UI Kitten is a framework of UI components powered by Eva Design System for your

## Quick start tutorials

**[Install UI Kitten](guides/install-ui-kitten)**
- **[Start a new App](guides/start-a-new-app)**

This tutorial explains how to setup React Native app with UI Kitten.
This tutorial explains how to setup React Native app with UI Kitten from a scratch.

- **[Install into existing App](guides/install-into-existing-app)**

Please consider creating an issue on GitHub if your use case is not described above. But we kindly ask to always look through the documentation and the list of existing issues first.


<hr>

## I'm new to React Native or mobile development
Expand Down
37 changes: 37 additions & 0 deletions docs/src/articles/guides/install-existing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Add into existing project

If you already have an existing code base, you're able to give UI Kitten a try as simple as `npm install`. Please refer to [Start a new App Guide](guides/start-a-new-app) if you don't have any code yet.

<hr>

## Install UI Kitten and Eva Design System

```bash
npm i react-native-ui-kitten @eva-design/eva
```

<hr>

## Configure Application Root

At this step you have everything in place, let's configure UI Kitten to be used in your app.
In your **App.js**:

```js
import React from 'react';
import { mapping, light as lightTheme } from '@eva-design/eva';
import { ApplicationProvider } from 'react-native-ui-kitten';
import { RootComponent } from '../path-to/root.component'; // <-- Import your application entry point

const App = () => (
<ApplicationProvider
mapping={mapping}
theme={lightTheme}>
<RootComponent />
</ApplicationProvider>
);

export default App;
```

That's it. UI Kitten is ready now.
30 changes: 30 additions & 0 deletions docs/src/articles/guides/install-new.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Starting a new App

If you don't have any code yet, please consider checking <a href="https://facebook.github.io/react-native/docs/getting-started" target="_blank">React Native Getting Started</a> documentation for help creating your app.

<hr>

## Installation

First of all, you should have React Native CLI installed.

```bash
npm i -g react-native-cli
```

<hr>

## Create a New Project

A new project can be created using React Native CLI tools ant UI Kitten template.

```bash
react-native init --template ui-kitten
```

Or, if you want to init with TypeScript:
```bash
react-native init --template ui-kitten-typescript
```

That's it. UI Kitten is ready now. For the next steps, simply follow command line instructions.
54 changes: 0 additions & 54 deletions docs/src/articles/guides/install.md

This file was deleted.

67 changes: 67 additions & 0 deletions docs/src/articles/guides/setup-icons-module.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Setup Icons Module

Starting from UI Kitten 4.2, we introduce an icons module built on top of <a href="https://akveo.github.io/eva-icons" target="_blank">Eva Icons</a>. Eva Icons is a pack of beautifully crafted Open Source icons for common actions and items.

<div class="note note-info">
<div class="note-title">IMPORTANT</div>
<div class="note-body">
This tutorial assumes you have everything in place and [ApplicationProvider is configured](guides/install-ui-kitten).
</div>
</div>

<hr>

## Installation

First, ensure that `react-native-svg` library is installed: **<a href="https://github.com/react-native-community/react-native-svg#installation" target="_blank">install react-native-svg</a>**.

Add `@ui-kitten/eva-icons` to project dependencies.

```bash
npm i @ui-kitten/eva-icons
```

<hr>

## Configure Icon Registry

```js
import * as React from 'react';
import { mapping, light as lightTheme } from '@eva-design/eva';
import { EvaIconsPack } from '@ui-kitten/eva-icons';
import { ApplicationProvider, Layout, IconRegistry } from 'react-native-ui-kitten';

const App = () => (
<ApplicationProvider
mapping={mapping}
theme={lightTheme}>
<IconRegistry icons={EvaIconsPack}/>
<Layout style={{flex: 1}}/>
</ApplicationProvider>
);

export default App;
```

<hr>

## Use it with UI Kitten components

```js
import * as React from 'react';
import { Button, Icon } from 'react-native-ui-kitten';

export const FacebookIcon = (style) => (
<Icon name='facebook' {...style} />
);

export const LoginButton = () => (
<Button icon={FacebookIcon}>Login with Facebook</Button>
);
```

That's it. UI Kitten with Eva Icons is ready now.

As a result, you should have a Button looking similar to this:

![image](assets/images/articles/guides/sample-icon-button.png)

0 comments on commit e65bcaa

Please sign in to comment.