Skip to content

Instantly share code, notes, and snippets.

View trinwin's full-sized avatar
:octocat:
Creating 

Trinity Nguyen trinwin

:octocat:
Creating 
  • Apple
  • San Francisco Bay Area
View GitHub Profile
{
"presets": ["@babel/preset-env", "@babel/preset-react", "@babel/preset-flow"],
"plugins": [
"@babel/plugin-transform-runtime",
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-transform-modules-commonjs",
"@babel/plugin-proposal-class-properties"
],
"env": {
"development": {
module.exports = {
collectCoverageFrom: [
'**/*.{ts,tsx}',
'!**/node_modules/**',
'!**/.storybook/**',
'!**/tests/**',
'!**/coverage/**',
'!jest.config.js',
],
coverageThreshold: {
const enzyme = require('enzyme');
const Adapter = require('enzyme-adapter-react-16');
enzyme.configure({ adapter: new Adapter() });
const path = require("path");
module.exports = {
stories: ["../components/**/*.stories.tsx"],
addons: ["@storybook/preset-typescript"],
// Add nextjs preset
presets: [path.resolve(__dirname, "./next-preset.js")],
};
const path = require('path');
module.exports = {
webpackFinal: async (baseConfig, options) => {
const { module = {} } = baseConfig;
const newConfig = {
...baseConfig,
module: {
...module,
// Import global css here
import "../styles/global.scss";
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
html {
background: #f1f1f1;
max-width: 100%;
}
body {
background: linear-gradient(
315deg,
var(#f1f1f1) 0%,
var(#e7e7e7) 100%
import * as React from "react";
type Props = {
text: string;
};
export default ({ text }: Props) => <button>{text}</button>;
import { storiesOf } from "@storybook/react";
import Button from "./Button";
storiesOf("Button", module).add("with text", () => {
return <Button text="Hello World" />;
});
storiesOf("Button", module).add("with emoji", () => {
return <Button text="😀 😎 👍 💯" />;
});