extends Action { 9 | type: string; 10 | payload?: P; 11 | } 12 | -------------------------------------------------------------------------------- /packages/docs/src/client/containers/BlogPost/actions.ts: -------------------------------------------------------------------------------- 1 | import { Action } from 'redux'; 2 | import { Input } from './types'; 3 | import * as T from './constants'; 4 | 5 | export interface InputAction extends Action { 6 | type: T.INPUT_TYPE; 7 | input: Input; 8 | } 9 | 10 | export type ActionTypes = InputAction; 11 | -------------------------------------------------------------------------------- /packages/docs/src/server/db/models/comment.ts: -------------------------------------------------------------------------------- 1 | import mongoose from 'mongoose'; 2 | 3 | const CommentSchema = new mongoose.Schema({ 4 | author: String, 5 | body: String, 6 | post: { 7 | type: String, 8 | ref: 'Post', 9 | }, 10 | }); 11 | 12 | export default mongoose.model('Comment', CommentSchema); 13 | -------------------------------------------------------------------------------- /packages/docs/config/generators/container/styles.js.hbs: -------------------------------------------------------------------------------- 1 | import styled from 'styled-components'; 2 | 3 | export const Section = styled.section` 4 | padding: 60px; 5 | background-color: #f5f5f5; 6 | min-height: calc(100vh - 50px); 7 | `; 8 | 9 | export const Heading = styled.h1` 10 | text-align: center; 11 | `; 12 | -------------------------------------------------------------------------------- /packages/docs/src/client/containers/Docs/state.ts: -------------------------------------------------------------------------------- 1 | export interface State { 2 | markdownContent?: string; 3 | error?: string; 4 | isLoading: boolean; 5 | } 6 | 7 | export const initialState: State = { 8 | markdownContent: null, 9 | error: null, 10 | isLoading: false, 11 | }; 12 | 13 | export default State; 14 | -------------------------------------------------------------------------------- /packages/docs/src/client/shared/actions.ts: -------------------------------------------------------------------------------- 1 | import { Action } from 'redux'; 2 | import * as types from './constants'; 3 | 4 | export interface DefaultAction extends Action { 5 | type: types.DEFAULT_ACTION_TYPE 6 | } 7 | 8 | export interface PayloadAction
extends Action {
9 | type: string;
10 | payload?: P;
11 | }
12 |
--------------------------------------------------------------------------------
/packages/openui/src/Article/styles.ts:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components';
2 | import {
3 | BoxStyles,
4 | Props,
5 | } from '../Box/styles';
6 |
7 | export { Props }
8 | export default styled.article`
9 | ${BoxStyles}
10 | box-shadow: 0 2px 4px 0 rgba(46, 61, 73, 0.2);
11 | border: 1px solid #dbe2e8;
12 | `;
13 |
--------------------------------------------------------------------------------
/packages/docs/src/client/containers/TodoApp/__tests__/__mocks__/presentation.mock.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | todos: [
3 | {
4 | text: 'foo',
5 | },
6 | {
7 | text: 'bar',
8 | },
9 | ],
10 | input: 'foo',
11 | onInput: jest.fn(),
12 | onAddition: jest.fn(),
13 | onDeletion: jest.fn(),
14 | };
15 |
--------------------------------------------------------------------------------
/packages/openui/src/Anchor/__tests__/__mocks__/anchorMocks.mock.ts:
--------------------------------------------------------------------------------
1 | export const hrefProps = {
2 | href: 'https://github.com/RyanCCollins/scalable-react-ts-boilerplate',
3 | label: 'Scalable React',
4 | color: '#fff',
5 | };
6 |
7 | export default {
8 | path: '/docs',
9 | label: 'Docs',
10 | color: '#fff',
11 | };
12 |
--------------------------------------------------------------------------------
/src/client/features/Layout/presentation.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { Props } from './types';
3 | import Main from './main';
4 |
5 | export default function LayoutPresentation({ children }: Props): JSX.Element {
6 | return (
7 | extends Action {
8 | type: string;
9 | payload?: P;
10 | }
11 |
12 | export interface FormControlEventTarget extends EventTarget {
13 | value: string;
14 | }
15 |
16 | export {
17 | /* GENERATOR-EXPORT */
18 | LandingTypes,
19 | LayoutTypes,
20 | };
21 |
--------------------------------------------------------------------------------
/config/generators/component/es6class.tsx.hbs:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import Component from './styles';
3 |
4 | export interface Props extends React.HTMLProps extends Action {
13 | type: string;
14 | payload?: P;
15 | }
16 |
17 | export interface FormControlEventTarget extends EventTarget {
18 | value: string;
19 | }
20 |
21 | export {
22 | /* GENERATOR-EXPORT */
23 | AppTypes,
24 | TodoAppTypes,
25 | DocsTypes,
26 | BlogPostTypes,
27 | BlogTypes,
28 | FeaturesTypes,
29 | HomeTypes,
30 | };
31 |
--------------------------------------------------------------------------------
/packages/openui/src/Avatar/styles.ts:
--------------------------------------------------------------------------------
1 | import { css, InterpolationFunction, ThemeProps } from 'styled-components';
2 | import remStringFromPx from '../utils';
3 | import map from './maps';
4 | import { Props } from './index';
5 | import defaultUrl from './default';
6 |
7 | const propsToSize = ({ size }: Props) => {
8 | const imageSize = size || 'medium';
9 | const px = map[imageSize];
10 | const rem = remStringFromPx(px);
11 | return css`
12 | width: ${rem};
13 | min-height: ${rem};
14 | `;
15 | };
16 |
17 | export { InterpolationFunction, ThemeProps };
18 | export const AvatarStyle = css`
19 | background: url(${({ src }: Props) => src || defaultUrl});
20 | background-size: cover;
21 | background-position: center;
22 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
23 | padding: 4px;
24 | line-height: 1.42857143;
25 | background-color: #fff;
26 | border: 1px solid #ddd;
27 | border-radius: 50%;
28 | ${propsToSize}
29 | `;
30 |
--------------------------------------------------------------------------------
/packages/docs/src/client/components/AddComment/__tests__/__snapshots__/index.test.tsx.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`Comments
28 |