Skip to content

Instantly share code, notes, and snippets.

View kamilkulik's full-sized avatar
🚀
I deliver web apps to people

kamilkulik

🚀
I deliver web apps to people
View GitHub Profile
@kamilkulik
kamilkulik / curl.md
Last active August 24, 2021 06:36 — forked from subfuzion/curl.md
curl

DOCUMENTATION: https://curl.se/docs/manpage.html

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

<TouchableOpacity
onPress={() => {
const permission = props.permissions.cameraAccess;
permission === 'granted' ? props.setCameraAccess('denied') : props.setCameraAccess('granted')
}}
>
<Icon
name={ props.permissions.cameraAccess === 'granted' ? 'check-box' : 'check-box-outline-blank' } type='material'
/>
</TouchableOpacity>
<Icon
name={ props.permissions.cameraAccess === 'granted' ? 'check-box' : 'check-box-outline-blank' }
type='material'
/>
const mapStateToProps = (state) => ({
permissions: state.permissions
}
);
export default connect(mapStateToProps, mapDispatchToProps)(Card);
// And destructure props that our component gets:
const Card = ({ setCameraAccess }) => {
return (
<View></View>
)
};
const mapDispatchToProps = (dispatch) => ({
setCameraAccess: (status) => dispatch(setCameraAccess(status)),
});
import { connect } from 'react-redux';
const Card = (props) => {
return (
<View></View>
)
};
export default connect()(Card);
import { Provider } from 'react-redux';
export default class App() {
return (
<Provider store={store}>
<NavigationContainer>
{/* Screen configuration */}
</NavigationContainer>
</Provider>
);
export default () => {
const store = createStore({ permissions: permissionsReducer });
return store
};
@kamilkulik
kamilkulik / step7.js
Last active April 21, 2020 18:22
Step 7
export default (state = permissionsReducerDefaultState, action) => {
switch (action.type) {
case 'SET_CAMERA_ACCESS':
return {
…state,
cameraAccess: action.status
}
case 'SET_PHOTOS_ACCESS':
return {
…state,