Skip to content

Commit 1a2451f

Browse files
committed
Fix: Sort div bottom #8
1 parent be171ee commit 1a2451f

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/App.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ class App extends Component {
9090

9191
// Pin a note and persist
9292
handlePinNote = async (noteid) => {
93+
// If the number of pinned notes is 5 or greater, return early
94+
if (this.state.pinnedNotes.length >= 5) {
95+
alert("You can only pin up to 5 notes.");
96+
return;
97+
}
98+
9399
await this.handleIndexedDB("addpin", { noteid });
94100
this.setState((prevState) => {
95101
const pinnedNotes = [...prevState.pinnedNotes, noteid];
@@ -100,6 +106,7 @@ handlePinNote = async (noteid) => {
100106
});
101107
};
102108

109+
103110
// Unpin a note and persist
104111
handleUnpinNote = async (noteid) => {
105112
await this.handleIndexedDB("removepin", { noteid });
@@ -112,9 +119,6 @@ handleUnpinNote = async (noteid) => {
112119
});
113120
};
114121

115-
116-
117-
118122
handleCopyCodeButtonClick = () => {
119123
if (navigator && navigator.clipboard) {
120124
this.addCopyButtons(navigator.clipboard);

src/styles.css

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,7 @@ input[type="search"]::-webkit-search-cancel-button {
226226

227227
/* Note List Container*/
228228
.note-list-pin {
229-
height: 270px; /* Set the desired maximum height */
230-
overflow-y: auto; /* Enable vertical scrolling */
229+
height: 245px; /* Set the desired maximum height */
231230
margin: 10px 0; /* Add margin for spacing */
232231
padding-left: 0;
233232
list-style: none; /* Remove default list styles */
@@ -236,7 +235,7 @@ input[type="search"]::-webkit-search-cancel-button {
236235

237236
/* Note List Container*/
238237
.note-list-other {
239-
overflow-y: auto; /* Enable vertical scrolling */
238+
overflow-y: scroll; /* Enable vertical scrolling */
240239
margin: 10px 0; /* Add margin for spacing */
241240
padding-left: 0;
242241
list-style: none; /* Remove default list styles */

0 commit comments

Comments
 (0)