Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

prepsmith-react-native-components

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prepsmith-react-native-components - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

__examples__/.dockerignore

49

package.json
{
"name": "prepsmith-react-native-components",
"version": "0.1.1",
"version": "0.1.2",
"description": "",
"main": "src/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"doc": "react-docgen src/components/**/index.js | ./buildDocs.sh",
"lint": "npm run lint:js",
"lint:eslint":
"eslint --ignore-path .gitignore --ignore-pattern internals/scripts",
"lint:js": "npm run lint:eslint -- . ",
"lint:staged": "lint-staged",
"pretest": "npm run test:clean && npm run lint",
"test:clean": "rimraf ./coverage",
"test": "NODE_ENV=test jest --coverage"
},
"lint-staged": {
"*.js": "lint:eslint"
},
"pre-commit": "lint:staged",
"repository": {

@@ -23,5 +35,34 @@ "type": "git",

"devDependencies": {
"react": ">=15.0.0",
"react-native": ">=0.24.0"
"babel-eslint": "7",
"babel-preset-react-native": "^4.0.0",
"eslint": "^4.6.1",
"eslint-config-standard": "^10.2.1",
"eslint-config-standard-react": "^5.0.0",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-node": "^5.1.1",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-react": "^7.3.0",
"eslint-plugin-standard": "^3.0.1",
"enzyme": "^3.2.0",
"enzyme-adapter-react-16": "^1.1.0",
"jest": "^21.2.1",
"lint-staged": "^5.0.0",
"pre-commit": "^1.2.2",
"react": ">=16.0.0",
"react-docgen": "^2.20.0",
"react-dom": "^16.2.0",
"react-native": ">=0.24.0",
"react-test-renderer": "^16.1.1",
"rimraf": "^2.6.2",
"sinon": "^4.1.3"
},
"jest": {
"preset": "react-native",
"setupTestFrameworkScriptFile": "./__tests__/setup.js",
"testRegex": "__tests__/.*\\.test\\.js$",
"unmockedModulePathPatterns": [
"node_modules/react/",
"node_modules/enzyme/"
]
}
}
# Prepsmith React Native Components
## Get Start
### Install Dependencies
```bash
npm install -g yarn
yarn install
```
### Generate Documentation
```bash
yarn run doc
```
Then check `DOC.md`
### Test
```bash
yarn test
```
### Lint
```bash
yarn run lint
```
## Example
For `AnswerSelectionPicker` component.
```jsx

@@ -6,0 +37,0 @@ <AnswerSelectionPicker

34

src/components/AnswerSelectionPicker/index.js

@@ -15,9 +15,6 @@ import React, { Component } from 'react'

static defaultProps = {
onSelect: function({ isRight }) {
return false
},
rightAnswerStyle: { backgroundColor: 'rgba(0, 255, 0, 0.3)' },
wrongAnswerStyle: { backgroundColor: 'rgba(255, 0, 0, 0.3)' },
selected: null,
onSelect: function({ index, correct }) {
onSelect: function ({ index, correct }) {
return false

@@ -27,3 +24,3 @@ }

constructor(props) {
constructor (props) {
super(props)

@@ -35,3 +32,3 @@

_getStyle({ answer, index }) {
_getStyle ({ answer, index }) {
if (this.props.selected !== null && answer.isRight) {

@@ -48,15 +45,6 @@ return this.props.rightAnswerStyle

_ListAnswers({ answer, index }) {
let percentage = Math.random()
_ListAnswers ({ answer, index }) {
return (
<TouchableOpacity
key={index}
style={[
{
padding: 15,
marginBottom: 1,
flexDirection: 'column'
},
this._getStyle({ answer, index })
]}
onPress={() => {

@@ -66,3 +54,13 @@ this.props.onSelect({ index, isCorrect: answer.isRight })

>
<Text>{answer.text}</Text>
<Text
style={[
{
padding: 15,
marginBottom: 1
},
this._getStyle({ answer, index })
]}
>
{answer.text}
</Text>
</TouchableOpacity>

@@ -72,3 +70,3 @@ )

render() {
render () {
return (

@@ -75,0 +73,0 @@ <View>

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc