Skip to content

Instantly share code, notes, and snippets.

View browniefed's full-sized avatar
🎧
Building

Jason Brown browniefed

🎧
Building
View GitHub Profile
View .babelrc
{
"presets": ["next/babel", "@emotion/babel-preset-css-prop"],
"plugins": [
[
"prismjs",
{
"languages": [
"javascript",
"css",
"markup",
View codegen.js
module.exports = {
overwrite: true,
generates: {
"./data/index.tsx": {
schema: [
{
"http://localhost:8081/v1/graphql": {
headers: {
"x-hasura-role": "anonymous"
}
View setup.md

Consuming Package

Setup this as an .npmrc in a consumer

always-auth=true
@github-org:registry=https://npm.pkg.github.com/github-org/
_authToken=TOKEN
//npm.pkg.github.com/:_authToken=TOKEN
View wat.jsx
import React from "react";
import ReactModal from "react-modal";
import styled from "react-emotion";
export interface ModalProps {
open: boolean;
contentLabel?: string;
onClose: Function;
}
View nav.js
import React from "react";
import { StyleSheet, Text, View, TouchableOpacity } from "react-native";
import { StackNavigator } from "react-navigation";
const Home = ({ navigation }) => {
return (
<View style={styles.container}>
<TouchableOpacity onPress={() => navigation.push("OtherStack")}>
// push will only go to "OtherStack" but because we are now inside of "OtherStack" and it's new nested StackNavigator. There is no "OtherStack" just "Meow" and "Blue".
// If we do "navigate" instead it would keep navigating forever
View graph.jsx
import { StyleSheet, View, Text, ActivityIndicator } from "react-native";
import Sizer from "react-native-size";
import {
VictoryChart,
VictoryLine,
VictoryTheme,
VictoryAxis,
VictoryContainer,
VictoryCursorContainer,
Line,
View reactnav.jsx
import React from "react";
import { StyleSheet, Text, View, TouchableOpacity } from "react-native";
import { StackNavigator, DrawerNavigator, NavigationActions } from "react-navigation";
const ScreenFirst = (props) => (
<View>
<TouchableOpacity onPress={() => props.screenProps.onOpen()}>
<Text>Pop Up Something Cool</Text>
</TouchableOpacity>
View index.js
import React from "react";
import { render } from "react-dom";
import { BrowserRouter, Switch, Route } from "react-router-dom";
import RenderTo from "./render_to";
import Header from "./components/header";
import Nav from "./components/nav";
import Home from "./pages/home";
import AccountsReview from "./pages/accounts_review";
View bug.js
const NavItem = styled.li(
{
margin: "15px 0",
},
({ sub }) => ({
fontSize: ".8rem"
}),
);
<NavItem sub />