Skip to content

Instantly share code, notes, and snippets.

View Swiip's full-sized avatar

Matthieu Lux Swiip

View GitHub Profile
@Swiip
Swiip / useAgencies.js
Created March 19, 2019 16:01
logic/hooks/useAgencies.js
import { useQuery } from "react-apollo-hooks";
import { gql } from "apollo-boost";
import { initAgencies, selectAgency } from "../agencies";
import useRedux from "./useRedux";
import useLoaded from "./useLoaded";
const agencyQuery = gql`
query Agencies { ... }
`;
@Swiip
Swiip / AgenciesMenu.js
Created March 19, 2019 16:55
components/company/__tests__/AgenciesMenu.js
import React from "react";
import { shallow } from "enzyme";
import Router from "next/router";
import AgenciesMenu from "../AgenciesMenu";
import { setAgencies, selectAgency } from "../../../logic/hooks/useAgencies";
const lyon = { slug: "lyon" };
const paris = { slug: "paris" };
const agencies = [lyon, paris];
import React from "react";
import { string } from "prop-types";
import set from "lodash.set";
import { useSSR } from "react-i18next";
import i18n from "i18next";
import { useQuery } from "react-apollo-hooks";
import { gql } from "apollo-boost";
import i18next from "./i18next";
import { NamespaceProvider } from "./namespace";