-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: update to build process and more fixes * fix: updated NotesList * feat: basic version of Markdown Notes
- Loading branch information
Showing
32 changed files
with
758 additions
and
38 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,11 +1,20 @@ | ||
import * as React from 'react'; | ||
import styled, { ThemeProvider } from 'styled-components'; | ||
import defaultTheme from './Themes/Default'; | ||
|
||
interface Props { | ||
name: string | ||
} | ||
import { NotesListContainer } from './Containers'; | ||
import { Route } from 'react-router'; | ||
|
||
export class App extends React.Component<Props> { | ||
render() { | ||
return <div>Hello {this.props.name}</div>; | ||
} | ||
} | ||
const Container = styled('div')` | ||
height: 100%; | ||
`; | ||
|
||
const App = () => ( | ||
<ThemeProvider theme={defaultTheme}> | ||
<Container> | ||
<Route path="/" component={NotesListContainer} /> | ||
</Container> | ||
</ThemeProvider> | ||
); | ||
|
||
export default App; |
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,11 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const Row = styled('div')` | ||
display: flex; | ||
flex-direction: row; | ||
`; | ||
|
||
export const Column = styled('div')` | ||
display: flex; | ||
flex-direction: column; | ||
`; |
Empty file.
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 |
---|---|---|
@@ -1 +1 @@ | ||
export { addNewNote } from './Note'; | ||
export { addNewNote, deleteNote, openNote, updateNote } from './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
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,29 @@ | ||
import { connect } from 'react-redux'; | ||
import { Dispatch } from 'redux'; | ||
|
||
import NotesList from './NotesList'; | ||
|
||
import {activeNoteIdSelector, editModeSelector, notesListSelector, notesMapSelector} from './Selectors'; | ||
|
||
import { openNote, deleteNote, addNewNote, updateNote } from './Actions'; | ||
import {toggleEditMode} from "./Actions/Note"; | ||
|
||
const mapDispatchToProps = (dispatch: Dispatch) => ({ | ||
openNote: (payload: any) => dispatch(openNote(payload)), | ||
updateNote: (payload: any) => dispatch(updateNote(payload)), | ||
deleteNote: (payload: any) => dispatch(deleteNote(payload)), | ||
addNewNote: () => dispatch(addNewNote()), | ||
toggleEditMode: (payload: any) => dispatch(toggleEditMode(payload)), | ||
}); | ||
|
||
const mapState = (state: any) => ({ | ||
notes: notesListSelector(state), | ||
notesMap: notesMapSelector(state), | ||
activeNoteId: activeNoteIdSelector(state), | ||
editMode: editModeSelector(state), | ||
}); | ||
|
||
export default connect( | ||
mapState, | ||
mapDispatchToProps, | ||
)(NotesList); |
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,59 @@ | ||
import * as React from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
import {Column} from "../../Components/Layout/Row"; | ||
|
||
const NewButton = styled('div')` | ||
color: ${props => props.theme.colors.primaryHoverText}; | ||
border: 1px solid ${props => props.theme.colors.border}; | ||
font-weight: ${props => props.theme.fontWeights.primaryText}; | ||
width: 150px; | ||
height: 25px; | ||
line-height: 1.5; | ||
text-align: center; | ||
padding: 5px; | ||
cursor: pointer; | ||
z-index: 1; | ||
transition: background-color 0.5s; | ||
&:hover { | ||
background-color: ${props => props.theme.colors.primaryHoverBackground}; | ||
color: ${props => props.theme.colors.primaryHoverText}; | ||
} | ||
`; | ||
|
||
const EmptyNotesListContainer = styled(Column)` | ||
align-items: center; | ||
padding: 5px; | ||
// background-color: ${props => props.theme.colors.primaryHoverBackground}; | ||
`; | ||
|
||
interface EmptyNotesListProps { | ||
|
||
} | ||
|
||
export default class EmptyNotesList extends React.PureComponent<EmptyNotesListProps> { | ||
keyUpEventListener = (evt: KeyboardEvent) => { | ||
// console.log(evt); | ||
if(evt.key === 'n') { | ||
evt.preventDefault(); | ||
// console.log('wohoo'); | ||
} | ||
}; | ||
|
||
componentDidMount(): void { | ||
document.addEventListener('keyup', this.keyUpEventListener); | ||
} | ||
|
||
componentWillUnmount(): void { | ||
document.removeEventListener('keyup', this.keyUpEventListener); | ||
} | ||
|
||
render() { | ||
return ( | ||
<EmptyNotesListContainer> | ||
Add New Note by clicking on '+' icon | ||
</EmptyNotesListContainer> | ||
); | ||
} | ||
} |
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,30 @@ | ||
import * as React from 'react'; | ||
|
||
class EmptySelection extends React.PureComponent { | ||
|
||
keyUpEventListener = (evt: KeyboardEvent) => { | ||
// console.log(evt); | ||
if(evt.key === 'n') { | ||
evt.preventDefault(); | ||
// console.log('wohoo'); | ||
} | ||
}; | ||
|
||
componentDidMount(): void { | ||
document.addEventListener('keyup', this.keyUpEventListener); | ||
} | ||
|
||
componentWillUnmount(): void { | ||
document.removeEventListener('keyup', this.keyUpEventListener); | ||
} | ||
|
||
render(): React.ReactNode { | ||
return ( | ||
<div> | ||
Please select a note continue. | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default EmptySelection; |
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 @@ | ||
import * as React from 'react'; | ||
import {Note} from "../typings"; | ||
import {ChangeEvent} from "react"; | ||
|
||
interface Props { | ||
note: Note, | ||
updateNote: (note: Note) => void | ||
} | ||
|
||
const EmptyNotesList = (props: Props) => { | ||
const onChange = (evt: ChangeEvent<HTMLTextAreaElement>) => { | ||
const content = evt.target.value; | ||
const newNote = { ...props.note, content }; | ||
props.updateNote(newNote); | ||
}; | ||
return ( | ||
<div> | ||
<textarea | ||
value={props.note.content} | ||
onChange={onChange} | ||
style={{ width: '100%', height: '100%' }} | ||
rows={10} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default EmptyNotesList; |
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 @@ | ||
export { default as MarkdownEditor } from './Editor'; |
Oops, something went wrong.