Skip to content

Instantly share code, notes, and snippets.

View ernestofreyreg's full-sized avatar
🚢
Just ship it

Ernesto Freyre ernestofreyreg

🚢
Just ship it
View GitHub Profile
import React, { useState, useEffect } from "react";
import "./App.css";
import HeroCardContainer from "./components/hero-card-conainer";
import useHttp from "./hooks/http";
const App = () => {
const [heros, isLoading, error] = useHttp(
'"https://www.superheroapi.com/api.php/10215492002188454/search/batman"'
);
import * as React from 'react'
import { FeatureFlagsProvider } from '@twoflags/react-featureflags/build'
function DemoApp({ Component, pageProps }) {
return (
<FeatureFlagsProvider
clientID='a15a1...'
namespace='frontend'
featureFlagsAPI='https://resolver.twoflags.io'
>
import * as React from 'react'
import { NextPage } from 'next'
import { useFeatureFlags } from '@twoflags/react-featureflags'
import styles from './Maintenance.module.scss'
export const blockOnMaintenance = (Component: NextPage) => {
const Maintenance = (props: any) => {
const { maintenance } = useFeatureFlags()
return (
.maintenance {
font-family: sans-serif;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
display: flex;
flex-direction: column;
justify-content: center;
import * as React from 'react'
import { useFeatureFlags } from '@twoflags/react-featureflags'
interface Props {
experimentId: string
variantA: React.ReactNode
variantB: React.ReactNode
}
const Experiment: React.FC<Props> = ({ experimentId, variantA, variantB }) => {
import * as React from 'react'
import Link from '../components/Link'
import styles from '../styles/page.module.scss'
import { blockOnMaintenance } from '../components/Maintenance'
import Experiment from '../components/Experiment'
import { useFeatureFlagsUniqueIDUpdater } from '@twoflags/react-featureflags'
import cuid from 'cuid'
interface Props {}

import {Meta, Story, Preview, Props} from '@storybook/addon-docs/blocks'

import { MyComponent, MyComponentProps } from './MyComponent'

MyComponent

This is the MyComponent

node_modules
.next
out
*.log
coverage
# Parse all files with TypeScript.
extends: 'standard-with-typescript'
parserOptions:
project: './tsconfig.json'
createDefaultProgram: true
plugins:
- prettier
- react
- jest
out/
.next/
node_modules/
next-env.d.ts