Skip to content

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

Merge branch 'master' into locking

thecodrr7524ce644117
diff --cc apps/web/src/components/note/index.js
index 032abf9fb,87ec012f3..bed1a1d68
--- a/apps/web/src/components/note/index.js
+++ b/apps/web/src/components/note/index.js
@@@ -86,12 -65,31 +86,31 @@@ function Note(props)
}}
info={
<Flex justifyContent="center" alignItems="center">
- <TimeAgo datetime={note.dateCreated} />
+ {note.colors.map(item => (
+ <Box
+ style={{
+ width: 13,
+ marginLeft: -3,
+ height: 13,
+ backgroundColor: item,
+ borderRadius: 100
+ }}
+ />
+ ))}
+
+ <TimeAgo style={{ marginLeft: 5 }} datetime={note.dateCreated} />
{note.locked && <Icon.Lock size={13} style={{ marginLeft: 5 }} />}
- {note.favorite && <Icon.Star size={13} style={{ marginLeft: 5 }} />}
+ {note.favorite && (
+ <Icon.Star
+ stroke={0}
+ fill="#ffd27d"
+ size={13}
+ style={{ marginLeft: 5 }}
+ />
+ )}
</Flex>
}
- pinned={note.pinned}
+ pinned={props.pinnable && note.pinned}
menuData={note}
menuItems={menuItems(note, index)}
dropdownRefs={dropdownRefs}
diff --cc apps/web/src/components/properties/index.js
index 69f3f5a29,c26ace710..e3da2ab72
--- a/apps/web/src/components/properties/index.js
+++ b/apps/web/src/components/properties/index.js
@@@ -19,173 -18,198 +19,200 @@@ const Properties = props =>
const setSession = useStore(store => store.setSession);
const setColor = useStore(store => store.setColor);
const setTag = useStore(store => store.setTag);
+ const toggleLocked = useStore(store => store.toggleLocked);
+ const hideProperties = useAppStore(store => store.hideProperties);
+ const showProperties = useAppStore(store => store.showProperties);
+ const arePropertiesVisible = useAppStore(store => store.arePropertiesVisible);
+ const isFocusModeEnabled = useAppStore(store => store.isFocusModeEnabled);
function changeState(prop, value) {
setSession(state => {
state.session[prop] = value;
});
}
- const hideProperties = useAppStore(store => store.hideProperties);
- const showProperties = useAppStore(store => store.showProperties);
- const arePropertiesVisible = useAppStore(store => store.arePropertiesVisible);
return (
- <>
- <Box
- onClick={() => {
- showProperties();
- }}
- sx={{
- display: arePropertiesVisible ? "none" : "flex",
- position: "absolute",
- top: "50%",
- right: 0,
- color: "static",
- borderRadius: "100px 0px 0px 100px",
- cursor: "pointer",
- height: [0, 0, 60]
- }}
- alignItems="center"
- justifyContent="center"
- bg="primary"
- >
- <Icon.ChevronLeft size={32} />
- </Box>
- <Box
- sx={{
- position: arePropertiesVisible ? "absolute" : "relative",
- right: 0,
- display: arePropertiesVisible ? "flex" : "none",
- borderLeft: "1px solid",
- borderColor: "border",
- width: [0, 0, "20%"]
- }}
- flexDirection="column"
- bg="background"
- px={3}
- py={0}
- >
- <Text
- variant="title"
- color="primary"
- my={2}
+ !isFocusModeEnabled && (
+ <>
+ <Box
+ onClick={() => showProperties()}
+ sx={{
+ display: arePropertiesVisible ? "none" : "flex",
+ position: "absolute",
+ top: "50%",
+ right: 0,
+ color: "static",
+ borderRadius: "100px 0px 0px 100px",
+ cursor: "pointer",
+ height: [0, 0, 60]
+ }}
alignItems="center"
- justifyContent="space-between"
- sx={{ display: "flex" }}
+ justifyContent="center"
+ bg="primary"
>
- Properties
- <Text
- as="span"
- onClick={() => {
- hideProperties();
- }}
+ <Icon.ChevronLeft size={32} />
+ </Box>
+
+ <motion.div
+ animate={{ x: arePropertiesVisible ? 0 : 800 }}
+ transition={{
+ duration: 0.5,
+ bounceDamping: 1,
+ bounceStiffness: 1,
+ ease: "easeOut"
+ }}
+ initial={false}
+ style={{
+ position: "absolute",
+ right: 0,
+ display: "flex",
+ width: 280,
+ height: "100%"
+ }}
+ >
+ <Box
sx={{
- color: "red",
- height: 24,
- ":active": { color: "darkRed" }
+ position: "absolute",
+ right: 0,
+ display: "flex",
+ width: [0, 0, "100%"],
+ height: "100%",
+ boxShadow: "-1px 1px 10px 0px #888888"
}}
+ flexDirection="column"
+ bg="background"
+ px={3}
+ py={0}
>
- <Icon.X />
- </Text>
- </Text>
- <CheckBox
- checked={pinned}
- icon={PinIcon}
- label="Pin"
- onChecked={state => changeState("pinned", state)}
- />
- <CheckBox icon={Icon.Star} checked={favorite} label="Favorite" />
- <CheckBox
- icon={Icon.Lock}
- label="Lock"
- checked={locked}
- onClick={toggleLocked}
- />
- <Flex fontSize="body" sx={{ marginBottom: 3 }} alignItems="center">
- <Icon.Book size={18} />
- <Text sx={{ marginLeft: 1 }}>Move to notebook</Text>
- </Flex>
- <Flex fontSize="body" sx={{ marginBottom: 2 }} alignItems="center">
- <Icon.Tag size={18} />
- <Text sx={{ marginLeft: 1 }}>Tags:</Text>
- </Flex>
- <Input
- variant="default"
- placeholder="#tag"
- sx={{ marginBottom: 2 }}
- onKeyUp={event => {
- if (
- event.key === "Enter" ||
- event.key === " " ||
- event.key === ","
- ) {
- const value = event.target.value;
- setTag(value.trim().replace(",", ""));
- event.target.value = "";
- }
- }}
- />
- <Flex
- fontSize="body"
- sx={{ marginBottom: 2 }}
- alignItems="center"
- justifyContent="flex-start"
- flexWrap="wrap"
- >
- {tags.map(tag => (
<Text
- sx={{
- backgroundColor: "primary",
- color: "static",
- borderRadius: "default",
- padding: "2px 5px 2px 5px",
- marginBottom: 1,
- marginRight: 1,
- cursor: "pointer"
- }}
- onClick={() => {
- setTag(tag);
- }}
+ variant="title"
+ color="primary"
+ my={2}
+ alignItems="center"
+ justifyContent="space-between"
+ sx={{ display: "flex" }}
>
- #{tag}
+ Properties
+ <Text
+ as="span"
+ onClick={() => hideProperties()}
+ sx={{
+ color: "red",
+ height: 24,
+ ":active": { color: "darkRed" }
+ }}
+ >
+ <Icon.X />
+ </Text>
</Text>
- ))}
- </Flex>
- <Flex fontSize="body" sx={{ marginBottom: 2 }} alignItems="center">
- <Icon.Octagon size={18} />
- <Text sx={{ marginLeft: 1 }}>Colors:</Text>
- </Flex>
- <Flex flexWrap="wrap" sx={{ marginBottom: 2 }}>
- {objectMap(COLORS, (label, code) => (
+ <CheckBox
+ checked={pinned}
+ icon={PinIcon}
+ label="Pin"
+ onChecked={state => changeState("pinned", state)}
+ />
+ <CheckBox
+ icon={Icon.Star}
+ checked={favorite}
+ label="Favorite"
+ onChecked={state => changeState("favorite", state)}
+ />
+ <CheckBox
+ icon={Icon.Lock}
+ label="Lock"
- onChecked={props.onLocked}
++ checked={locked}
++ onClick={toggleLocked}
+ />
+ <Flex fontSize="body" sx={{ marginBottom: 3 }} alignItems="center">
+ <Icon.Book size={18} />
+ <Text sx={{ marginLeft: 1 }}>Move to notebook</Text>
+ </Flex>
+ <Flex fontSize="body" sx={{ marginBottom: 2 }} alignItems="center">
+ <Icon.Tag size={18} />
+ <Text sx={{ marginLeft: 1 }}>Tags:</Text>
+ </Flex>
+ <Input
+ variant="default"
+ placeholder="#tag"
+ sx={{ marginBottom: 2 }}
+ onKeyUp={event => {
+ if (
+ event.key === "Enter" ||
+ event.key === " " ||
+ event.key === ","
+ ) {
+ const value = event.target.value;
+ if (value.trim().length === 0) {
+ event.target.value = "";
+ return;
+ }
+ setTag(value.trim().replace(",", ""));
+ event.target.value = "";
+ }
+ }}
+ />
<Flex
- sx={{ position: "relative" }}
- justifyContent="center"
+ fontSize="body"
+ sx={{ marginBottom: 2 }}
alignItems="center"
- onClick={() => setColor(label)}
- key={label}
+ justifyContent="flex-start"
+ flexWrap="wrap"
>
- <Icon.Circle
- size={40}
- style={{ cursor: "pointer" }}
- fill={code}
- strokeWidth={0}
- />
- {colors.includes(label) && (
- <Icon.Check
- style={{
- position: "absolute",
- cursor: "pointer",
- color: "white"
+ {tags.map(tag => (
+ <Text
+ sx={{
+ backgroundColor: "primary",
+ color: "static",
+ borderRadius: "default",
+ padding: "2px 5px 2px 5px",
+ marginBottom: 1,
+ marginRight: 1,
+ cursor: "pointer"
}}
- size={20}
- />
- )}
+ onClick={() => {
+ setTag(tag);
+ }}
+ >
+ #{tag}
+ </Text>
+ ))}
+ </Flex>
+ <Flex fontSize="body" sx={{ marginBottom: 2 }} alignItems="center">
+ <Icon.Octagon size={18} />
+ <Text sx={{ marginLeft: 1 }}>Colors:</Text>
+ </Flex>
+ <Flex flexWrap="wrap" sx={{ marginBottom: 2 }}>
+ {objectMap(COLORS, (label, code) => (
+ <Flex
+ sx={{ position: "relative" }}
+ justifyContent="center"
+ alignItems="center"
+ onClick={() => setColor(label)}
+ key={label}
+ >
+ <Icon.Circle
+ size={40}
+ style={{ cursor: "pointer" }}
+ fill={code}
+ strokeWidth={0}
+ />
+ {colors.includes(label) && (
+ <Icon.Check
+ style={{
+ position: "absolute",
+ cursor: "pointer",
+ color: "white"
+ }}
+ size={20}
+ />
+ )}
+ </Flex>
+ ))}
</Flex>
- ))}
- </Flex>
- </Box>
- </>
+ </Box>
+ </motion.div>
+ </>
+ )
);
};