react-web-native-sketch
v0.0.43
Published
[TODO: We need an overview of how this can be used via npm vs as a local package]
Downloads
55
Readme
Getting started
[TODO: We need an overview of how this can be used via npm vs as a local package]
Install dependencies (for local dev)
You will need to install the following dependencies:
- Yarn
https://yarnpkg.com/en/docs/install
- Yalc
https://github.com/whitecolor/yalc
oryarn global add yalc
npm i yalc -g
How to use (for local dev)
Run this from
ics-primitives
root:yarn yarn build yalc publish # this publishes code to local yalc repo
Go to your development project (e.g.
instacar-front
) and run (remember to run this after everyyarn
ornpm install
):yalc link react-web-native-sketch
When making code changes to
ics-primitives
run (fromics-primitives
root):Run:
yarn build # run this if necessary yalc push
Refresh web page
How to Add Styles
Styles can be specified like this:
// platform before class name
import {web, ios, android} from 'src/utils/theme';
const styles = {
container: {
[web]: {
padding: 1,
},
[ios]: {
padding: 2,
},
[android]: {
padding: 3,
},
[all]: {
padding: 4,
},
}
}
or
// platform inside class styles
import {web, native, all} from 'src/utils/theme';
const styles = {
container: {
padding: {
[web]: 1,
[native]: 2,
[all]: 3
},
}
}
Things to pay attention to:
- On web, styles cascade to children. This does not happen in sketch (and native?).
How to add sketch to a project
add sketch-manifest.json (similar to the one in this repo)
in package.json add
"skpm": { "main": "your_repo_name.sketchplugin", "manifest": "./sketch-manifest.json" }, "scripts": { "render": "skpm-build --watch --run & npm run typescript", }
add
your_repo_name.sketchplugin
to .gitignore
TODO
- Add internationalization (using context maybe?)
- Add the rest of form components
- select
- checkbox
- radio group
- photo upload
- array of photos
- array of objects
- date/time picker
- Document components
- Navigation (native and web)
- Dialogs
- Alerts