cleanup
This commit is contained in:
@ -23,7 +23,7 @@ export default class TodoItem extends Component {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<ListItem>
|
<ListItem>
|
||||||
<Checkbox
|
<Input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
checked={checked}
|
checked={checked}
|
||||||
onChange={this.handleChange}
|
onChange={this.handleChange}
|
||||||
@ -40,7 +40,7 @@ const ListItem = styled.li`
|
|||||||
position: relative;
|
position: relative;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const Checkbox = styled.input`
|
const Input = styled.input`
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0.4em;
|
top: 0.4em;
|
||||||
|
13
frontend/components/Editor/components/TodoList.js
Normal file
13
frontend/components/Editor/components/TodoList.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
// @flow
|
||||||
|
import styled from 'styled-components';
|
||||||
|
|
||||||
|
const TodoList = styled.ul`
|
||||||
|
list-style: none;
|
||||||
|
padding: 0 !important;
|
||||||
|
|
||||||
|
ul {
|
||||||
|
padding-left: 1em;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
export default TodoList;
|
@ -1,11 +1,11 @@
|
|||||||
// @flow
|
// @flow
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import styled from 'styled-components';
|
|
||||||
import Code from './components/Code';
|
import Code from './components/Code';
|
||||||
import InlineCode from './components/InlineCode';
|
import InlineCode from './components/InlineCode';
|
||||||
import Image from './components/Image';
|
import Image from './components/Image';
|
||||||
import Link from './components/Link';
|
import Link from './components/Link';
|
||||||
import ListItem from './components/ListItem';
|
import ListItem from './components/ListItem';
|
||||||
|
import TodoList from './components/TodoList';
|
||||||
import {
|
import {
|
||||||
Heading1,
|
Heading1,
|
||||||
Heading2,
|
Heading2,
|
||||||
@ -17,15 +17,6 @@ import {
|
|||||||
import Paragraph from './components/Paragraph';
|
import Paragraph from './components/Paragraph';
|
||||||
import type { Props, Node, Transform } from './types';
|
import type { Props, Node, Transform } from './types';
|
||||||
|
|
||||||
const TodoList = styled.ul`
|
|
||||||
list-style: none;
|
|
||||||
padding: 0 !important;
|
|
||||||
|
|
||||||
ul {
|
|
||||||
padding-left: 1em;
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const createSchema = () => {
|
const createSchema = () => {
|
||||||
return {
|
return {
|
||||||
marks: {
|
marks: {
|
||||||
@ -63,7 +54,7 @@ const createSchema = () => {
|
|||||||
},
|
},
|
||||||
|
|
||||||
rules: [
|
rules: [
|
||||||
// ensure first node is a heading
|
// ensure first node is always a heading
|
||||||
{
|
{
|
||||||
match: (node: Node) => {
|
match: (node: Node) => {
|
||||||
return node.kind === 'document';
|
return node.kind === 'document';
|
||||||
@ -77,7 +68,7 @@ const createSchema = () => {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
// remove any marks in first heading
|
// automatically removes any marks in first heading
|
||||||
{
|
{
|
||||||
match: (node: Node) => {
|
match: (node: Node) => {
|
||||||
return node.kind === 'heading1';
|
return node.kind === 'heading1';
|
||||||
|
Reference in New Issue
Block a user