This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: list of notes added to left-handed container
- Loading branch information
1 parent
0c4b816
commit 54daf64
Showing
3 changed files
with
105 additions
and
0 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,46 @@ | ||
import React from "react"; | ||
import { connect } from "react-redux"; | ||
|
||
import { | ||
getNotesIndexedByHash | ||
} from "domain/notes"; | ||
|
||
import style from './NoteSelector.module.css'; | ||
|
||
class NoteSelector extends React.Component { | ||
|
||
state = { | ||
|
||
} | ||
|
||
render() { | ||
const Notes = ({notes}) => ( | ||
<> | ||
{Object.values(notes).map(note => ( | ||
<div className={style.tag} key={note.id}> | ||
{note.note.title} | ||
</div> | ||
))} | ||
</> | ||
); | ||
|
||
return ( | ||
<> | ||
<ul className={style.tags}> | ||
<Notes notes={this.props.notes}/> | ||
</ul> | ||
</> | ||
); | ||
} | ||
} | ||
|
||
const mapStateToProps = (state) => { | ||
return { | ||
notes: getNotesIndexedByHash(state) | ||
} | ||
}; | ||
|
||
const mapDispatchToProps = { | ||
}; | ||
|
||
export default connect(mapStateToProps, mapDispatchToProps)(NoteSelector); |
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,33 @@ | ||
.tags { | ||
list-style: none; | ||
margin: 10px 5px 5px 5px; | ||
overflow: hidden; | ||
padding: 0; | ||
} | ||
|
||
.tags li { | ||
float: left; | ||
} | ||
|
||
.tag { | ||
background: #eee; | ||
border-radius: 6px 6px 6px 6px; | ||
display: inline-block; | ||
height: 26px; | ||
line-height: 26px; | ||
padding: 0 20px 0 20px; | ||
position: relative; | ||
margin: 0 10px 10px 0; | ||
text-decoration: none; | ||
-webkit-transition: color 0.2s; | ||
} | ||
|
||
.tag:hover { | ||
/*background-color: #cc0000;*/ | ||
background-color: rgb(65, 65, 65); | ||
color: white; | ||
} | ||
|
||
.tag:hover::after { | ||
border-left-color: rgb(65, 65, 65); | ||
} |