This file contains 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
/* Colors variables */ | |
:root { | |
--black: #0A111A; | |
--near-black: #2f2c3c; | |
--white: #f0f0f0; | |
--near-white: #D0D0D0; | |
} | |
body { | |
color: --var(white); |
This file contains 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
// @flow | |
import Immutable from 'immutable'; | |
const defaultRecord = { | |
id: string; | |
done: boolean; | |
label: string; | |
createdAt: string; | |
updatedAt: string; |
This file contains 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 { Modifier, EditorState, Entity } from 'draft-js'; | |
export default function insertCheckbox(editorState) { | |
// Define the checkbox entity | |
const entityKey = Entity.create('CHECKBOX', 'IMMUTABLE', { checked: false }); | |
// Collapse selection | |
const selectionState = editorState.getSelection().merge({ | |
anchorOffset: selectionState.getFocusOffset(), | |
}); |
This file contains 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 React from 'react'; | |
import { Editor, KeyBindingUtil, getDefaultKeyBinding } from 'draft-js'; | |
import keycode from 'keycode'; | |
import insertCheckbox from 'modifiers/insertCheckbox'; | |
const { hasCommandModifier } = KeyBindingUtil; | |
function customKeyBindingFn(e) { | |
if (hasCommandModifier(e) && e.shiftKey && keycode(e) === 'c') { | |
return 'insert-checkbox'; |
This file contains 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 React from 'react'; | |
import Task from 'models/Task'; | |
const TaskListItem = ({ task, onToggleTaskDone }) => ( | |
<div className="task-list-item"> | |
<input | |
type="checkbox" | |
checked={task.isDone()} | |
onChange={onToggleTaskDone} | |
/> |
This file contains 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 React, { Component } from 'react'; | |
import { connect } from 'react-redux'; | |
import { toggleTaskDone } from 'actions/tasks'; | |
import TaskMap from 'models/TaskMap'; | |
import TaskListLayout from 'components/Task/List/Layout'; | |
const TaskListContainer = ({ onToggleTaskDone, tasks }) => ( | |
<TaskListLayout> | |
{ tasks.map((task) => |
This file contains 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 { RECEIVED_ENTITIES, DELETE_TASK, TOGGLE_TASK_DONE } from 'constants/ActionsTypes'; | |
import Task from 'models/Task'; | |
import TaskMap from 'models/TaskMap'; | |
const initialState = new TaskMap(); | |
const mergeEntities = (state, newTasks) => | |
state.merge(newTasks.map((task) => new Task(task))) | |
export default (state = initialState, action) => |
This file contains 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 Immutable from 'immutable'; | |
const TaskMap = Immutable.OrderedMap; | |
export default TaskMap; |
This file contains 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 Immutable from 'immutable'; | |
const TaskRecord = Immutable.Record({ | |
id: null, | |
done: false, | |
label: '', | |
createdAt: null, | |
updatedAt: null, | |
}) |
This file contains 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
function countCSSRules() { | |
var results = '', | |
log = ''; | |
if (!document.styleSheets) { | |
return; | |
} | |
for (var i = 0; i < document.styleSheets.length; i++) { | |
countSheet(document.styleSheets[i]); | |
} | |
function countSheet(sheet) { |
NewerOlder