Skip to content

PlusMinusSays/takenote

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TakeNote

Installation

Redux DevTools Chrome extension is required for development!

git clone [email protected]:taniarascia/takenote
cd vnote
npm i
npm start

Features

  • View all notes
  • View notes by cateogory
  • Add note
  • Update note
  • Delete note
  • Download note
  • Add category
  • Delete category -> prune notes of deleted category
  • Add note to category
  • Sync (save) notes and categories to local storage
  • Keybindings for add, delete, download, sync
  • Add frontmatter to md files
  • Delete notes to trash first
  • Add "all" and "trash" folders
  • Put all options in note dropdown options
  • App sidebar link for add link
  • Permanent scratchpad
  • Add favorites folder
  • Search notes
  • Drag and drop notes into categories
  • Add syntax highlighting for multi-language support
  • Basic settings
    • Light/dark mode
    • Frequency of polling for sync (polling or inactivity?)
    • Keyboard shortcuts
  • Add authentication (GitHub 0Auth)
  • Hook up Gist API for storage
  • Style app
  • Example note of what you can do

Bugs

  • New note from cat is in cat
  • Note options in "all notes" displays category its already in
  • Moving note to category does not swap to proper note
  • Do not view trash notes after deleting in categories
  • Note not focused if new note keybind event outside of editor
  • Options does not close after change category
  • No new note from trash
  • Restore deleted note
  • Permanently delete note
  • Can't make keybinding for add category

Phase 2

  • Tabs for notes?
  • Dropbox integration?

Redux

Add enum

// types/enums
export enum Actions {
   ...
  ADD_CATEGORY_TO_NOTE = 'ADD_CATEGORY_TO_NOTE',
  ...
}

Add action

// actions/index.ts
export const addCategoryToNote = (categoryId: string, noteId: string) => ({
  type: Actions.ADD_CATEGORY_TO_NOTE,
  payload: { categoryId, noteId },
})

Add action type

// types/index.ts
export interface AddCategoryToNoteAction {
  type: typeof Actions.ADD_CATEGORY_TO_NOTE
  payload: {
    categoryId: string
    noteId: string
  }
}

export type NotesActionTypes = AddCategoryToNoteAction | ...

Add reducer

// reducers/index.ts
case Actions.ADD_CATEGORY_TO_NOTE:
  return {
    ...state,
    notes: state.notes.map(note =>
      note.id === action.payload.noteId
        ? {
            id: note.id,
            text: note.text,
            created: note.created,
            lastUpdated: note.lastUpdated,
            category: action.payload.categoryId,
          }
        : note
    ),
  }

Update container

Import action

// containers/Component.tsx
import { addCategoryToNote } from 'actions'

Add to container props

// containers/Component.tsx
interface NoteListProps {
  addCategoryToNote: () => void
  ...
}

const NoteList: React.FC<NoteListProps> = ({
  ...
  addCategoryToNote,
}) => {

Map dispatch to props

// containers/Component.tsx
const mapDispatchToProps = (dispatch: Dispatch) => ({
  addCategoryToNote: (categoryId: string, noteId: string) =>
    dispatch(addCategoryToNote(categoryId, noteId)),
})

Use the damn function

// containers/Component.tsx
<div
  key={category.id}
  onClick={() => {
    addCategoryToNote(category.id, note.id)
  }}
>
  {category.name}
</div>

About

TakeNote

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 85.9%
  • CSS 12.8%
  • HTML 1.3%