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

Adding features to favourite option #528

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/client/containers/NoteList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,17 @@ export const NoteList: React.FC = () => {
<div className="note-list-outer">
<div data-testid={'note-title-' + index} className="note-title">
{note.favorite ? (
<>
<>
<div className="icon">
<Star aria-hidden="true" className="note-favorite" size={12} />
<Star aria-hidden="true" className="note-favorite" size={12} fill="currentColor"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

What is currentColor?

Copy link
Contributor

Choose a reason for hiding this comment

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

property that takes the value of color property, See docs


<span className="sr-only">Favorite note</span>
</div>
{/* <div className='overlay'>
<span className='note-favourite-text'>Favourited!</span>
</div> */}
<div className="truncate-text">{noteTitle}</div>

</>
) : (
<>
Expand Down
3 changes: 2 additions & 1 deletion src/client/containers/NoteMenuBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const NoteMenuBar = () => {

const copyNoteIcon = <ClipboardCmp size={18} aria-hidden="true" focusable="false" />
const successfulCopyMessage = 'Note copied!'
const successfulFavouriteMessage='Added to Favourites!'
const activeNote = notes.find((note) => note.id === activeNoteId)!
const shortNoteUuid = getShortUuid(activeNoteId)

Expand Down Expand Up @@ -121,7 +122,7 @@ export const NoteMenuBar = () => {
{!activeNote.scratchpad && (
<>
<button className="note-menu-bar-button" onClick={favoriteNoteHandler}>
<Star aria-hidden="true" size={18} />
<Star aria-hidden="true" size={18} fill={activeNote.favorite?"currentcolor":""} />
Copy link
Contributor

Choose a reason for hiding this comment

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

What is currentcolor?

<span className="sr-only">Add note to favorites</span>
</button>
<button className="note-menu-bar-button trash" onClick={trashNoteHandler}>
Expand Down
16 changes: 13 additions & 3 deletions src/client/styles/_note-sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
&:hover {
overflow-y: auto;
}

&-header {
display: flex;
align-items: center;
Expand Down Expand Up @@ -62,7 +61,6 @@
.highlighted {
color: #3e64ff;
}

.note-category {
display: flex;
align-items: center;
Expand Down Expand Up @@ -95,7 +93,6 @@
text-overflow: clip;
}
}

&:hover {
background: darken($note-sidebar-color, 5%);

Expand All @@ -113,6 +110,19 @@
color: rgba(255, 255, 255, 0.6);
}

// .overlay {
// // position: relative;
// // background-color: #008cba;
// overflow: hidden;
// width: 0%;
// height: 100%;
// transition: 0.5s ease;
// }

// &:hover .overlay {
// width: 50%;
// }

&:hover {
.note-options {
color: white;
Expand Down