Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
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
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Shoutem UI is a set of styleable components that enables you to build beautiful

```
$ npm install --save @shoutem/ui
$ react-native link # No need to run this with Exponent
$ react-native link # No need to run this with Expo
```

## Docs
Expand All @@ -26,7 +26,7 @@ To see how Shoutem UI works, you can:

### Examples component

**If you are using Exponent, see [this
**If you are using Expo, see [this
project](https://github.com/exponentjs/shoutem-example/blob/master/main.js)
for example usage. Otherwise, follow the steps below.**

Expand All @@ -43,22 +43,19 @@ $ npm install --save @shoutem/ui
$ react-native link
```

Now, simply copy the following to your `index.ios.js` files of the React Native project:
Now, simply copy the following to your `App.js` files of the React Native project:

```JavaScript
import React, { Component } from 'react';
import { AppRegistry } from 'react-native';
import { Examples } from '@shoutem/ui';

class HelloWorld extends Component {
export default class App extends Component<{}> {
render() {
return (
<Examples />
);
}
}

AppRegistry.registerComponent('HelloWorld', () => HelloWorld);
```

Finally, run the app!
Expand Down Expand Up @@ -114,5 +111,3 @@ It consists of three libraries:

[The BSD License](https://opensource.org/licenses/BSD-3-Clause)
Copyright (c) 2016-present, [Shoutem](http://shoutem.github.io)


5 changes: 5 additions & 0 deletions components/DropDownMenu/DropDownModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
ListView,
LayoutAnimation,
Dimensions,
NativeModules,
} from 'react-native';
import _ from 'lodash';

Expand Down Expand Up @@ -212,6 +213,10 @@ class DropDownModal extends Component {
color: bufferColor
}];

if(!NativeModules.BVLinearGradient){
Copy link
Contributor

Choose a reason for hiding this comment

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

Put it on top of the function.

return null;
}

return (
<LinearGradient
pointerEvents="none"
Expand Down
2 changes: 1 addition & 1 deletion components/Image.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { PureComponent } from 'react';
import {
Image as RNImage,
ImageBackground as RNImage,
Platform,
} from 'react-native';
import _ from 'lodash';
Expand Down
2 changes: 0 additions & 2 deletions components/ImagePreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ class ImagePreview extends Component {
componentWidth={width}
componentHeight={height}
source={source}
resizeMode={'contain'}
/>
{closeButton}
</View>
Expand All @@ -91,7 +90,6 @@ class ImagePreview extends Component {
source={source}
width={width}
height={height}
resizeMode="contain"
/>
</TouchableOpacity>
</View>
Expand Down
2 changes: 1 addition & 1 deletion components/RichMedia.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import { Html } from '../html';

export default function RichMedia({ body }) {
console.warn('RichMedia is deprecated and will be removed in next versions.');
console.warn("'RichMedia' is deprecated and will be removed soon. Use 'Html' instead.");
return <Html body={body} />;
}

Expand Down
4 changes: 2 additions & 2 deletions examples/RestaurantsApp/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["react-native"]
}
"presets": ["react-native"]
}
6 changes: 0 additions & 6 deletions examples/RestaurantsApp/.eslintignore

This file was deleted.

22 changes: 0 additions & 22 deletions examples/RestaurantsApp/.eslintrc

This file was deleted.

18 changes: 10 additions & 8 deletions examples/RestaurantsApp/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,37 @@
; For RN Apps installed via npm, "Libraries" folder is inside
; "node_modules/react-native" but in the source repo it is in the root
.*/Libraries/react-native/React.js
.*/Libraries/react-native/ReactNative.js

; Ignore polyfills
.*/Libraries/polyfills/.*

[include]

[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow
flow/
node_modules/react-native/flow/

[options]
emoji=true

module.system=haste

experimental.strict_type_args=true

munge_underscores=true

module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
suppress_type=$FixMe

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-8]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-8]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-6]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-6]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

unsafe.enable_getters_and_setters=true

[version]
^0.38.0
^0.56.0
8 changes: 4 additions & 4 deletions examples/RestaurantsApp/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ buck-out/
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
# https://docs.fastlane.tools/best-practices/source-control/

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ import { createStore, applyMiddleware } from 'redux';
import { Provider } from 'react-redux';
import thunk from 'redux-thunk';

import reducer from './app/redux';
import App from './app/App';
import reducer from './redux';
import Restaurants from './screens/Restaurants';

const createStoreWithMiddleware = applyMiddleware(thunk)(createStore);
const store = createStoreWithMiddleware(reducer);

export default class Root extends Component {
export default class App extends Component {
render() {
return (
<Provider store={store}>
<App />
<Restaurants />
</Provider>
);
}
Expand Down
12 changes: 12 additions & 0 deletions examples/RestaurantsApp/__tests__/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import 'react-native';
import React from 'react';
import App from '../App';

// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';

it('renders correctly', () => {
const tree = renderer.create(
<App />
);
});
53 changes: 26 additions & 27 deletions examples/RestaurantsApp/android/app/BUCK
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import re

# To learn about Buck see [Docs](https://buckbuild.com/).
# To run your application with Buck:
# - install Buck
Expand All @@ -11,56 +9,57 @@ import re
#

lib_deps = []

for jarfile in glob(['libs/*.jar']):
name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile)
name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')]
lib_deps.append(':' + name)
prebuilt_jar(
name = name,
binary_jar = jarfile,
)

for aarfile in glob(['libs/*.aar']):
name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile)
name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
lib_deps.append(':' + name)
android_prebuilt_aar(
name = name,
aar = aarfile,
)

android_library(
name = 'all-libs',
exported_deps = lib_deps
name = "all-libs",
exported_deps = lib_deps,
)

android_library(
name = 'app-code',
srcs = glob([
'src/main/java/**/*.java',
]),
deps = [
':all-libs',
':build_config',
':res',
],
name = "app-code",
srcs = glob([
"src/main/java/**/*.java",
]),
deps = [
":all-libs",
":build_config",
":res",
],
)

android_build_config(
name = 'build_config',
package = 'com.shoutemrestaurants',
name = "build_config",
package = "com.restaurantsapp",
)

android_resource(
name = 'res',
res = 'src/main/res',
package = 'com.shoutemrestaurants',
name = "res",
package = "com.restaurantsapp",
res = "src/main/res",
)

android_binary(
name = 'app',
package_type = 'debug',
manifest = 'src/main/AndroidManifest.xml',
keystore = '//android/keystores:debug',
deps = [
':app-code',
],
name = "app",
keystore = "//android/keystores:debug",
manifest = "src/main/AndroidManifest.xml",
package_type = "debug",
deps = [
":app-code",
],
)
16 changes: 13 additions & 3 deletions examples/RestaurantsApp/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ import com.android.build.OutputFile
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
Expand All @@ -58,13 +65,17 @@ import com.android.build.OutputFile
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"]
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/

project.ext.react = [
entryFile: "index.js"
]

apply from: "../../node_modules/react-native/react.gradle"

/**
Expand All @@ -87,7 +98,7 @@ android {
buildToolsVersion "23.0.1"

defaultConfig {
applicationId "com.shoutemrestaurants"
applicationId "com.restaurantsapp"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
Expand Down Expand Up @@ -127,7 +138,6 @@ android {

dependencies {
compile project(':react-native-photo-view')
compile project(':react-native-share')
compile project(':react-native-linear-gradient')
compile project(':react-native-vector-icons')
compile fileTree(dir: "libs", include: ["*.jar"])
Expand Down
4 changes: 4 additions & 0 deletions examples/RestaurantsApp/android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@

-dontwarn com.facebook.react.**

# TextLayoutBuilder uses a non-public Android constructor within StaticLayout.
# See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details.
-dontwarn android.text.StaticLayout

# okhttp

-keepattributes Signature
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.shoutemrestaurants"
package="com.restaurantsapp"
android:versionCode="1"
android:versionName="1.0">

Expand Down
Binary file not shown.
Binary file modified examples/RestaurantsApp/android/app/src/main/assets/fonts/rubicon-icon-font.ttf
100755 → 100644
Binary file not shown.
Loading