Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Styled NoteList and Note Detail when there is no note #113

Merged
merged 1 commit into from
Dec 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/components/NotePage/NoteList/NoteList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ export const StyledNoteListContainer = styled.div`
padding: 0;
list-style: none;
overflow-y: auto;

li.empty {
color: ${({ theme }) => theme.uiTextColor};
}
}

.control {
Expand Down Expand Up @@ -137,7 +133,7 @@ const NoteList = ({
</li>
)
})}
{notes.length === 0 && <li className='empty'>No notes</li>}
{notes.length === 0 && ''}
</ul>
</StyledNoteListContainer>
)
Expand Down
18 changes: 15 additions & 3 deletions src/components/NotePage/NotePage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useMemo, useCallback } from 'react'
import NoteList from './NoteList'
import styled from '../../lib/styled'
import NoteDetail from './NoteDetail'
import {
useRouteParams,
Expand All @@ -18,6 +19,11 @@ import { useDialog, DialogIconTypes } from '../../lib/dialog'
import FileDropZone from '../atoms/FileDropZone'
import { convertCSONFileToNote } from '../../lib/legacy-import'

export const StyledNoteDetailNoNote = styled.div`
text-align: center;
margin-top: 300px;
`

function sortByUpdatedAt(a: NoteDoc, b: NoteDoc) {
return b.updatedAt.localeCompare(a.updatedAt)
}
Expand Down Expand Up @@ -155,8 +161,9 @@ export default () => {
}
})
},
[messageBox, purgeNoteFromDb])

[messageBox, purgeNoteFromDb]
)

const importDrop = useCallback(
(files: File[]) => {
files.forEach(async file => {
Expand Down Expand Up @@ -191,7 +198,12 @@ export default () => {
}
right={
currentNote == null ? (
<div>No note selected</div>
<StyledNoteDetailNoNote>
<div>
<h1>Command(⌘) + N</h1>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this based on how you set your Hotkeys?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be but we didn't implement shortcut settings yet. So it's okay for now.

<h2>to create a new note</h2>
</div>
</StyledNoteDetailNoNote>
) : (
<NoteDetail
storageId={storageId}
Expand Down