Skip to content

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

ui: improve settings ui

thecodrred1c781775b6
diff --git a/apps/web/src/theme/font/fontsize.js b/apps/web/src/theme/font/fontsize.js
index a48100069..6bf484270 100644
--- a/apps/web/src/theme/font/fontsize.js
+++ b/apps/web/src/theme/font/fontsize.js
@@ -3,11 +3,11 @@ class FontSizeFactory {
return {
heading: 28 * scaleFactor,
input: 16 * scaleFactor,
- title: 18 * scaleFactor,
+ title: 14 * scaleFactor,
subtitle: 16 * scaleFactor,
body: 16 * scaleFactor,
menu: 14 * scaleFactor,
- subBody: 11 * scaleFactor
+ subBody: 11 * scaleFactor,
};
}
}
diff --git a/apps/web/src/theme/variants/button.js b/apps/web/src/theme/variants/button.js
index eced7f489..c21fb1903 100644
--- a/apps/web/src/theme/variants/button.js
+++ b/apps/web/src/theme/variants/button.js
@@ -70,7 +70,12 @@ class List {
borderBottom: "1px solid",
borderBottomColor: "border",
borderRadius: 0,
- p: 2,
+ textAlign: "left",
+ py: 2,
+ px: 0,
+ ":hover": {
+ borderBottomColor: "primary",
+ },
};
}
}
diff --git a/apps/web/src/views/Settings.js b/apps/web/src/views/Settings.js
index 9f6db5912..02900345d 100644
--- a/apps/web/src/views/Settings.js
+++ b/apps/web/src/views/Settings.js
@@ -12,48 +12,79 @@ function Settings(props) {
const toggleNightMode = useThemeStore((store) => store.toggleNightMode);
const user = useUserStore((store) => store.user);
const isLoggedIn = useUserStore((store) => store.isLoggedIn);
+ const isPremium = useUserStore((store) => store.isPremium);
+ const logout = useUserStore((store) => store.logout);
return (
<Flex variant="columnFill" mx={2}>
+ {isLoggedIn && (
+ <Text mb={2} variant="title" color="primary">
+ Account Settings
+ </Text>
+ )}
<Flex
bg="shade"
p={2}
sx={{ borderRadius: "default", cursor: "pointer" }}
onClick={async () => {
- if (isLoggedIn) {
- props.navigator.navigate("account");
- } else {
+ if (!isLoggedIn) {
await showLogInDialog();
}
+ // TODO open buy premium dialog
}}
>
<Flex
- variant="columnCenter"
- bg="primary"
- mr={2}
- size={40}
- sx={{
- borderRadius: 80,
- }}
+ flex="1 1 auto"
+ justifyContent="space-between"
+ alignItems="center"
>
- <Icon.User color="static" />
- </Flex>
- <Flex variant="columnCenter" alignItems="flex-start">
- {isLoggedIn ? (
- <>
- <Text variant="title">{user.username}</Text>
- <Text variant="subBody">{user.email}</Text>
- </>
- ) : (
- <>
- <Text variant="subBody">You are not logged in</Text>
- <Text variant="body" color="primary">
- Login to sync your data
- </Text>
- </>
- )}
+ <Flex>
+ <Flex
+ variant="columnCenter"
+ bg="primary"
+ mr={2}
+ size={40}
+ sx={{
+ borderRadius: 80,
+ }}
+ >
+ <Icon.User color="static" />
+ </Flex>
+ <Flex variant="columnCenter" alignItems="flex-start">
+ {isLoggedIn ? (
+ <>
+ <Text variant="title">{user.username}</Text>
+ <Text variant="subBody">{user.email}</Text>
+ </>
+ ) : (
+ <>
+ <Text variant="subBody">You are not logged in</Text>
+ <Text variant="body" color="primary">
+ Login to sync your data
+ </Text>
+ </>
+ )}
+ </Flex>
+ </Flex>
+ <Text
+ bg="primary"
+ sx={{ borderRadius: "default" }}
+ color="static"
+ fontSize="title"
+ px={1}
+ >
+ {isPremium ? "Pro" : "Trial"}
+ </Text>
</Flex>
</Flex>
+ <Button
+ variant="list"
+ onClick={async () => {
+ await logout();
+ }}
+ >
+ Logout
+ </Button>
<Text my={2} variant="title" color="primary">
Appearance
</Text>