-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Folder.INBOX to types * Automatically add inbox file for new users (fake api) * Add inbox to sidebar and display inbox note when inbox is selected * Change inbox to scratchpad * Create scratchpad note if it's not there * Hide note list when viewing scratchpad * Ensure inbox isn't shown in editor after deleting a note * Refactor getNewActiveNoteId
- Loading branch information
1 parent
c2822b2
commit a2db7a4
Showing
15 changed files
with
108 additions
and
30 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Scratchpad | ||
|
||
A place for just random things you may want to jot down such as daily todos. | ||
|
||
You cannot create more notes in the scratchpad and you cannot delete the scratchpad note. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import uuid from 'uuid/v4' | ||
import moment from 'moment' | ||
|
||
import markdown from '@/api/scratchpadNote.md' | ||
|
||
export const scratchpadNote = { | ||
id: uuid(), | ||
text: markdown, | ||
category: '', | ||
scratchpad: true, | ||
favorite: false, | ||
created: moment().format(), | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* eslint-disable import/no-unresolved */ | ||
import React from 'react' | ||
import { Edit } from 'react-feather' | ||
|
||
import { StringEnum } from '@resources/StringEnum' | ||
|
||
import { Folder } from '@/utils/enums' | ||
import { iconColor } from '@/utils/constants' | ||
|
||
export interface ScratchpadOptionProps { | ||
active: boolean | ||
swapFolder: (folder: Folder) => {} | ||
} | ||
|
||
export const ScratchpadOption: React.FC<ScratchpadOptionProps> = ({ active, swapFolder }) => { | ||
return ( | ||
<div | ||
data-testid="scratchpad" | ||
className={`app-sidebar-link ${active ? 'active' : ''}`} | ||
onClick={() => { | ||
swapFolder(Folder.SCRATCHPAD) | ||
}} | ||
> | ||
<Edit size={15} className="app-sidebar-icon" color={iconColor} /> | ||
{StringEnum.SCRATCHPAD} | ||
</div> | ||
) | ||
} |
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
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
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
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
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
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
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
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
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