Skip to content

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

feat(ui): add topics placeholder

thecodrr568997ce8c22
diff --git a/apps/web/src/components/placeholders/topics-placeholder.js b/apps/web/src/components/placeholders/topics-placeholder.js
new file mode 100644
index 000000000..a7c58a363
--- /dev/null
+++ b/apps/web/src/components/placeholders/topics-placeholder.js
@@ -0,0 +1,20 @@
+import React from "react";
+import { ReactComponent as Notebook } from "../../assets/notebook.svg";
+import Placeholder from "./index";
+import * as Icon from "../icons";
+import { hashNavigate } from "../../navigation";
+
+function TopicsPlaceholder({ context: { notebookId } }) {
+ return (
+ <Placeholder
+ image={Notebook}
+ text="You have not added any topics yet."
+ callToAction={{
+ text: "Add a topic",
+ icon: Icon.Plus,
+ onClick: () => hashNavigate("/topics/create"),
+ }}
+ />
+ );
+}
+export default TopicsPlaceholder;
diff --git a/apps/web/src/views/topics.js b/apps/web/src/views/topics.js
index fc7949acb..12bbad9cd 100644
--- a/apps/web/src/views/topics.js
+++ b/apps/web/src/views/topics.js
@@ -1,8 +1,8 @@
import React from "react";
-import { Flex } from "rebass";
import ListContainer from "../components/list-container";
import { useStore as useNbStore } from "../stores/notebook-store";
import { hashNavigate } from "../navigation";
+import TopicsPlaceholder from "../components/placeholders/topics-placeholder";
function Topics() {
const selectedNotebookTopics = useNbStore(
@@ -16,7 +16,7 @@ function Topics() {
type="topics"
items={selectedNotebookTopics}
context={{ notebookId: selectedNotebookId }}
- placeholder={Flex}
+ placeholder={TopicsPlaceholder}
button={{
content: "Add a new topic",
onClick: () => hashNavigate(`/topics/create`),