Skip to content

Instantly share code, notes, and snippets.

View JoshK2's full-sized avatar
:electron:
Focusing

Josh Kuttler JoshK2

:electron:
Focusing
View GitHub Profile
@JoshK2
JoshK2 / products-list-store-1.js
Created June 4, 2020 13:02
Store - products list component
import React from 'react';
import {StyleSheet, View} from 'react-native';
import PropTypes from 'prop-types';
import {Product} from './product';
const styles = StyleSheet.create({
container: {flex: 1, alignItems: 'center', justifyContent: 'flex-start'},
});
const ProductsList = ({list}) => {
@JoshK2
JoshK2 / product-store-1.js
Created June 4, 2020 12:59
Store - product component
import React from 'react';
import {StyleSheet, View, Text, Image, Alert} from 'react-native';
import PropTypes from 'prop-types';
import {Button} from './button';
const styles = StyleSheet.create({
container: {
shadowColor: '#cdcdcd',
shadowOffset: {width: 5, height: 5},
shadowOpacity: 0.5,
@JoshK2
JoshK2 / button-store-1.js
Last active June 4, 2020 12:58
Store - button component
import React from 'react';
import {StyleSheet, TouchableHighlight, Text} from 'react-native';
import PropTypes from 'prop-types';
const styles = StyleSheet.create({
button: {
backgroundColor: '#000000bf',
borderRadius: 30,
paddingHorizontal: 9,
paddingVertical: 12,
@JoshK2
JoshK2 / import-all.js
Last active February 24, 2022 10:07
Import all components from a collection at bit.dev
//IMPORTANT - install thie before: npm i child-process-promise --save-dev
/*
put this in your package.json script:
"import-all": "node import-all.js"
npm run import-all <user>.<collection> amount
*/
const exec = require('child-process-promise').exec;
const args = process.argv;
@JoshK2
JoshK2 / bitconfig.json
Created October 27, 2019 15:22
Create React typescript components library - update bit config in package.json
"bit": {
"env": {
"compiler": "bit.envs/compilers/typescript@3.0.35",
"tester": "bit.envs/testers/jest@22.4.3"
},
"componentsDefaultDirectory": "components/{name}",
"packageManager": "npm",
"overrides": {
"*": {
"dependencies": {
@JoshK2
JoshK2 / brtci-Link.tsx
Created October 23, 2019 15:42
simple Link component - build react typescript component in isolation
@JoshK2
JoshK2 / brtci-Alert.tsx
Last active March 23, 2023 02:21
simple Alert component - build react typescript component in isolation
import React, { Component, CSSProperties } from 'react';
import Link from './Link';
type AlertProps = {
text: string,
bgColor?: string,
link?: string
}
const css: CSSProperties = {
@JoshK2
JoshK2 / brtci-Button.tsx
Created October 23, 2019 13:36
simple Button component - build react typescript component in isolation
import React, { Component, CSSProperties } from 'react';
type ButtonProps = {
text: string,
disable?: boolean,
onClick: Function
}
const css: CSSProperties = {
padding: '5px 9px',
@JoshK2
JoshK2 / crcl-alert.scss
Created September 7, 2019 19:47
Create React typescript components library - using variables from another scss file
@import '../../styles/variables.scss';
.alert {
position: relative;
padding: .75rem 1.25rem;
margin-bottom: 1rem;
border: 1px solid transparent;
border-radius: .25rem;
width: fit-content;
&.primary {
@JoshK2
JoshK2 / crcl-variables.scss
Created September 7, 2019 19:42
Create React typescript components library - variables scss file
$primaryColor: #cce5ff;
$secondaryColor: #e2e3e5;
$successColor: #d4edda;
$dangerColor: #f8d7da;
$warningColor: #fff3cd;
$infoColor: #d1ecf1;