Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { storiesOf } from "@storybook/react";
import StoryRouter from "storybook-react-router";
import * as React from "react";
import Web3HttpProvider from "web3-providers-http";
import apolloStorybookDecorator from "apollo-storybook-react";
import { UserTokenAccountSignup } from "./TokensAccountSignup";
import { UserTokenAccountVerify } from "./TokensAccountVerify";
import { UserTokenAccountBuy } from "./TokensAccountBuy";
import { CivilContext, buildCivilContext } from "../context";
import Web3 from "web3";
const web3Provider = new Web3HttpProvider("http://localhost:8045");
const web3 = new Web3(web3Provider);
const civilContext = buildCivilContext({ web3, featureFlags: ["uniswap"], config: { DEFAULT_ETHEREUM_NETWORK: 4 } });
const onClickFunc = () => {
console.log("clicked!");
};
const typeDefs = `
type Query {
storefrontEthPrice: Float
storefrontCvlPrice: Float
storefrontCvlQuoteUsd(usdToSpend: Float!): Float
}
schema {
query: Query
import { NavBar } from "./NavBar";
import { NavErrorBar } from "./NavErrorBar";
import { CivilContext, buildCivilContext } from "../context";
import Web3 from "web3";
import Web3HttpProvider from "web3-providers-http";
const balance = "100,203";
const votingBalance = "1,200";
const userAccount = "0xd26114cd6ee289accf82350c8d8487fedb8a0c07";
const userRevealVotesCount = 10;
const userClaimRewardsCount = 4;
const userChallengesStartedCount = 2;
const userChallengesVotedOnCount = 15;
const web3Provider = new Web3HttpProvider("http://localhost:8045");
const web3 = new Web3(web3Provider);
const civilContext = buildCivilContext({ web3, featureFlags: ["uniswap"], config: { DEFAULT_ETHEREUM_NETWORK: 4 } });
storiesOf("Common / Nav / Nav Bar", module)
.addDecorator(StoryRouter())
.add("Global Nav", () => {
return (
Query: () => {
return {
storefrontEthPrice: () => {
return 137.23;
},
storefrontCvlPrice: () => {
return 0.2;
},
storefrontCvlQuoteUsd: () => {
return 500.48635;
},
};
},
};
const web3Provider = new Web3HttpProvider("http://localhost:8045");
const web3 = new Web3(web3Provider);
const civilContext = buildCivilContext({ web3, featureFlags: ["uniswap"], config: { DEFAULT_ETHEREUM_NETWORK: 4 } });
const civilContextNoUniswap = buildCivilContext({ web3, featureFlags: [], config: { DEFAULT_ETHEREUM_NETWORK: 4 } });
storiesOf("Storefront / Sell Tab", module)
.addDecorator(
apolloStorybookDecorator({
typeDefs,
mocks,
}),
)
.addDecorator(StoryRouter())
.add("Sell Tab", () => {
return (
const mocks = {
Query: () => {
return {
storefrontEthPrice: () => {
return 102.98;
},
storefrontCvlPrice: () => {
return 0.2;
},
storefrontCvlQuoteUsd: () => {
return 500.48635;
},
};
},
};
const web3Provider = new Web3HttpProvider("http://localhost:8045");
const web3 = new Web3(web3Provider);
const civilContext = buildCivilContext({ web3, featureFlags: ["uniswap"], config: { DEFAULT_ETHEREUM_NETWORK: 4 } });
const foundationAddress = "hello!";
storiesOf("Storefront / Buy Tab", module)
.addDecorator(
apolloStorybookDecorator({
typeDefs,
mocks,
}),
)
.addDecorator(StoryRouter())
.add("Buy Tab", () => {
return (