This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Stack { | |
| constructor() { | |
| this.storage = []; | |
| } | |
| push(val) { | |
| this.storage.push(val); | |
| } | |
| pop() { | |
| this.storage.pop(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // See original source here: https://github.com/RyanCCollins/the-agency/tree/master/packages/ui/src/WithAnimation | |
| import * as React from 'react'; | |
| import { ThemedCssFunction } from 'styled-components'; | |
| import Animation from './animation'; | |
| import { AnimationType } from './types'; | |
| export interface Props { | |
| type?: AnimationType; | |
| isVisible: boolean; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import styled, { css } from 'styled-components'; | |
| import { StateProps } from './types'; | |
| import { Heading } from 'ui'; | |
| function styles({ isVisible }: StateProps) { | |
| const opacity = isVisible | |
| ? 1.0 | |
| : 0.0; | |
| const translate = isVisible | |
| ? 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .grommetux-dropzone { | |
| border-width: 2px; | |
| border-color: #333; | |
| border-style: dashed; | |
| border-radius: 4px; | |
| transition: all 0.5s; | |
| } | |
| .grommetux-dropzone__input { | |
| display: none; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as React from 'react'; | |
| import { graphql } from 'react-apollo'; | |
| import { LoadingIndicator, Post, Section } from 'components'; | |
| import POST_QUERY from './post.graphql'; | |
| import COMMENT_MUTATION from './comments.graphql'; | |
| interface IPostComments { | |
| body: string; | |
| author: string; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // From client/containers/BlogPost/comments.graphql.ts | |
| import gql from 'graphql-tag'; | |
| export default gql` | |
| mutation CreateComment($post: ID!, $body: String, $author: String) { | |
| createComment(data:{ post: $post, body: $body, author: $author }) | |
| } | |
| `; | |
| // From client/containers/BlogPost/index.tsx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { | |
| GraphQLNonNull, | |
| GraphQLBoolean, | |
| } from 'graphql'; | |
| import types from '../../types'; | |
| import CommentModel from '../../../db/models/comment'; | |
| export default { | |
| type: GraphQLBoolean, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as React from 'react'; | |
| import { graphql } from 'react-apollo'; | |
| import { Headline, LoadingIndicator, PostCard, Section, Box } from 'components'; | |
| import POST_QUERY from './posts.graphql'; | |
| import { StyledHr } from './styles'; | |
| interface IPost { | |
| id: string; | |
| title: string; | |
| image: string; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // From client/containers/Blog/posts.graphql.ts | |
| import gql from 'graphql-tag'; | |
| export default gql` | |
| query Posts { | |
| posts { | |
| id: _id | |
| title | |
| image | |
| content |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { ApolloClient, createNetworkInterface } from 'apollo-client'; | |
| declare var window: { | |
| __APOLLO_STATE__: string, | |
| }; | |
| const uri = process.env.API_URL || 'http://0.0.0.0:1338/api'; | |
| const client = new ApolloClient({ | |
| networkInterface: createNetworkInterface({ |