Skip to content

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

ui: make ui responsive for mobile

thecodrr216c00109a32
diff --git a/apps/web/src/app.js b/apps/web/src/app.js
index e7c08b0b3..52440ac7d 100644
--- a/apps/web/src/app.js
+++ b/apps/web/src/app.js
@@ -44,7 +44,7 @@ const NavMenuItem = props => {
sx={{ marginLeft: [2, 0, 0] }}
>
<props.item.icon
- size={18}
+ size={"1.125rem"}
strokeWidth={props.selected ? 2 : 1.3}
style={{ marginRight: 2 }}
fill={fill}
@@ -52,7 +52,7 @@ const NavMenuItem = props => {
<Text
sx={{
display: ["flex", "none", "none"],
- fontSize: 15,
+ fontSize: "title",
marginLeft: 1
}}
>
@@ -89,22 +89,36 @@ function App() {
return (
<ThemeProvider>
<Flex
- bg="background"
+ bg={"background"}
sx={{ color: "text" }}
height="100%"
alignContent="stretch"
>
- <Flex
+ <Box
+ display={[sideMenuOpen ? "block" : "none", "none", "none"]}
+ width={"full"}
+ height={"full"}
+ bg={"#00000099"}
+ sx={{ position: "absolute", zIndex: 999 }}
+ onClick={() => setSideMenuOpen(false)}
+ />
+ <Box
flexDirection="column"
justifyContent="space-between"
sx={{
zIndex: 999,
- borderRight: "1px solid",
+ borderRightStyle: "solid",
+ borderRightWidth: [0, "1px", "1px"],
borderRightColor: "primary",
minWidth: ["85%", 50, 50],
maxWidth: ["85%", 50, 50],
+ height: "full",
display: [sideMenuOpen ? "flex" : "none", "flex", "flex"],
- position: ["absolute", "relative", "relative"],
+ position: [
+ sideMenuOpen ? "absolute" : "relative",
+ "relative",
+ "relative"
+ ],
overflow: "scroll",
scrollbarWidth: "none",
//TODO: need to test this on webkit and internet explorer
@@ -112,7 +126,7 @@ function App() {
msOverflowStyle: "none"
//"-ms-overflow-style": "none"
}}
- bg={"shade"}
+ bg={["background", "shade", "shade"]}
px={0}
>
<Box>
@@ -121,16 +135,14 @@ function App() {
!item.bottom && (
<NavMenuItem
onSelected={async () => {
- if (item.onClick) {
- return item.onClick();
- }
- if (selectedIndex === index) {
+ if (selectedIndex === index || !sideMenuOpen) {
setShow(!show);
return;
}
if (RootNavigator.navigate(item.key)) {
setSelectedIndex(index);
}
+ setSideMenuOpen(false);
}}
key={item.key}
item={item}
@@ -155,6 +167,7 @@ function App() {
if (RootNavigator.navigate(item.key)) {
setSelectedIndex(index);
}
+ setSideMenuOpen(false);
}}
key={item.key}
item={item}
@@ -163,7 +176,7 @@ function App() {
)
)}
</Box>
- </Flex>
+ </Box>
<Flex flex="1 1 auto" flexDirection="row" alignContent="stretch" px={0}>
<Flex
className="RootNavigator"
diff --git a/apps/web/src/index.css b/apps/web/src/index.css
index 4ddb1a97d..37dde38bb 100644
--- a/apps/web/src/index.css
+++ b/apps/web/src/index.css
@@ -1,4 +1,5 @@
@import url("https://fonts.googleapis.com/css?family=Noto+Sans:400,700|Noto+Serif:400,700&display=swap");
+@import url("https://fonts.googleapis.com/css?family=Cinzel:700|Playfair+Display+SC:700|Rufina:700&display=swap");
:root,
body,
diff --git a/apps/web/src/navigation/index.js b/apps/web/src/navigation/index.js
index 3e81f4656..56650c912 100644
--- a/apps/web/src/navigation/index.js
+++ b/apps/web/src/navigation/index.js
@@ -91,15 +91,14 @@ const NavigationContainer = props => {
)}
<Box
onClick={() => ev.emit("openSideMenu")}
- height={38}
+ height={36}
color="fontPrimary"
sx={{
- marginLeft: -5 /*correction */,
- marginRight: 1,
+ marginRight: 3,
display: ["block", "none", "none"]
}}
>
- <Icon.Menu size={38} />
+ <Icon.Menu size={36} />
</Box>
<Heading fontSize="heading">
{props.route.title || props.route.params.title}
diff --git a/apps/web/src/navigation/navigators/rootnavigator.js b/apps/web/src/navigation/navigators/rootnavigator.js
index ec34de42a..aa699b29e 100644
--- a/apps/web/src/navigation/navigators/rootnavigator.js
+++ b/apps/web/src/navigation/navigators/rootnavigator.js
@@ -31,26 +31,29 @@ const bottomRoutes = {
...createDeadRoute("nightmode", Icon.Moon, {
onClick: () => changeTheme(),
bottom: true,
- isToggled: () => isDarkTheme()
+ isToggled: () => isDarkTheme(),
+ title: "Night mode"
}),
...createDeadRoute("signin", Icon.LogIn, {
onClick: () => showSignInDialog(Icon.LogIn, "Login", ""),
- bottom: true
+ bottom: true,
+ title: "Login"
}),
...createRoute("settings", SettingsContainer, {
icon: Icon.Settings,
- bottom: true
+ bottom: true,
+ title: "Settings"
})
};
const routes = {
...createNormalRoute("home", Home, Icon.Home),
...createRoute("notebooks", NotebooksContainer, {
- icon: Icon.Book
+ icon: Icon.Book,
+ title: "Notebooks"
}),
...createNormalRoute("favorites", Favorites, Icon.Star),
...createNormalRoute("trash", Trash, Icon.Trash2),
- ...colorRoutes,
...bottomRoutes
};