A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
feat: add login bar on top of lists to ease login
thecodrr5d0a113cf1e5
diff --git a/apps/web/src/components/list-container/index.js b/apps/web/src/components/list-container/index.jsindex 30d000d81..818bb2094 100644--- a/apps/web/src/components/list-container/index.js+++ b/apps/web/src/components/list-container/index.js@@ -6,6 +6,7 @@ import * as Icon from "../icons";import { Virtuoso as List } from "react-virtuoso";import { useStore as useSearchStore } from "../../stores/searchstore";import { useStore as useSelectionStore } from "../../stores/selection-store";+import LoginBar from "../loginbar";function ListContainer(props) {const setSearchContext = useSearchStore((store) => store.setSearchContext);@@ -27,6 +28,7 @@ function ListContainer(props) {return (<Flex variant="columnFill">+ <LoginBar />{!props.items.length && props.placeholder ? (<Flex variant="columnCenterFill"><props.placeholder />diff --git a/apps/web/src/components/loginbar/index.js b/apps/web/src/components/loginbar/index.jsnew file mode 100644index 000000000..6511cda84--- /dev/null+++ b/apps/web/src/components/loginbar/index.js@@ -0,0 +1,31 @@+import React from "react";+import { Flex, Text } from "rebass";+import { useStore as useUserStore } from "../../stores/user-store";+import { getRandom } from "../../utils/random";+import { showLogInDialog } from "../dialogs/logindialog";++const data = [+ "Login to start your 14-day free trial",+ "Login to sync your data",+];++function LoginBar() {+ const isLoggedIn = useUserStore((store) => store.isLoggedIn);++ if (isLoggedIn) return null;+ return (+ <Flex+ flexDirection="column"+ p={2}+ mb={2}+ width="100%"+ bg="shade"+ sx={{ cursor: "pointer" }}+ onClick={showLogInDialog}+ >+ <Text variant="body">{data[getRandom(0, data.length)]}</Text>+ <Text variant="subBody">Click here to login</Text>+ </Flex>+ );+}+export default LoginBar;