Skip to content

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

ui: minor optimizations

thecodrr8185cb24d83e
diff --git a/apps/web/src/app.js b/apps/web/src/app.js
index e268bacd6..515ab46d8 100644
--- a/apps/web/src/app.js
+++ b/apps/web/src/app.js
@@ -37,9 +37,10 @@ const NavMenuItem = props => {
borderRadius: "none",
textAlign: "center",
color: props.selected ? "primary" : props.item.color || "text",
- transition: "color 100ms linear",
+ transition: "color 100ms, background-color 100ms linear",
":hover": {
- color: "primary"
+ color: "primary",
+ backgroundColor: "shade"
}
}}
px={0}
@@ -112,7 +113,7 @@ function App() {
display: [isSideMenuOpen ? "flex" : "none", "flex", "flex"],
position: ["absolute", "relative", "relative"]
}}
- bg={"shade"}
+ bg={"background"}
px={0}
>
<Box
@@ -176,7 +177,6 @@ function App() {
}}
key={item.key}
item={item}
- selected={selectedIndex === index}
/>
))}
</Box>
diff --git a/apps/web/src/components/editor/titlebox.js b/apps/web/src/components/editor/titlebox.js
index ded24a83d..919af5dfe 100644
--- a/apps/web/src/components/editor/titlebox.js
+++ b/apps/web/src/components/editor/titlebox.js
@@ -27,8 +27,8 @@ export default class TitleBox extends React.Component {
sx={{
borderWidth: 0,
":focus": { outline: "none" },
- paddingTop: 0,
- paddingBottom: 0
+ paddingTop: 1,
+ paddingBottom: 1
}}
px={2}
value={title}
diff --git a/apps/web/src/navigation/index.js b/apps/web/src/navigation/index.js
index fe6490237..363eb89d6 100644
--- a/apps/web/src/navigation/index.js
+++ b/apps/web/src/navigation/index.js
@@ -76,36 +76,42 @@ export default class Navigator {
const NavigationContainer = props => {
const openSideMenu = useStore(store => store.openSideMenu);
+ console.log(props);
return (
<ThemeProvider>
<Flex flexDirection="column" px={2}>
- <Flex alignItems="center">
- {props.canGoBack && (
+ {(props.route.title || props.route.params.title) && (
+ <Flex alignItems="center" py={1}>
+ {props.canGoBack && (
+ <Box
+ onClick={props.backAction}
+ height={38}
+ color="fontPrimary"
+ sx={{ marginLeft: -2 /*correction */, marginRight: 2 }}
+ >
+ <Icon.ChevronLeft size={38} />
+ </Box>
+ )}
<Box
- onClick={props.backAction}
+ onClick={openSideMenu}
height={38}
color="fontPrimary"
- sx={{ marginLeft: -2 /*correction */, marginRight: 2 }}
+ sx={{
+ marginLeft: -5 /*correction */,
+ marginRight: 1,
+ display: ["block", "none", "none"]
+ }}
>
- <Icon.ChevronLeft size={38} />
+ <Icon.Menu size={38} />
</Box>
- )}
- <Box
- onClick={openSideMenu}
- height={38}
- color="fontPrimary"
- sx={{
- marginLeft: -5 /*correction */,
- marginRight: 1,
- display: ["block", "none", "none"]
- }}
- >
- <Icon.Menu size={38} />
- </Box>
- <Heading fontSize="heading" color={props.route.titleColor || "text"}>
- {props.route.title || props.route.params.title}
- </Heading>
- </Flex>
+ <Heading
+ fontSize="heading"
+ color={props.route.titleColor || "text"}
+ >
+ {props.route.title || props.route.params.title}
+ </Heading>
+ </Flex>
+ )}
<Text variant="title" color="primary">
{props.route.params.subtitle}
</Text>
diff --git a/apps/web/src/navigation/navigators/rootnavigator.js b/apps/web/src/navigation/navigators/rootnavigator.js
index c56974cfd..5b8b07257 100644
--- a/apps/web/src/navigation/navigators/rootnavigator.js
+++ b/apps/web/src/navigation/navigators/rootnavigator.js
@@ -30,12 +30,14 @@ export const bottomRoutes = {
};
export const routes = {
- ...createNormalRoute("home", Home, Icon.Home),
+ ...createNormalRoute("home", Home, Icon.Home, { title: "Home" }),
...createRoute("notebooks", NotebooksContainer, {
icon: Icon.Book
}),
- ...createNormalRoute("favorites", Favorites, Icon.Star),
- ...createNormalRoute("trash", Trash, Icon.Trash2),
+ ...createNormalRoute("favorites", Favorites, Icon.Star, {
+ title: "Favorites"
+ }),
+ ...createNormalRoute("trash", Trash, Icon.Trash, { title: "Trash" }),
...createRoute("tags", TagsContainer, { icon: Icon.Tag })
};