Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: pinned notes should be in the scroll box

thecodrr0fd07579a486
diff --git a/apps/web/src/app.js b/apps/web/src/app.js
index 315d4469d..148374990 100644
--- a/apps/web/src/app.js
+++ b/apps/web/src/app.js
@@ -84,8 +84,6 @@ function App() {
}}
flexDirection="column"
flex="1 1 auto"
- px={2}
- py={2}
//style={{ width: "362px" }}
/>
<Box
diff --git a/apps/web/src/utils/base64.js b/apps/web/src/utils/base64.js
index 4d6b76748..d7f98ce14 100644
--- a/apps/web/src/utils/base64.js
+++ b/apps/web/src/utils/base64.js
@@ -6,8 +6,6 @@
* Licensed under the MIT license.
*/
(function() {
- "use strict";
-
var chars =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
diff --git a/apps/web/src/views/Home.js b/apps/web/src/views/Home.js
index f98ff87c9..9c662b2f8 100644
--- a/apps/web/src/views/Home.js
+++ b/apps/web/src/views/Home.js
@@ -1,4 +1,4 @@
-import React, { useEffect, useState } from "react";
+import React, { useEffect, useState, useRef } from "react";
import { Flex, Text, Box } from "rebass";
import * as Icon from "react-feather";
import { db, ev, sendNewNoteEvent } from "../common";
@@ -13,11 +13,11 @@ function Home() {
groupCounts: [],
groups: []
});
- const [pinnedItems, setPinnedItems] = useState([]);
+ //const [pinnedItems, setPinnedItems] = useState([]);
useEffect(() => {
function onRefreshNotes() {
- setNotes(db.groupNotes(undefined, true));
- setPinnedItems(db.getPinned());
+ let groups = db.groupNotes(undefined, true);
+ setNotes(groups);
}
onRefreshNotes();
ev.addListener("refreshNotes", onRefreshNotes);
@@ -27,12 +27,9 @@ function Home() {
}, []);
return (
<Flex flexDirection="column" flex="1 1 auto">
- {notes.items.length > 0 || pinnedItems.length > 0 ? (
+ {notes.items.length > 0 ? (
<Flex flexDirection="column" flex="1 1 auto">
<Search placeholder="Search" />
- {pinnedItems.map((item, index) => (
- <Note index={index * notes.items.length} item={item} />
- ))}
<List
style={{
width: "100%",
@@ -41,14 +38,16 @@ function Home() {
overflowX: "hidden"
}}
groupCounts={notes.groupCounts}
- group={index => (
+ group={groupIndex => (
<Box bg="background">
<Text variant="heading" color="primary" fontSize={15}>
- {notes.groups[index].title}
+ {notes.groups[groupIndex].title}
</Text>
</Box>
)}
- item={index => <Note index={index} item={notes.items[index]} />}
+ item={(index, groupIndex) => (
+ <Note index={index} item={notes.items[index]} />
+ )}
/>
<Button
Icon={Icon.Plus}
diff --git a/apps/web/yarn.lock b/apps/web/yarn.lock
index cfe9eb56f..1ed43cb5c 100644
--- a/apps/web/yarn.lock
+++ b/apps/web/yarn.lock
@@ -6991,7 +6991,7 @@ normalize-url@^3.0.0, normalize-url@^3.0.1:
"notes-core@https://github.com/thecodrr/notes-core.git":
version "0.2.0"
- resolved "https://github.com/thecodrr/notes-core.git#3b9f78947fbb1239853cb77002aeab1567d24a87"
+ resolved "https://github.com/thecodrr/notes-core.git#481daf066cafac5c371f609ccff3db44ff6d3e48"
dependencies:
fuzzysearch "^1.0.3"
transfun "^1.0.2"