-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
1,064 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,25 @@ | ||
{ | ||
"name": "react-native-qrcode-svg", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "A QR Code generator for React Native based on react-native-svg and javascript-qrcode.", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "jest", | ||
"test-update": "npm run test -- --updateSnapshot", | ||
"lint-staged": "lint-staged", | ||
"lint": "standard 'src/**/*.js'", | ||
"2npm": "publish" | ||
}, | ||
"standard": { | ||
"env": [ | ||
"jest" | ||
], | ||
"parser": "babel-eslint" | ||
}, | ||
"pre-commit": "lint-staged", | ||
"lint-staged": { | ||
"*.js": "lint" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+ssh://[email protected]/awesomejerry/react-native-qrcode-svg.git" | ||
|
@@ -32,11 +44,15 @@ | |
"javascript-qrcode": "git+https://[email protected]/awesomejerry/javascript-qrcode.git" | ||
}, | ||
"devDependencies": { | ||
"babel-eslint": "^7.2.2", | ||
"babel-jest": "^19.0.0", | ||
"babel-preset-react-native": "^1.9.1", | ||
"jest": "^19.0.2", | ||
"lint-staged": "^3.4.0", | ||
"pre-commit": "^1.2.2", | ||
"publish": "^0.6.0", | ||
"react": "^15.4.2", | ||
"react-test-renderer": "^15.4.2" | ||
"react-test-renderer": "^15.4.2", | ||
"standard": "^10.0.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,21 @@ | ||
import React from 'react'; | ||
import React from 'react' | ||
|
||
export default function({ children }) { | ||
export default function ({ children }) { | ||
return ( | ||
<div> | ||
{children} | ||
{children} | ||
</div> | ||
); | ||
) | ||
} | ||
|
||
export const Rect = () => { | ||
return ( | ||
<span>Rect</span> | ||
); | ||
}; | ||
) | ||
} | ||
|
||
export const Path = () => { | ||
return ( | ||
<span>Path</span> | ||
); | ||
}; | ||
|
||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
import React, { PropTypes } from 'react'; | ||
import React, { PropTypes } from 'react' | ||
|
||
export const View = ({ children }) => { | ||
return ( | ||
<div>{children}</div> | ||
); | ||
}; | ||
) | ||
} | ||
|
||
export const Image = ({ source, resizeMode }) => { | ||
return ( | ||
<div> | ||
<span>Source: {source.uri ? source.uri : source}</span> | ||
<span>ResizeMode: {resizeMode}</span> | ||
</div> | ||
); | ||
}; | ||
) | ||
} | ||
Image.propTypes = { | ||
source: PropTypes.oneOfType([ | ||
PropTypes.number, | ||
PropTypes.shape({ | ||
uri: PropTypes.string, | ||
}), | ||
]), | ||
}; | ||
uri: PropTypes.string | ||
}) | ||
]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
import React from 'react'; | ||
import QRCode from '../index'; | ||
import renderer from 'react-test-renderer'; | ||
import React from 'react' | ||
import QRCode from '../index' | ||
import renderer from 'react-test-renderer' | ||
|
||
describe('QRCode', () => { | ||
it('renders correctly', () => { | ||
const tree = renderer.create( | ||
<QRCode /> | ||
).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
).toJSON() | ||
expect(tree).toMatchSnapshot() | ||
}) | ||
|
||
it('renders with logo correctly', () => { | ||
const tree = renderer.create( | ||
<QRCode | ||
logo={{ uri: 'fakeUri' }} | ||
/> | ||
).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
}); | ||
).toJSON() | ||
expect(tree).toMatchSnapshot() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { QrCode } from 'javascript-qrcode'; | ||
import { QrCode } from 'javascript-qrcode' | ||
|
||
export default (value) => { | ||
const qrcode = new QrCode(value); | ||
return qrcode.getData(); | ||
}; | ||
const qrcode = new QrCode(value) | ||
return qrcode.getData() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.