mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-08-29 10:09:26 +02:00
Compare commits
116 Commits
editor/inl
...
theme-buil
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ef9180894 | ||
|
|
d1a2ec580d | ||
|
|
0a057e2b32 | ||
|
|
29611ffdef | ||
|
|
85fa49f53e | ||
|
|
703853bd8a | ||
|
|
9b046c6b6f | ||
|
|
d10e08a158 | ||
|
|
ad67947ad7 | ||
|
|
1574ae7a28 | ||
|
|
56201cb408 | ||
|
|
b3fc476352 | ||
|
|
fdd24a90d5 | ||
|
|
5140fd7108 | ||
|
|
becd852165 | ||
|
|
700f5e4205 | ||
|
|
4245ac1451 | ||
|
|
26e44798ec | ||
|
|
9648913a02 | ||
|
|
7091f64de8 | ||
|
|
e5ec15fd9c | ||
|
|
c067c73b33 | ||
|
|
d304f708c7 | ||
|
|
71cf9955cd | ||
|
|
c5fcfd6654 | ||
|
|
67a1c55420 | ||
|
|
6c54f28c0f | ||
|
|
c576671302 | ||
|
|
6e663bf913 | ||
|
|
0f999947ee | ||
|
|
ab458486a2 | ||
|
|
5e627b567f | ||
|
|
2ef7baab0a | ||
|
|
56ede7654a | ||
|
|
18ccbc0ba3 | ||
|
|
73f50a34f9 | ||
|
|
c0805b1915 | ||
|
|
3c9a62b8ed | ||
|
|
b61c094a5d | ||
|
|
7f7390810f | ||
|
|
09ea2f577b | ||
|
|
cbcd7a9e5a | ||
|
|
bca774dfd0 | ||
|
|
0b56bdb0c4 | ||
|
|
cdf481d581 | ||
|
|
c644f606f3 | ||
|
|
c45e029780 | ||
|
|
59422d3e9c | ||
|
|
f0df45bd82 | ||
|
|
c5ce153c00 | ||
|
|
3e7d68f524 | ||
|
|
e4eea50319 | ||
|
|
47e0c54ab0 | ||
|
|
1ff1319e8a | ||
|
|
16c46d3fc7 | ||
|
|
8362c39277 | ||
|
|
eedf347708 | ||
|
|
403b2809b7 | ||
|
|
6c551eef0a | ||
|
|
d34b354420 | ||
|
|
38a4652c29 | ||
|
|
228c1a4d3a | ||
|
|
7bca693c44 | ||
|
|
583fa3da49 | ||
|
|
2ff73e241d | ||
|
|
fe2c753068 | ||
|
|
19201186c5 | ||
|
|
b2dd6b750d | ||
|
|
25380ec052 | ||
|
|
81cc687e1e | ||
|
|
1dab6be32d | ||
|
|
b9bfeee126 | ||
|
|
a06fa9f00e | ||
|
|
b147afbefe | ||
|
|
7646f35e58 | ||
|
|
beb782b9ad | ||
|
|
6e3f706b3a | ||
|
|
f01d415415 | ||
|
|
b6417d0016 | ||
|
|
f1ab8e92bd | ||
|
|
80ffbc511d | ||
|
|
745bf65641 | ||
|
|
a0015af169 | ||
|
|
e6e775dbeb | ||
|
|
e082007a49 | ||
|
|
deced99339 | ||
|
|
b0acce7b4f | ||
|
|
e081e7ea09 | ||
|
|
35db89aa11 | ||
|
|
679a912e2b | ||
|
|
627259e129 | ||
|
|
70c8201355 | ||
|
|
064059278a | ||
|
|
959e7466a6 | ||
|
|
69bd277d87 | ||
|
|
5833832123 | ||
|
|
37187403d4 | ||
|
|
b24d52bbbd | ||
|
|
82142d11aa | ||
|
|
19b4d84c40 | ||
|
|
fd98b89900 | ||
|
|
1870406b5e | ||
|
|
64e5f63f70 | ||
|
|
02f75ac1cd | ||
|
|
52849a5bf3 | ||
|
|
f64c91faec | ||
|
|
c7ae14f239 | ||
|
|
9ab084d793 | ||
|
|
6514b98ce8 | ||
|
|
5a5cacee4f | ||
|
|
04451eee5d | ||
|
|
6e7558b364 | ||
|
|
9c02fed3af | ||
|
|
5d7195fb41 | ||
|
|
6cd1178347 | ||
|
|
b7b4a18624 |
@@ -19,8 +19,10 @@ const SCOPES = [
|
||||
"editor",
|
||||
"logger",
|
||||
"theme",
|
||||
"server",
|
||||
"core",
|
||||
"fs",
|
||||
"ui",
|
||||
"clipper",
|
||||
"config",
|
||||
"ci",
|
||||
|
||||
@@ -16,6 +16,10 @@ GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {
|
||||
THEME_COMPATIBILITY_VERSION,
|
||||
useThemeEngineStore
|
||||
} from "@notesnook/theme";
|
||||
import React, { useEffect } from "react";
|
||||
import { View } from "react-native";
|
||||
import "react-native-gesture-handler";
|
||||
@@ -29,7 +33,9 @@ import { ApplicationHolder } from "./navigation";
|
||||
import Notifications from "./services/notifications";
|
||||
import SettingsService from "./services/settings";
|
||||
import { TipManager } from "./services/tip-manager";
|
||||
import { useThemeStore } from "./stores/use-theme-store";
|
||||
import { useUserStore } from "./stores/use-user-store";
|
||||
import { themeTrpcClient } from "./screens/settings/theme-selector";
|
||||
|
||||
SettingsService.init();
|
||||
SettingsService.checkOrientation();
|
||||
@@ -87,4 +93,43 @@ const App = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default withErrorBoundry(App, "App");
|
||||
export const withTheme = (Element) => {
|
||||
return function AppWithThemeProvider() {
|
||||
const [colorScheme, darkTheme, lightTheme] = useThemeStore((state) => [
|
||||
state.colorScheme,
|
||||
state.darkTheme,
|
||||
state.lightTheme
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
const currentTheme = colorScheme === "dark" ? darkTheme : lightTheme;
|
||||
if (!currentTheme) return;
|
||||
themeTrpcClient.updateTheme
|
||||
.query({
|
||||
version: currentTheme.version,
|
||||
compatibilityVersion: THEME_COMPATIBILITY_VERSION,
|
||||
id: currentTheme.id
|
||||
})
|
||||
.then((theme) => {
|
||||
if (theme) {
|
||||
console.log(theme.version, "theme updated");
|
||||
theme.colorScheme === "dark"
|
||||
? useThemeStore.getState().setDarkTheme(theme)
|
||||
: useThemeStore.getState().setLightTheme(theme);
|
||||
}
|
||||
})
|
||||
.catch(console.log);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
useThemeEngineStore
|
||||
.getState()
|
||||
.setTheme(colorScheme === "dark" ? darkTheme : lightTheme);
|
||||
}, [colorScheme, darkTheme, lightTheme]);
|
||||
|
||||
return <Element />;
|
||||
};
|
||||
};
|
||||
|
||||
export default withTheme(withErrorBoundry(App, "App"));
|
||||
|
||||
@@ -21,18 +21,18 @@ import React from "react";
|
||||
import { FlatList, View } from "react-native";
|
||||
import { useSelectionStore } from "../../stores/use-selection-store";
|
||||
import { useMessageStore } from "../../stores/use-message-store";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { allowedOnPlatform, renderItem } from "./functions";
|
||||
|
||||
export const Announcement = ({ color }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const announcements = useMessageStore((state) => state.announcements);
|
||||
let announcement = announcements.length > 0 ? announcements[0] : null;
|
||||
const selectionMode = useSelectionStore((state) => state.selectionMode);
|
||||
return !announcement || selectionMode ? null : (
|
||||
<View
|
||||
style={{
|
||||
backgroundColor: colors.bg,
|
||||
backgroundColor: colors.primary.background,
|
||||
width: "100%",
|
||||
paddingHorizontal: 12,
|
||||
paddingTop: 12,
|
||||
@@ -44,28 +44,26 @@ export const Announcement = ({ color }) => {
|
||||
width: "100%",
|
||||
borderRadius: 10,
|
||||
overflow: "hidden",
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
paddingBottom: 12
|
||||
}}
|
||||
>
|
||||
<View>
|
||||
<FlatList
|
||||
style={{
|
||||
width: "100%",
|
||||
marginTop: 12
|
||||
}}
|
||||
data={announcement?.body.filter((item) =>
|
||||
allowedOnPlatform(item.platforms)
|
||||
)}
|
||||
renderItem={({ item, index }) =>
|
||||
<View
|
||||
style={{
|
||||
width: "100%",
|
||||
marginTop: 12
|
||||
}}
|
||||
>
|
||||
{announcement?.body
|
||||
.filter((item) => allowedOnPlatform(item.platforms))
|
||||
.map((item, index) =>
|
||||
renderItem({
|
||||
item: item,
|
||||
index: index,
|
||||
color: colors[color],
|
||||
inline: true
|
||||
})
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
@@ -22,7 +22,7 @@ import { Linking, View } from "react-native";
|
||||
//import SettingsBackupAndRestore from '../../screens/settings/backup-restore';
|
||||
import { eSendEvent, presentSheet } from "../../services/event-manager";
|
||||
import Sync from "../../services/sync";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { eCloseAnnouncementDialog, eCloseSheet } from "../../utils/events";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import { sleep } from "../../utils/time";
|
||||
@@ -33,7 +33,7 @@ import { Button } from "../ui/button";
|
||||
import { allowedOnPlatform, getStyle } from "./functions";
|
||||
|
||||
export const Cta = ({ actions, style = {}, color, inline }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
let buttons =
|
||||
actions.filter((item) => allowedOnPlatform(item.platforms)) || [];
|
||||
|
||||
@@ -92,8 +92,7 @@ export const Cta = ({ actions, style = {}, color, inline }) => {
|
||||
style={{
|
||||
height: 30,
|
||||
alignSelf: "flex-start",
|
||||
paddingHorizontal: 0,
|
||||
marginTop: -6
|
||||
paddingHorizontal: 0
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
@@ -111,7 +110,6 @@ export const Cta = ({ actions, style = {}, color, inline }) => {
|
||||
style={{
|
||||
alignSelf: "flex-start",
|
||||
paddingHorizontal: 0,
|
||||
marginTop: -6,
|
||||
marginLeft: 12
|
||||
}}
|
||||
textStyle={{
|
||||
@@ -129,9 +127,9 @@ export const Cta = ({ actions, style = {}, color, inline }) => {
|
||||
title={item.title}
|
||||
fontSize={SIZE.md}
|
||||
buttonType={{
|
||||
color: color ? color : colors.accent,
|
||||
text: colors.light,
|
||||
selected: color ? color : colors.accent,
|
||||
color: color ? color : colors.primary.accent,
|
||||
text: colors.static.white,
|
||||
selected: color ? color : colors.primary.accent,
|
||||
opacity: 1
|
||||
}}
|
||||
onPress={() => onPress(item)}
|
||||
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
eUnSubscribeEvent
|
||||
} from "../../services/event-manager";
|
||||
import { useMessageStore } from "../../stores/use-message-store";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import {
|
||||
eCloseAnnouncementDialog,
|
||||
eOpenAnnouncementDialog
|
||||
@@ -35,7 +35,7 @@ import { allowedOnPlatform, renderItem } from "./functions";
|
||||
import { useCallback } from "react";
|
||||
|
||||
export const AnnouncementDialog = () => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [info, setInfo] = useState(null);
|
||||
const remove = useMessageStore((state) => state.remove);
|
||||
@@ -73,7 +73,7 @@ export const AnnouncementDialog = () => {
|
||||
<View
|
||||
style={{
|
||||
width: DDS.isTab ? 600 : "100%",
|
||||
backgroundColor: colors.bg,
|
||||
backgroundColor: colors.primary.background,
|
||||
maxHeight: DDS.isTab ? "90%" : "100%",
|
||||
borderRadius: DDS.isTab ? 10 : 0,
|
||||
overflow: "hidden",
|
||||
|
||||
@@ -24,7 +24,7 @@ import { db } from "../../common/database";
|
||||
import { useAppState } from "../../hooks/use-app-state";
|
||||
import BiometricService from "../../services/biometrics";
|
||||
import { useSettingStore } from "../../stores/use-setting-store";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { useUserStore } from "../../stores/use-user-store";
|
||||
import { NotesnookModule } from "../../utils/notesnook-module";
|
||||
import { SIZE } from "../../utils/size";
|
||||
@@ -36,7 +36,7 @@ import Heading from "../ui/typography/heading";
|
||||
import Paragraph from "../ui/typography/paragraph";
|
||||
|
||||
const AppLockedOverlay = () => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const user = useUserStore((state) => state.user);
|
||||
const appLocked = useUserStore((state) => state.appLocked);
|
||||
const lockApp = useUserStore((state) => state.lockApp);
|
||||
@@ -134,10 +134,10 @@ const AppLockedOverlay = () => {
|
||||
marginTop: user ? 0 : 50
|
||||
}}
|
||||
onPress={onUnlockAppRequested}
|
||||
color={colors.border}
|
||||
color={colors.primary.border}
|
||||
/>
|
||||
<Heading
|
||||
color={colors.heading}
|
||||
color={colors.primary.heading}
|
||||
style={{
|
||||
alignSelf: "center",
|
||||
textAlign: "center"
|
||||
|
||||
@@ -33,7 +33,7 @@ import {
|
||||
} from "../../services/event-manager";
|
||||
import PremiumService from "../../services/premium";
|
||||
import { useAttachmentStore } from "../../stores/use-attachment-store";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { eCloseAttachmentDialog, eCloseSheet } from "../../utils/events";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import { sleep } from "../../utils/time";
|
||||
@@ -49,7 +49,7 @@ import Paragraph from "../ui/typography/paragraph";
|
||||
import { formatBytes } from "@notesnook/common";
|
||||
|
||||
const Actions = ({ attachment, setAttachments, fwdRef }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const contextId = attachment.metadata.hash;
|
||||
const [filename, setFilename] = useState(attachment.metadata.filename);
|
||||
const [currentProgress] = useAttachmentProgress(attachment);
|
||||
@@ -194,7 +194,7 @@ const Actions = ({ attachment, setAttachments, fwdRef }) => {
|
||||
<View
|
||||
style={{
|
||||
borderBottomWidth: 1,
|
||||
borderBottomColor: colors.nav,
|
||||
borderBottomColor: colors.secondary.background,
|
||||
marginBottom: notes && notes.length > 0 ? 0 : 12
|
||||
}}
|
||||
>
|
||||
@@ -219,7 +219,7 @@ const Actions = ({ attachment, setAttachments, fwdRef }) => {
|
||||
style={{
|
||||
marginRight: 10
|
||||
}}
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
>
|
||||
{attachment.metadata.type}
|
||||
</Paragraph>
|
||||
@@ -228,7 +228,7 @@ const Actions = ({ attachment, setAttachments, fwdRef }) => {
|
||||
marginRight: 10
|
||||
}}
|
||||
size={SIZE.xs}
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
>
|
||||
{formatBytes(attachment.length)}
|
||||
</Paragraph>
|
||||
@@ -239,7 +239,7 @@ const Actions = ({ attachment, setAttachments, fwdRef }) => {
|
||||
marginRight: 10
|
||||
}}
|
||||
size={SIZE.xs}
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
>
|
||||
{attachment.noteIds.length} note
|
||||
{attachment.noteIds.length > 1 ? "s" : ""}
|
||||
@@ -255,7 +255,7 @@ const Actions = ({ attachment, setAttachments, fwdRef }) => {
|
||||
});
|
||||
}}
|
||||
size={SIZE.xs}
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
>
|
||||
{attachment.metadata.hash}
|
||||
</Paragraph>
|
||||
@@ -268,7 +268,7 @@ const Actions = ({ attachment, setAttachments, fwdRef }) => {
|
||||
<View
|
||||
style={{
|
||||
borderBottomWidth: 1,
|
||||
borderBottomColor: colors.nav,
|
||||
borderBottomColor: colors.secondary.background,
|
||||
marginBottom: 12,
|
||||
paddingVertical: 12
|
||||
}}
|
||||
@@ -322,10 +322,10 @@ const Actions = ({ attachment, setAttachments, fwdRef }) => {
|
||||
key={item.name}
|
||||
buttonType={{
|
||||
text: item.on
|
||||
? colors.accent
|
||||
? colors.primary.accent
|
||||
: item.name === "Delete" || item.name === "PermDelete"
|
||||
? colors.errorText
|
||||
: colors.pri
|
||||
? colors.error.paragraph
|
||||
: colors.primary.paragraph
|
||||
}}
|
||||
onPress={item.onPress}
|
||||
title={item.name}
|
||||
|
||||
@@ -23,7 +23,7 @@ import { TouchableOpacity, View } from "react-native";
|
||||
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
|
||||
import { db } from "../../common/database";
|
||||
import { useAttachmentProgress } from "../../hooks/use-attachment-progress";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import { IconButton } from "../ui/icon-button";
|
||||
import { ProgressCircleComponent } from "../ui/svg/lazy";
|
||||
@@ -43,12 +43,11 @@ export const AttachmentItem = ({
|
||||
hideWhenNotDownloading,
|
||||
context
|
||||
}) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const [currentProgress, setCurrentProgress] = useAttachmentProgress(
|
||||
attachment,
|
||||
encryption
|
||||
);
|
||||
|
||||
const onPress = () => {
|
||||
if (!pressable) return;
|
||||
Actions.present(attachment, setAttachments, context);
|
||||
@@ -66,7 +65,7 @@ export const AttachmentItem = ({
|
||||
padding: 12,
|
||||
paddingVertical: 6,
|
||||
borderRadius: 5,
|
||||
backgroundColor: colors.nav
|
||||
backgroundColor: colors.secondary.background
|
||||
}}
|
||||
type="grayBg"
|
||||
>
|
||||
@@ -84,12 +83,12 @@ export const AttachmentItem = ({
|
||||
marginLeft: -5
|
||||
}}
|
||||
>
|
||||
<Icon name="file" size={SIZE.xxxl} color={colors.icon} />
|
||||
<Icon name="file" size={SIZE.xxxl} color={colors.primary.icon} />
|
||||
|
||||
<Paragraph
|
||||
adjustsFontSizeToFit
|
||||
size={6}
|
||||
color={colors.light}
|
||||
color={colors.static.white}
|
||||
style={{
|
||||
position: "absolute"
|
||||
}}
|
||||
@@ -112,13 +111,13 @@ export const AttachmentItem = ({
|
||||
}}
|
||||
numberOfLines={1}
|
||||
lineBreakMode="middle"
|
||||
color={colors.pri}
|
||||
color={colors.primary.paragraph}
|
||||
>
|
||||
{attachment.metadata.filename}
|
||||
</Paragraph>
|
||||
|
||||
{!hideWhenNotDownloading ? (
|
||||
<Paragraph color={colors.icon} size={SIZE.xs}>
|
||||
<Paragraph color={colors.secondary.paragraph} size={SIZE.xs}>
|
||||
{formatBytes(attachment.length)}{" "}
|
||||
{currentProgress?.type
|
||||
? "(" + currentProgress.type + "ing - tap to cancel)"
|
||||
@@ -150,7 +149,7 @@ export const AttachmentItem = ({
|
||||
textStyle={{
|
||||
fontSize: 10
|
||||
}}
|
||||
color={colors.accent}
|
||||
color={colors.primary.accent}
|
||||
formatText={(progress) => (progress * 100).toFixed(0)}
|
||||
borderWidth={0}
|
||||
thickness={2}
|
||||
@@ -162,7 +161,7 @@ export const AttachmentItem = ({
|
||||
<IconButton
|
||||
onPress={onPress}
|
||||
name="alert-circle-outline"
|
||||
color={colors.errorText}
|
||||
color={colors.error.paragraph}
|
||||
/>
|
||||
) : null}
|
||||
</>
|
||||
|
||||
@@ -26,12 +26,12 @@ import { Button } from "../ui/button";
|
||||
import Heading from "../ui/typography/heading";
|
||||
import Paragraph from "../ui/typography/paragraph";
|
||||
import { ProgressBarComponent } from "../ui/svg/lazy";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { FlatList } from "react-native-actions-sheet";
|
||||
import { AttachmentItem } from "./attachment-item";
|
||||
|
||||
const DownloadAttachments = ({ close, attachments, isNote, update }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const [downloading, setDownloading] = useState(false);
|
||||
const [progress, setProgress] = useState({
|
||||
value: 0,
|
||||
@@ -158,8 +158,8 @@ const DownloadAttachments = ({ close, attachments, isNote, update }) => {
|
||||
animated={true}
|
||||
useNativeDriver
|
||||
progress={progress.value ? progress.value / attachments.length : 0}
|
||||
unfilledColor={colors.nav}
|
||||
color={colors.accent}
|
||||
unfilledColor={colors.secondary.background}
|
||||
color={colors.primary.accent}
|
||||
borderWidth={0}
|
||||
/>
|
||||
</View>
|
||||
@@ -170,7 +170,7 @@ const DownloadAttachments = ({ close, attachments, isNote, update }) => {
|
||||
maxHeight: 300,
|
||||
width: "100%",
|
||||
minHeight: 60,
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
borderRadius: 5,
|
||||
marginVertical: 12
|
||||
}}
|
||||
@@ -184,7 +184,9 @@ const DownloadAttachments = ({ close, attachments, isNote, update }) => {
|
||||
height: 60
|
||||
}}
|
||||
>
|
||||
<Paragraph color={colors.icon}>No downloads in progress.</Paragraph>
|
||||
<Paragraph color={colors.secondary.paragraph}>
|
||||
No downloads in progress.
|
||||
</Paragraph>
|
||||
</View>
|
||||
}
|
||||
keyExtractor={(item) => item.id}
|
||||
|
||||
@@ -24,7 +24,7 @@ import Icon from "react-native-vector-icons/MaterialCommunityIcons";
|
||||
import { db } from "../../common/database";
|
||||
import filesystem from "../../common/filesystem";
|
||||
import { presentSheet } from "../../services/event-manager";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import SheetProvider from "../sheet-provider";
|
||||
import { IconButton } from "../ui/icon-button";
|
||||
@@ -45,7 +45,7 @@ import { useSettingStore } from "../../stores/use-setting-store";
|
||||
import { FlashList } from "react-native-actions-sheet/dist/src/views/FlashList";
|
||||
|
||||
export const AttachmentDialog = ({ note }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const { height } = useSettingStore((state) => state.dimensions);
|
||||
const [attachments, setAttachments] = useState(
|
||||
note
|
||||
@@ -201,7 +201,7 @@ export const AttachmentDialog = ({ note }) => {
|
||||
width: 40,
|
||||
marginRight: 10
|
||||
}}
|
||||
color={colors.pri}
|
||||
color={colors.primary.paragraph}
|
||||
size={SIZE.lg}
|
||||
onPress={onCheck}
|
||||
/>
|
||||
@@ -213,7 +213,7 @@ export const AttachmentDialog = ({ note }) => {
|
||||
height: 40,
|
||||
width: 40
|
||||
}}
|
||||
color={colors.pri}
|
||||
color={colors.primary.paragraph}
|
||||
onPress={() => {
|
||||
DownloadAttachments.present(
|
||||
"attachments-list",
|
||||
@@ -264,7 +264,7 @@ export const AttachmentDialog = ({ note }) => {
|
||||
borderBottomColor:
|
||||
currentFilter !== item.filterBy
|
||||
? "transparent"
|
||||
: colors.accent
|
||||
: colors.primary.accent
|
||||
}}
|
||||
onPress={() => {
|
||||
setCurrentFilter(item.filterBy);
|
||||
@@ -285,7 +285,7 @@ export const AttachmentDialog = ({ note }) => {
|
||||
alignItems: "center"
|
||||
}}
|
||||
>
|
||||
<Icon name="attachment" size={60} color={colors.icon} />
|
||||
<Icon name="attachment" size={60} color={colors.secondary.icon} />
|
||||
<Paragraph>
|
||||
{note ? "No attachments on this note" : "No attachments"}
|
||||
</Paragraph>
|
||||
@@ -304,14 +304,18 @@ export const AttachmentDialog = ({ note }) => {
|
||||
/>
|
||||
|
||||
<Paragraph
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
size={SIZE.xs}
|
||||
style={{
|
||||
textAlign: "center",
|
||||
marginTop: 10
|
||||
}}
|
||||
>
|
||||
<Icon name="shield-key-outline" size={SIZE.xs} color={colors.icon} />
|
||||
<Icon
|
||||
name="shield-key-outline"
|
||||
size={SIZE.xs}
|
||||
color={colors.primary.icon}
|
||||
/>
|
||||
{" "}All attachments are end-to-end encrypted.
|
||||
</Paragraph>
|
||||
</View>
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
eSubscribeEvent,
|
||||
eUnSubscribeEvent
|
||||
} from "../../services/event-manager";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { eCloseLoginDialog, eOpenLoginDialog } from "../../utils/events";
|
||||
import { sleep } from "../../utils/time";
|
||||
import BaseDialog from "../dialog/base-dialog";
|
||||
@@ -44,7 +44,7 @@ export const AuthMode = {
|
||||
};
|
||||
|
||||
const AuthModal = () => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [currentAuthMode, setCurrentAuthMode] = useState(AuthMode.login);
|
||||
const actionSheetRef = useRef();
|
||||
@@ -82,7 +82,7 @@ const AuthModal = () => {
|
||||
onClose={close}
|
||||
useSafeArea={false}
|
||||
bounce={false}
|
||||
background={colors.bg}
|
||||
background={colors.primary.background}
|
||||
transparent={false}
|
||||
animated={false}
|
||||
>
|
||||
@@ -112,7 +112,7 @@ const AuthModal = () => {
|
||||
paddingTop: Platform.OS === "android" ? 0 : insets.top,
|
||||
top: 0,
|
||||
zIndex: 999,
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
width: "100%"
|
||||
}}
|
||||
>
|
||||
@@ -135,7 +135,7 @@ const AuthModal = () => {
|
||||
onPress={() => {
|
||||
hideAuth();
|
||||
}}
|
||||
color={colors.pri}
|
||||
color={colors.primary.paragraph}
|
||||
/>
|
||||
)}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import { db } from "../../common/database";
|
||||
import { DDS } from "../../services/device-detection";
|
||||
import { ToastEvent } from "../../services/event-manager";
|
||||
import SettingsService from "../../services/settings";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import DialogHeader from "../dialog/dialog-header";
|
||||
import { Button } from "../ui/button";
|
||||
import { IconButton } from "../ui/icon-button";
|
||||
@@ -34,7 +34,7 @@ import Heading from "../ui/typography/heading";
|
||||
import Paragraph from "../ui/typography/paragraph";
|
||||
|
||||
export const ForgotPassword = () => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors("sheet");
|
||||
const email = useRef();
|
||||
const emailInputRef = useRef();
|
||||
const [error, setError] = useState(false);
|
||||
@@ -117,7 +117,7 @@ export const ForgotPassword = () => {
|
||||
width: null,
|
||||
height: null
|
||||
}}
|
||||
color={colors.accent}
|
||||
color={colors.primary.accent}
|
||||
name="email"
|
||||
size={50}
|
||||
/>
|
||||
@@ -134,7 +134,7 @@ export const ForgotPassword = () => {
|
||||
<View
|
||||
style={{
|
||||
borderRadius: DDS.isTab ? 5 : 0,
|
||||
backgroundColor: colors.bg,
|
||||
backgroundColor: colors.primary.background,
|
||||
zIndex: 10,
|
||||
width: "100%",
|
||||
padding: 12
|
||||
|
||||
@@ -65,7 +65,7 @@ const Auth = ({ navigation, route }) => {
|
||||
onPress={() => {
|
||||
hideAuth();
|
||||
}}
|
||||
color={colors.pri}
|
||||
color={colors.primary.paragraph}
|
||||
customStyle={{
|
||||
position: 'absolute',
|
||||
zIndex: 999,
|
||||
|
||||
@@ -22,7 +22,7 @@ import { TouchableOpacity, View, useWindowDimensions } from "react-native";
|
||||
import { SheetManager } from "react-native-actions-sheet";
|
||||
import { DDS } from "../../services/device-detection";
|
||||
import { eSendEvent } from "../../services/event-manager";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import { sleep } from "../../utils/time";
|
||||
import SheetProvider from "../sheet-provider";
|
||||
@@ -46,7 +46,7 @@ const LoginSteps = {
|
||||
};
|
||||
|
||||
export const Login = ({ changeMode }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const [focused, setFocused] = useState(false);
|
||||
const {
|
||||
step,
|
||||
@@ -92,7 +92,7 @@ export const Login = ({ changeMode }) => {
|
||||
<View
|
||||
style={{
|
||||
borderRadius: DDS.isTab ? 5 : 0,
|
||||
backgroundColor: colors.bg,
|
||||
backgroundColor: colors.primary.background,
|
||||
zIndex: 10,
|
||||
width: "100%",
|
||||
alignSelf: "center"
|
||||
@@ -102,13 +102,13 @@ export const Login = ({ changeMode }) => {
|
||||
style={{
|
||||
justifyContent: "flex-end",
|
||||
paddingHorizontal: 20,
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
borderBottomWidth: 1,
|
||||
marginBottom: 12,
|
||||
borderBottomColor: colors.border,
|
||||
borderBottomColor: colors.primary.border,
|
||||
alignSelf: deviceMode !== "mobile" ? "center" : undefined,
|
||||
borderWidth: deviceMode !== "mobile" ? 1 : null,
|
||||
borderColor: deviceMode !== "mobile" ? colors.border : null,
|
||||
borderColor: deviceMode !== "mobile" ? colors.primary.border : null,
|
||||
borderRadius: deviceMode !== "mobile" ? 20 : null,
|
||||
marginTop: deviceMode !== "mobile" ? 50 : null,
|
||||
width: deviceMode === "mobile" ? null : "50%",
|
||||
@@ -124,7 +124,7 @@ export const Login = ({ changeMode }) => {
|
||||
style={{
|
||||
width: 100,
|
||||
height: 5,
|
||||
backgroundColor: colors.accent,
|
||||
backgroundColor: colors.primary.accent,
|
||||
borderRadius: 2,
|
||||
marginRight: 7
|
||||
}}
|
||||
@@ -134,7 +134,7 @@ export const Login = ({ changeMode }) => {
|
||||
style={{
|
||||
width: 20,
|
||||
height: 5,
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
borderRadius: 2
|
||||
}}
|
||||
/>
|
||||
@@ -160,7 +160,7 @@ export const Login = ({ changeMode }) => {
|
||||
: focused
|
||||
? "100%"
|
||||
: "99.9%",
|
||||
backgroundColor: colors.bg,
|
||||
backgroundColor: colors.primary.background,
|
||||
alignSelf: "center",
|
||||
paddingHorizontal: 20
|
||||
}}
|
||||
@@ -281,11 +281,14 @@ export const Login = ({ changeMode }) => {
|
||||
paddingVertical: 12
|
||||
}}
|
||||
>
|
||||
<Paragraph size={SIZE.xs + 1} color={colors.icon}>
|
||||
<Paragraph
|
||||
size={SIZE.xs + 1}
|
||||
color={colors.secondary.paragraph}
|
||||
>
|
||||
Don't have an account?{" "}
|
||||
<Paragraph
|
||||
size={SIZE.xs + 1}
|
||||
style={{ color: colors.accent }}
|
||||
style={{ color: colors.primary.accent }}
|
||||
>
|
||||
Sign up
|
||||
</Paragraph>
|
||||
|
||||
@@ -28,7 +28,7 @@ import {
|
||||
} from "../../services/event-manager";
|
||||
import SettingsService from "../../services/settings";
|
||||
import Sync from "../../services/sync";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { eLoginSessionExpired, eUserLoggedIn } from "../../utils/events";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import { sleep } from "../../utils/time";
|
||||
@@ -56,7 +56,7 @@ function getObfuscatedEmail(email) {
|
||||
}
|
||||
|
||||
export const SessionExpired = () => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [focused, setFocused] = useState(false);
|
||||
const { step, password, email, passwordInputRef, loading, login } = useLogin(
|
||||
@@ -138,7 +138,7 @@ export const SessionExpired = () => {
|
||||
padding: 12,
|
||||
justifyContent: "center",
|
||||
flex: 1,
|
||||
backgroundColor: colors.bg
|
||||
backgroundColor: colors.primary.background
|
||||
}}
|
||||
>
|
||||
<View
|
||||
@@ -157,10 +157,10 @@ export const SessionExpired = () => {
|
||||
height: 60
|
||||
}}
|
||||
name="alert"
|
||||
color={colors.errorText}
|
||||
color={colors.error.icon}
|
||||
size={50}
|
||||
/>
|
||||
<Heading size={SIZE.xxxl} color={colors.heading}>
|
||||
<Heading size={SIZE.xxxl} color={colors.primary.heading}>
|
||||
Session expired
|
||||
</Heading>
|
||||
<Paragraph
|
||||
|
||||
@@ -24,7 +24,7 @@ import { DDS } from "../../services/device-detection";
|
||||
import { ToastEvent } from "../../services/event-manager";
|
||||
import { clearMessage, setEmailVerifyMessage } from "../../services/message";
|
||||
import PremiumService from "../../services/premium";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { useUserStore } from "../../stores/use-user-store";
|
||||
import { openLinkInBrowser } from "../../utils/functions";
|
||||
import { SIZE } from "../../utils/size";
|
||||
@@ -37,7 +37,7 @@ import { hideAuth } from "./common";
|
||||
import { useSettingStore } from "../../stores/use-setting-store";
|
||||
|
||||
export const Signup = ({ changeMode, trial }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const email = useRef();
|
||||
const emailInputRef = useRef();
|
||||
const passwordInputRef = useRef();
|
||||
@@ -98,7 +98,7 @@ export const Signup = ({ changeMode, trial }) => {
|
||||
<View
|
||||
style={{
|
||||
borderRadius: DDS.isTab ? 5 : 0,
|
||||
backgroundColor: colors.bg,
|
||||
backgroundColor: colors.primary.background,
|
||||
zIndex: 10,
|
||||
width: "100%",
|
||||
alignSelf: "center"
|
||||
@@ -108,13 +108,13 @@ export const Signup = ({ changeMode, trial }) => {
|
||||
style={{
|
||||
justifyContent: "flex-end",
|
||||
paddingHorizontal: 20,
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
marginBottom: 20,
|
||||
borderBottomWidth: 1,
|
||||
borderBottomColor: colors.border,
|
||||
borderBottomColor: colors.primary.border,
|
||||
alignSelf: deviceMode !== "mobile" ? "center" : undefined,
|
||||
borderWidth: deviceMode !== "mobile" ? 1 : null,
|
||||
borderColor: deviceMode !== "mobile" ? colors.border : null,
|
||||
borderColor: deviceMode !== "mobile" ? colors.primary.border : null,
|
||||
borderRadius: deviceMode !== "mobile" ? 20 : null,
|
||||
marginTop: deviceMode !== "mobile" ? 50 : null,
|
||||
width: deviceMode === "mobile" ? null : "50%",
|
||||
@@ -130,7 +130,7 @@ export const Signup = ({ changeMode, trial }) => {
|
||||
style={{
|
||||
width: 100,
|
||||
height: 5,
|
||||
backgroundColor: colors.accent,
|
||||
backgroundColor: colors.primary.accent,
|
||||
borderRadius: 2,
|
||||
marginRight: 7
|
||||
}}
|
||||
@@ -140,7 +140,7 @@ export const Signup = ({ changeMode, trial }) => {
|
||||
style={{
|
||||
width: 20,
|
||||
height: 5,
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
borderRadius: 2
|
||||
}}
|
||||
/>
|
||||
@@ -161,7 +161,7 @@ export const Signup = ({ changeMode, trial }) => {
|
||||
style={{
|
||||
width: DDS.isTab ? "50%" : "100%",
|
||||
paddingHorizontal: 20,
|
||||
backgroundColor: colors.bg,
|
||||
backgroundColor: colors.primary.background,
|
||||
alignSelf: "center"
|
||||
}}
|
||||
>
|
||||
@@ -230,7 +230,7 @@ export const Signup = ({ changeMode, trial }) => {
|
||||
marginBottom: 25
|
||||
}}
|
||||
size={SIZE.xs}
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
>
|
||||
By signing up, you agree to our{" "}
|
||||
<Paragraph
|
||||
@@ -241,7 +241,7 @@ export const Signup = ({ changeMode, trial }) => {
|
||||
style={{
|
||||
textDecorationLine: "underline"
|
||||
}}
|
||||
color={colors.accent}
|
||||
color={colors.primary.accent}
|
||||
>
|
||||
Terms of Service{" "}
|
||||
</Paragraph>
|
||||
@@ -254,7 +254,7 @@ export const Signup = ({ changeMode, trial }) => {
|
||||
style={{
|
||||
textDecorationLine: "underline"
|
||||
}}
|
||||
color={colors.accent}
|
||||
color={colors.primary.accent}
|
||||
>
|
||||
Privacy Policy.
|
||||
</Paragraph>{" "}
|
||||
@@ -287,9 +287,12 @@ export const Signup = ({ changeMode, trial }) => {
|
||||
paddingVertical: 12
|
||||
}}
|
||||
>
|
||||
<Paragraph size={SIZE.xs + 1} color={colors.icon}>
|
||||
<Paragraph size={SIZE.xs + 1} color={colors.secondary.paragraph}>
|
||||
Already have an account?{" "}
|
||||
<Paragraph size={SIZE.xs + 1} style={{ color: colors.accent }}>
|
||||
<Paragraph
|
||||
size={SIZE.xs + 1}
|
||||
style={{ color: colors.primary.accent }}
|
||||
>
|
||||
Login
|
||||
</Paragraph>
|
||||
</Paragraph>
|
||||
|
||||
@@ -26,7 +26,7 @@ import {
|
||||
presentSheet,
|
||||
ToastEvent
|
||||
} from "../../services/event-manager";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { eCloseSheet } from "../../utils/events";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import { Button } from "../ui/button";
|
||||
@@ -39,7 +39,7 @@ import Paragraph from "../ui/typography/paragraph";
|
||||
import { useCallback } from "react";
|
||||
|
||||
const TwoFactorVerification = ({ onMfaLogin, mfaInfo }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const code = useRef();
|
||||
const [currentMethod, setCurrentMethod] = useState({
|
||||
method: mfaInfo?.primaryMethod,
|
||||
@@ -157,7 +157,7 @@ const TwoFactorVerification = ({ onMfaLogin, mfaInfo }) => {
|
||||
}}
|
||||
size={50}
|
||||
name="key"
|
||||
color={colors.accent}
|
||||
color={colors.primary.accent}
|
||||
/>
|
||||
<Heading
|
||||
style={{
|
||||
@@ -281,7 +281,7 @@ const TwoFactorVerification = ({ onMfaLogin, mfaInfo }) => {
|
||||
marginRight: 10
|
||||
}}
|
||||
size={15}
|
||||
color={colors.accent}
|
||||
color={colors.primary.accent}
|
||||
name={item.icon}
|
||||
/>
|
||||
<View
|
||||
|
||||
@@ -20,16 +20,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
import React from "react";
|
||||
import { View } from "react-native";
|
||||
import { useSelectionStore } from "../../stores/use-selection-store";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
|
||||
export const ContainerHeader = ({ children }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const selectionMode = useSelectionStore((state) => state.selectionMode);
|
||||
|
||||
return !selectionMode ? (
|
||||
<View
|
||||
style={{
|
||||
backgroundColor: colors.bg,
|
||||
backgroundColor: colors.primary.background,
|
||||
width: "100%",
|
||||
overflow: "hidden"
|
||||
}}
|
||||
|
||||
@@ -34,13 +34,15 @@ import { getElevationStyle } from "../../utils/elevation";
|
||||
import { SIZE, normalize } from "../../utils/size";
|
||||
import NativeTooltip from "../../utils/tooltip";
|
||||
import { PressableButton } from "../ui/pressable";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
|
||||
export const FloatingButton = ({
|
||||
title,
|
||||
onPress,
|
||||
color = "accent",
|
||||
color,
|
||||
shouldShow = false
|
||||
}) => {
|
||||
const { colors } = useThemeColors();
|
||||
const deviceMode = useSettingStore((state) => state.deviceMode);
|
||||
const selectionMode = useSelectionStore((state) => state.selectionMode);
|
||||
const translate = useSharedValue(0);
|
||||
@@ -113,8 +115,10 @@ export const FloatingButton = ({
|
||||
<PressableButton
|
||||
testID={notesnook.buttons.add}
|
||||
type="accent"
|
||||
accentColor={color || "accent"}
|
||||
accentText="light"
|
||||
buttonType={{
|
||||
color: colors.static[color],
|
||||
text: colors.static.white
|
||||
}}
|
||||
customStyle={{
|
||||
...getElevationStyle(5),
|
||||
borderRadius: 100
|
||||
|
||||
@@ -20,21 +20,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
import React from "react";
|
||||
import { View } from "react-native";
|
||||
import { useMessageStore } from "../../stores/use-message-store";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { COLORS_NOTE } from "../../utils/color-scheme";
|
||||
import { hexToRGBA } from "../../utils/color-scheme/utils";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { ColorValues } from "../../utils/colors";
|
||||
import { hexToRGBA } from "../../utils/colors";
|
||||
|
||||
export const DefaultPlaceholder = ({ color }: { color: string }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const message = useMessageStore((state) => state.message);
|
||||
const annoucements = useMessageStore((state) => state.announcements);
|
||||
const hasAnnoucements = annoucements.length > 0;
|
||||
const shadeColor = color
|
||||
? hexToRGBA(
|
||||
COLORS_NOTE[color?.toLowerCase() as keyof typeof COLORS_NOTE],
|
||||
ColorValues[color?.toLowerCase() as keyof typeof ColorValues],
|
||||
0.15
|
||||
)
|
||||
: colors.shade;
|
||||
: colors.primary.shade;
|
||||
|
||||
return (
|
||||
<View
|
||||
@@ -50,7 +50,7 @@ export const DefaultPlaceholder = ({ color }: { color: string }) => {
|
||||
height: 100,
|
||||
borderRadius: 10,
|
||||
marginBottom: 20,
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
padding: 12
|
||||
}}
|
||||
>
|
||||
@@ -58,7 +58,7 @@ export const DefaultPlaceholder = ({ color }: { color: string }) => {
|
||||
style={{
|
||||
width: 150,
|
||||
height: 20,
|
||||
backgroundColor: colors.transGray,
|
||||
backgroundColor: colors.primary.hover,
|
||||
borderRadius: 5,
|
||||
marginBottom: 10
|
||||
}}
|
||||
@@ -67,7 +67,7 @@ export const DefaultPlaceholder = ({ color }: { color: string }) => {
|
||||
style={{
|
||||
width: 250,
|
||||
height: 14,
|
||||
backgroundColor: colors.transGray,
|
||||
backgroundColor: colors.primary.hover,
|
||||
borderRadius: 5
|
||||
}}
|
||||
/>
|
||||
@@ -110,7 +110,7 @@ export const DefaultPlaceholder = ({ color }: { color: string }) => {
|
||||
style={{
|
||||
width: 150,
|
||||
height: 12,
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
borderRadius: 5,
|
||||
marginBottom: 10
|
||||
}}
|
||||
@@ -119,7 +119,7 @@ export const DefaultPlaceholder = ({ color }: { color: string }) => {
|
||||
style={{
|
||||
width: 250,
|
||||
height: 16,
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
borderRadius: 5
|
||||
}}
|
||||
/>
|
||||
@@ -131,7 +131,7 @@ export const DefaultPlaceholder = ({ color }: { color: string }) => {
|
||||
style={{
|
||||
width: "100%",
|
||||
height: 30,
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
borderRadius: 10,
|
||||
marginBottom: 20,
|
||||
padding: 5,
|
||||
@@ -158,7 +158,7 @@ export const DefaultPlaceholder = ({ color }: { color: string }) => {
|
||||
style={{
|
||||
width: 15,
|
||||
height: 15,
|
||||
backgroundColor: colors.transGray,
|
||||
backgroundColor: colors.primary.hover,
|
||||
borderRadius: 100,
|
||||
marginRight: 10
|
||||
}}
|
||||
@@ -167,7 +167,7 @@ export const DefaultPlaceholder = ({ color }: { color: string }) => {
|
||||
style={{
|
||||
width: 60,
|
||||
height: 15,
|
||||
backgroundColor: colors.transGray,
|
||||
backgroundColor: colors.primary.hover,
|
||||
borderRadius: 3
|
||||
}}
|
||||
/>
|
||||
@@ -178,7 +178,7 @@ export const DefaultPlaceholder = ({ color }: { color: string }) => {
|
||||
style={{
|
||||
width: 200,
|
||||
height: 16,
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
borderRadius: 5
|
||||
}}
|
||||
/>
|
||||
@@ -186,7 +186,7 @@ export const DefaultPlaceholder = ({ color }: { color: string }) => {
|
||||
style={{
|
||||
width: "85%",
|
||||
height: 13,
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
borderRadius: 5,
|
||||
marginTop: 10
|
||||
}}
|
||||
@@ -202,7 +202,7 @@ export const DefaultPlaceholder = ({ color }: { color: string }) => {
|
||||
style={{
|
||||
width: 50,
|
||||
height: 10,
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
borderRadius: 5
|
||||
}}
|
||||
/>
|
||||
@@ -210,7 +210,7 @@ export const DefaultPlaceholder = ({ color }: { color: string }) => {
|
||||
style={{
|
||||
width: 60,
|
||||
height: 10,
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
borderRadius: 5,
|
||||
marginLeft: 10
|
||||
}}
|
||||
|
||||
@@ -21,7 +21,7 @@ import React from "react";
|
||||
import { ViewProps } from "react-native";
|
||||
import Animated, { FadeOutUp } from "react-native-reanimated";
|
||||
import { useDelayLayout } from "../../hooks/use-delay-layout";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { DefaultPlaceholder } from "./default-placeholder";
|
||||
import { SettingsPlaceholder } from "./settings-placeholder";
|
||||
|
||||
@@ -42,7 +42,7 @@ export default function DelayLayout({
|
||||
animated = true,
|
||||
...props
|
||||
}: IDelayLayoutProps) {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const loading = useDelayLayout(
|
||||
!props.delay || props.delay < 300 ? 300 : props.delay
|
||||
);
|
||||
@@ -52,12 +52,12 @@ export default function DelayLayout({
|
||||
<Animated.View
|
||||
exiting={animated ? FadeOutUp : undefined}
|
||||
style={{
|
||||
backgroundColor: colors.bg,
|
||||
backgroundColor: colors.primary.background,
|
||||
flex: 1,
|
||||
paddingTop: 20
|
||||
}}
|
||||
>
|
||||
<Placeholder color={props.color || colors.accent} />
|
||||
<Placeholder color={props.color || colors.primary.accent} />
|
||||
</Animated.View>
|
||||
) : (
|
||||
<>{props.children}</>
|
||||
|
||||
@@ -19,10 +19,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import React from "react";
|
||||
import { View } from "react-native";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
|
||||
export const SettingsPlaceholder = () => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
|
||||
return (
|
||||
<View>
|
||||
@@ -30,7 +30,7 @@ export const SettingsPlaceholder = () => {
|
||||
style={{
|
||||
width: 100,
|
||||
height: 12,
|
||||
backgroundColor: colors.shade,
|
||||
backgroundColor: colors.primary.shade,
|
||||
borderRadius: 5,
|
||||
marginLeft: 12,
|
||||
marginBottom: 12
|
||||
@@ -51,7 +51,7 @@ export const SettingsPlaceholder = () => {
|
||||
style={{
|
||||
width: 40,
|
||||
height: 40,
|
||||
backgroundColor: colors.transGray,
|
||||
backgroundColor: colors.primary.hover,
|
||||
borderRadius: 100,
|
||||
marginRight: 20
|
||||
}}
|
||||
@@ -61,7 +61,7 @@ export const SettingsPlaceholder = () => {
|
||||
style={{
|
||||
width: 150,
|
||||
height: 12,
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
borderRadius: 5,
|
||||
marginBottom: 10
|
||||
}}
|
||||
@@ -70,7 +70,7 @@ export const SettingsPlaceholder = () => {
|
||||
style={{
|
||||
width: 250,
|
||||
height: 16,
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
borderRadius: 5
|
||||
}}
|
||||
/>
|
||||
@@ -93,7 +93,7 @@ export const SettingsPlaceholder = () => {
|
||||
style={{
|
||||
width: 40,
|
||||
height: 40,
|
||||
backgroundColor: colors.shade,
|
||||
backgroundColor: colors.primary.shade,
|
||||
borderRadius: 100,
|
||||
marginRight: 20
|
||||
}}
|
||||
@@ -103,7 +103,7 @@ export const SettingsPlaceholder = () => {
|
||||
style={{
|
||||
width: 150,
|
||||
height: 12,
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
borderRadius: 5,
|
||||
marginBottom: 10
|
||||
}}
|
||||
@@ -112,7 +112,7 @@ export const SettingsPlaceholder = () => {
|
||||
style={{
|
||||
width: 250,
|
||||
height: 16,
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
borderRadius: 5
|
||||
}}
|
||||
/>
|
||||
@@ -122,7 +122,7 @@ export const SettingsPlaceholder = () => {
|
||||
style={{
|
||||
width: 40,
|
||||
height: 20,
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
borderRadius: 100,
|
||||
marginLeft: 15,
|
||||
alignItems: "flex-end",
|
||||
@@ -134,7 +134,7 @@ export const SettingsPlaceholder = () => {
|
||||
style={{
|
||||
width: 15,
|
||||
height: 15,
|
||||
backgroundColor: colors.shade,
|
||||
backgroundColor: colors.primary.shade,
|
||||
borderRadius: 100,
|
||||
marginLeft: 15
|
||||
}}
|
||||
|
||||
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import React from "react";
|
||||
import { useNoteStore } from "../../stores/use-notes-store";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { AnnouncementDialog } from "../announcements";
|
||||
import AuthModal from "../auth/auth-modal";
|
||||
import { SessionExpired } from "../auth/session-expired";
|
||||
@@ -39,7 +39,7 @@ import RestoreDataSheet from "../sheets/restore-data";
|
||||
import PDFPreview from "../dialogs/pdf-preview";
|
||||
|
||||
const DialogProvider = () => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const loading = useNoteStore((state) => state.loading);
|
||||
|
||||
return (
|
||||
|
||||
@@ -30,6 +30,7 @@ import {
|
||||
import useIsFloatingKeyboard from "../../hooks/use-is-floating-keyboard";
|
||||
import { useSettingStore } from "../../stores/use-setting-store";
|
||||
import { BouncingView } from "../ui/transitions/bouncing-view";
|
||||
import { ScopedThemeProvider } from "@notesnook/theme";
|
||||
|
||||
const BaseDialog = ({
|
||||
visible,
|
||||
@@ -60,69 +61,71 @@ const BaseDialog = ({
|
||||
const Wrapper = useSafeArea ? SafeAreaView : View;
|
||||
|
||||
return (
|
||||
<Modal
|
||||
visible={visible}
|
||||
transparent={true}
|
||||
animated
|
||||
statusBarTranslucent={statusBarTranslucent}
|
||||
supportedOrientations={[
|
||||
"portrait",
|
||||
"portrait-upside-down",
|
||||
"landscape",
|
||||
"landscape-left",
|
||||
"landscape-right"
|
||||
]}
|
||||
onShow={() => {
|
||||
if (onShow) {
|
||||
onShow();
|
||||
useSettingStore.getState().setSheetKeyboardHandler(false);
|
||||
}
|
||||
}}
|
||||
animationType={animation}
|
||||
onRequestClose={() => {
|
||||
if (!closeOnTouch) return null;
|
||||
useSettingStore.getState().setSheetKeyboardHandler(true);
|
||||
onRequestClose && onRequestClose();
|
||||
}}
|
||||
>
|
||||
<Wrapper
|
||||
style={{
|
||||
backgroundColor: background
|
||||
? background
|
||||
: transparent
|
||||
? "transparent"
|
||||
: "rgba(0,0,0,0.3)"
|
||||
<ScopedThemeProvider value="dialog">
|
||||
<Modal
|
||||
visible={visible}
|
||||
transparent={true}
|
||||
animated
|
||||
statusBarTranslucent={statusBarTranslucent}
|
||||
supportedOrientations={[
|
||||
"portrait",
|
||||
"portrait-upside-down",
|
||||
"landscape",
|
||||
"landscape-left",
|
||||
"landscape-right"
|
||||
]}
|
||||
onShow={() => {
|
||||
if (onShow) {
|
||||
onShow();
|
||||
useSettingStore.getState().setSheetKeyboardHandler(false);
|
||||
}
|
||||
}}
|
||||
animationType={animation}
|
||||
onRequestClose={() => {
|
||||
if (!closeOnTouch) return null;
|
||||
useSettingStore.getState().setSheetKeyboardHandler(true);
|
||||
onRequestClose && onRequestClose();
|
||||
}}
|
||||
>
|
||||
<KeyboardAvoidingView
|
||||
enabled={!floating && Platform.OS === "ios" && !avoidKeyboardResize}
|
||||
behavior="padding"
|
||||
<Wrapper
|
||||
style={{
|
||||
backgroundColor: background
|
||||
? background
|
||||
: transparent
|
||||
? "transparent"
|
||||
: "rgba(0,0,0,0.3)"
|
||||
}}
|
||||
>
|
||||
<BouncingView
|
||||
duration={400}
|
||||
animated={animated}
|
||||
initialScale={bounce ? 0.9 : 1}
|
||||
style={[
|
||||
styles.backdrop,
|
||||
{
|
||||
justifyContent: centered
|
||||
? "center"
|
||||
: bottom
|
||||
? "flex-end"
|
||||
: "flex-start"
|
||||
}
|
||||
]}
|
||||
<KeyboardAvoidingView
|
||||
enabled={!floating && Platform.OS === "ios" && !avoidKeyboardResize}
|
||||
behavior="padding"
|
||||
>
|
||||
<TouchableOpacity
|
||||
onPress={closeOnTouch ? onRequestClose : null}
|
||||
style={styles.overlayButton}
|
||||
/>
|
||||
{premium}
|
||||
{children}
|
||||
</BouncingView>
|
||||
</KeyboardAvoidingView>
|
||||
</Wrapper>
|
||||
</Modal>
|
||||
<BouncingView
|
||||
duration={400}
|
||||
animated={animated}
|
||||
initialScale={bounce ? 0.9 : 1}
|
||||
style={[
|
||||
styles.backdrop,
|
||||
{
|
||||
justifyContent: centered
|
||||
? "center"
|
||||
: bottom
|
||||
? "flex-end"
|
||||
: "flex-start"
|
||||
}
|
||||
]}
|
||||
>
|
||||
<TouchableOpacity
|
||||
onPress={closeOnTouch ? onRequestClose : null}
|
||||
style={styles.overlayButton}
|
||||
/>
|
||||
{premium}
|
||||
{children}
|
||||
</BouncingView>
|
||||
</KeyboardAvoidingView>
|
||||
</Wrapper>
|
||||
</Modal>
|
||||
</ScopedThemeProvider>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import React from "react";
|
||||
import { ActivityIndicator, StyleSheet, View } from "react-native";
|
||||
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
|
||||
import { notesnook } from "../../../e2e/test.ids";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import { Button } from "../ui/button";
|
||||
import Paragraph from "../ui/typography/paragraph";
|
||||
@@ -35,14 +35,14 @@ const DialogButtons = ({
|
||||
doneText,
|
||||
positiveType
|
||||
}) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
|
||||
return (
|
||||
<View
|
||||
style={[
|
||||
styles.container,
|
||||
{
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
height: 60,
|
||||
borderBottomRightRadius: 10,
|
||||
borderBottomLeftRadius: 10,
|
||||
@@ -51,7 +51,7 @@ const DialogButtons = ({
|
||||
]}
|
||||
>
|
||||
{loading ? (
|
||||
<ActivityIndicator color={colors.accent} size={SIZE.lg} />
|
||||
<ActivityIndicator color={colors.primary.accent} size={SIZE.lg} />
|
||||
) : doneText ? (
|
||||
<View
|
||||
style={{
|
||||
@@ -60,11 +60,11 @@ const DialogButtons = ({
|
||||
}}
|
||||
>
|
||||
<Icon
|
||||
color={colors.accent}
|
||||
color={colors.primary.accent}
|
||||
name="check-circle-outline"
|
||||
size={SIZE.md}
|
||||
/>
|
||||
<Paragraph color={colors.accent}>{" " + doneText}</Paragraph>
|
||||
<Paragraph color={colors.primary.accent}>{" " + doneText}</Paragraph>
|
||||
</View>
|
||||
) : (
|
||||
<View />
|
||||
|
||||
@@ -20,11 +20,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
import React from "react";
|
||||
import { View } from "react-native";
|
||||
import { DDS } from "../../services/device-detection";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { getElevationStyle } from "../../utils/elevation";
|
||||
|
||||
const DialogContainer = ({ width, height, ...restProps }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
|
||||
return (
|
||||
<View
|
||||
@@ -34,7 +34,7 @@ const DialogContainer = ({ width, height, ...restProps }) => {
|
||||
width: width || DDS.isTab ? 500 : "85%",
|
||||
maxHeight: height || 450,
|
||||
borderRadius: 10,
|
||||
backgroundColor: colors.bg,
|
||||
backgroundColor: colors.primary.background,
|
||||
paddingTop: 12
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import React from "react";
|
||||
import { Text, View, ViewStyle } from "react-native";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import { Button } from "../ui/button";
|
||||
import { PressableButtonProps } from "../ui/pressable";
|
||||
@@ -54,7 +54,7 @@ const DialogHeader = ({
|
||||
titlePart,
|
||||
style
|
||||
}: DialogHeaderProps) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -86,7 +86,7 @@ const DialogHeader = ({
|
||||
>
|
||||
{title}{" "}
|
||||
{titlePart ? (
|
||||
<Text style={{ color: colors.accent }}>{titlePart}</Text>
|
||||
<Text style={{ color: colors.primary.accent }}>{titlePart}</Text>
|
||||
) : null}
|
||||
</Heading>
|
||||
|
||||
@@ -114,7 +114,7 @@ const DialogHeader = ({
|
||||
maxWidth: centered ? "90%" : "100%",
|
||||
alignSelf: centered ? "center" : "flex-start"
|
||||
}}
|
||||
color={paragraphColor || colors.icon}
|
||||
color={paragraphColor || colors.secondary.paragraph}
|
||||
>
|
||||
{paragraph}
|
||||
</Paragraph>
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
eSubscribeEvent,
|
||||
eUnSubscribeEvent
|
||||
} from "../../services/event-manager";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { getElevationStyle } from "../../utils/elevation";
|
||||
import { eCloseSimpleDialog, eOpenSimpleDialog } from "../../utils/events";
|
||||
import { sleep } from "../../utils/time";
|
||||
@@ -38,7 +38,7 @@ import { useCallback } from "react";
|
||||
import { Button } from "../ui/button";
|
||||
|
||||
export const Dialog = ({ context = "global" }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [inputValue, setInputValue] = useState(null);
|
||||
const inputRef = useRef();
|
||||
@@ -51,7 +51,7 @@ export const Dialog = ({ context = "global" }) => {
|
||||
onClose: () => {},
|
||||
positiveType: "transparent",
|
||||
icon: null,
|
||||
paragraphColor: colors.pri,
|
||||
paragraphColor: colors.primary.paragraph,
|
||||
input: false,
|
||||
inputPlaceholder: "Enter some text",
|
||||
defaultValue: "",
|
||||
@@ -115,7 +115,7 @@ export const Dialog = ({ context = "global" }) => {
|
||||
width: DDS.isTab ? 400 : "85%",
|
||||
maxHeight: 450,
|
||||
borderRadius: 5,
|
||||
backgroundColor: colors.bg,
|
||||
backgroundColor: colors.primary.background,
|
||||
paddingTop: 12
|
||||
};
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
eUnSubscribeEvent
|
||||
} from "../../../services/event-manager";
|
||||
import { useMessageStore } from "../../../stores/use-message-store";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { getElevationStyle } from "../../../utils/elevation";
|
||||
import {
|
||||
eCloseJumpToDialog,
|
||||
@@ -41,10 +41,10 @@ import { useCallback } from "react";
|
||||
const offsets = [];
|
||||
let timeout = null;
|
||||
const JumpToSectionDialog = ({ scrollRef, data, type }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const notes = data;
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [currentIndex, setCurrentIndex] = useState(null);
|
||||
const [currentIndex, setCurrentIndex] = useState(0);
|
||||
|
||||
const onPress = (item) => {
|
||||
let ind = notes.findIndex(
|
||||
@@ -77,7 +77,7 @@ const JumpToSectionDialog = ({ scrollRef, data, type }) => {
|
||||
}
|
||||
timeout = setTimeout(() => {
|
||||
let index = offsets.findIndex((o, i) => o <= y && offsets[i + 1] > y);
|
||||
setCurrentIndex(index);
|
||||
setCurrentIndex(index || 0);
|
||||
}, 200);
|
||||
};
|
||||
|
||||
@@ -113,7 +113,6 @@ const JumpToSectionDialog = ({ scrollRef, data, type }) => {
|
||||
offsets.push(offset);
|
||||
});
|
||||
}, [notes]);
|
||||
|
||||
return !visible ? null : (
|
||||
<BaseDialog
|
||||
onShow={() => {
|
||||
@@ -126,7 +125,7 @@ const JumpToSectionDialog = ({ scrollRef, data, type }) => {
|
||||
style={{
|
||||
...getElevationStyle(5),
|
||||
width: DDS.isTab ? 500 : "85%",
|
||||
backgroundColor: colors.bg,
|
||||
backgroundColor: colors.primary.background,
|
||||
zIndex: 100,
|
||||
bottom: 20,
|
||||
maxHeight: "65%",
|
||||
@@ -157,7 +156,7 @@ const JumpToSectionDialog = ({ scrollRef, data, type }) => {
|
||||
<PressableButton
|
||||
key={item.title}
|
||||
onPress={() => onPress(item, index)}
|
||||
type={currentIndex === index ? "accent" : "transparent"}
|
||||
type={currentIndex === index ? "selected" : "transparent"}
|
||||
customStyle={{
|
||||
minWidth: "20%",
|
||||
width: null,
|
||||
@@ -171,7 +170,9 @@ const JumpToSectionDialog = ({ scrollRef, data, type }) => {
|
||||
<Paragraph
|
||||
size={SIZE.sm}
|
||||
color={
|
||||
currentIndex === index ? colors.light : colors.accent
|
||||
currentIndex === index
|
||||
? colors.selected.accent
|
||||
: colors.primary.accent
|
||||
}
|
||||
style={{
|
||||
textAlign: "center"
|
||||
|
||||
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import React from "react";
|
||||
import { View } from "react-native";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import BaseDialog from "../../dialog/base-dialog";
|
||||
import { ProgressBarComponent } from "../../ui/svg/lazy";
|
||||
import { useEffect } from "react";
|
||||
@@ -30,7 +30,7 @@ import { useState } from "react";
|
||||
import { eCloseLoading, eOpenLoading } from "../../../utils/events";
|
||||
|
||||
export const LoadingDialog = () => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const [visible, setVisible] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -58,7 +58,7 @@ export const LoadingDialog = () => {
|
||||
style={{
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
backgroundColor: colors.bg,
|
||||
backgroundColor: colors.primary.background,
|
||||
justifyContent: "center",
|
||||
alignItems: "center"
|
||||
}}
|
||||
@@ -77,8 +77,8 @@ export const LoadingDialog = () => {
|
||||
useNativeDriver
|
||||
indeterminate
|
||||
indeterminateAnimationDuration={2000}
|
||||
unfilledColor={colors.nav}
|
||||
color={colors.accent}
|
||||
unfilledColor={colors.secondary.background}
|
||||
color={colors.primary.accent}
|
||||
borderWidth={0}
|
||||
/>
|
||||
</View>
|
||||
|
||||
@@ -33,7 +33,7 @@ import {
|
||||
eSubscribeEvent,
|
||||
eUnSubscribeEvent
|
||||
} from "../../../services/event-manager";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { SIZE } from "../../../utils/size";
|
||||
import { Dialog } from "../../dialog";
|
||||
import BaseDialog from "../../dialog/base-dialog";
|
||||
@@ -64,7 +64,7 @@ const usePDFSnapshot = (attachment) => {
|
||||
};
|
||||
|
||||
const PDFPreview = () => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [pdfSource, setPDFSource] = useState();
|
||||
const [loading, setLoading] = useState(false);
|
||||
@@ -172,7 +172,7 @@ const PDFPreview = () => {
|
||||
>
|
||||
<ProgressBarComponent
|
||||
indeterminate={!progress}
|
||||
color={colors.accent}
|
||||
color={colors.primary.accent}
|
||||
borderColor="transparent"
|
||||
progress={parseInt(progress?.value || "100") / 100}
|
||||
/>
|
||||
@@ -180,7 +180,7 @@ const PDFPreview = () => {
|
||||
style={{
|
||||
marginTop: 10
|
||||
}}
|
||||
color={colors.light}
|
||||
color={colors.static.white}
|
||||
>
|
||||
Loading {`${progress?.percent ? `(${progress?.percent})` : ""}`}
|
||||
... Please wait
|
||||
@@ -205,7 +205,7 @@ const PDFPreview = () => {
|
||||
}}
|
||||
>
|
||||
<IconButton
|
||||
color={colors.light}
|
||||
color={colors.static.white}
|
||||
name="arrow-left"
|
||||
onPress={close}
|
||||
customStyle={{
|
||||
@@ -226,7 +226,7 @@ const PDFPreview = () => {
|
||||
ref={inputRef}
|
||||
defaultValue={currentPage + ""}
|
||||
style={{
|
||||
color: colors.pri,
|
||||
color: colors.primary.paragraph,
|
||||
padding: 0,
|
||||
paddingTop: 0,
|
||||
paddingBottom: 0,
|
||||
@@ -234,7 +234,7 @@ const PDFPreview = () => {
|
||||
marginBottom: 0,
|
||||
paddingVertical: 0,
|
||||
height: 25,
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
width: 40,
|
||||
textAlign: "center",
|
||||
marginRight: 4,
|
||||
@@ -249,7 +249,7 @@ const PDFPreview = () => {
|
||||
}}
|
||||
blurOnSubmit
|
||||
/>
|
||||
<Paragraph color={colors.light}>/{numPages}</Paragraph>
|
||||
<Paragraph color={colors.static.white}>/{numPages}</Paragraph>
|
||||
</View>
|
||||
|
||||
<View
|
||||
@@ -258,7 +258,7 @@ const PDFPreview = () => {
|
||||
}}
|
||||
>
|
||||
<IconButton
|
||||
color={colors.light}
|
||||
color={colors.static.white}
|
||||
name="download"
|
||||
onPress={() => {
|
||||
downloadAttachment(attachment.metadata.hash, false);
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
eSubscribeEvent,
|
||||
eUnSubscribeEvent
|
||||
} from "../../../services/event-manager";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { getElevationStyle } from "../../../utils/elevation";
|
||||
import { eCloseResultDialog, eOpenResultDialog } from "../../../utils/events";
|
||||
import { SIZE } from "../../../utils/size";
|
||||
@@ -36,7 +36,7 @@ import Paragraph from "../../ui/typography/paragraph";
|
||||
import { ProFeatures } from "./pro-features";
|
||||
|
||||
const ResultDialog = () => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [dialogData, setDialogData] = useState({
|
||||
title: "Thank you for signing up!",
|
||||
@@ -72,7 +72,7 @@ const ResultDialog = () => {
|
||||
width: DDS.isTab ? 350 : "85%",
|
||||
maxHeight: 500,
|
||||
borderRadius: 10,
|
||||
backgroundColor: colors.bg,
|
||||
backgroundColor: colors.primary.background,
|
||||
paddingTop: 20,
|
||||
justifyContent: "center",
|
||||
alignItems: "center"
|
||||
@@ -94,7 +94,7 @@ const ResultDialog = () => {
|
||||
</Heading>
|
||||
|
||||
<Paragraph
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
size={SIZE.md}
|
||||
style={{
|
||||
alignSelf: "center",
|
||||
@@ -121,7 +121,7 @@ const ResultDialog = () => {
|
||||
<Seperator />
|
||||
<View
|
||||
style={{
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
width: "100%",
|
||||
borderBottomRightRadius: 10,
|
||||
borderBottomLeftRadius: 10,
|
||||
|
||||
@@ -21,7 +21,7 @@ import React from "react";
|
||||
import { View } from "react-native";
|
||||
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
|
||||
import { eSendEvent } from "../../../services/event-manager";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import {
|
||||
eCloseSheet,
|
||||
eCloseResultDialog,
|
||||
@@ -31,7 +31,7 @@ import { SIZE } from "../../../utils/size";
|
||||
import { sleep } from "../../../utils/time";
|
||||
import Paragraph from "../../ui/typography/paragraph";
|
||||
export const ProFeatures = ({ count = 6 }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -73,7 +73,7 @@ export const ProFeatures = ({ count = 6 }) => {
|
||||
justifyContent: "flex-start"
|
||||
}}
|
||||
>
|
||||
<Icon size={SIZE.lg} color={colors.accent} name="check" />
|
||||
<Icon size={SIZE.lg} color={colors.primary.accent} name="check" />
|
||||
<Paragraph style={{ marginLeft: 5, flexShrink: 1 }}>
|
||||
{item.content}
|
||||
</Paragraph>
|
||||
@@ -89,7 +89,7 @@ export const ProFeatures = ({ count = 6 }) => {
|
||||
size={SIZE.xs}
|
||||
style={{
|
||||
textDecorationLine: "underline",
|
||||
color: colors.icon
|
||||
color: colors.secondary.paragraph
|
||||
}}
|
||||
>
|
||||
See all features included in Notesnook Pro
|
||||
|
||||
@@ -682,7 +682,7 @@ export class VaultDialog extends Component {
|
||||
...getElevationStyle(5),
|
||||
width: DDS.isTab ? 350 : "85%",
|
||||
borderRadius: 10,
|
||||
backgroundColor: colors.bg,
|
||||
backgroundColor: colors.primary.background,
|
||||
paddingTop: 12
|
||||
}}
|
||||
>
|
||||
@@ -867,7 +867,12 @@ export class VaultDialog extends Component {
|
||||
icon="fingerprint"
|
||||
width="100%"
|
||||
title="Biometric unlocking"
|
||||
type={this.state.biometricUnlock ? "transparent" : "gray"}
|
||||
iconColor={
|
||||
this.state.biometricUnlock
|
||||
? colors.selected.icon
|
||||
: colors.primary.icon
|
||||
}
|
||||
type={this.state.biometricUnlock ? "transparent" : "selected"}
|
||||
/>
|
||||
) : null}
|
||||
</View>
|
||||
|
||||
@@ -27,14 +27,14 @@ import {
|
||||
} from "../../services/event-manager";
|
||||
import useNavigationStore from "../../stores/use-navigation-store";
|
||||
import { useSelectionStore } from "../../stores/use-selection-store";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { eScrollEvent } from "../../utils/events";
|
||||
import { LeftMenus } from "./left-menus";
|
||||
import { RightMenus } from "./right-menus";
|
||||
import { Title } from "./title";
|
||||
|
||||
const _Header = () => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const insets = useGlobalSafeAreaInsets();
|
||||
const [hide, setHide] = useState(true);
|
||||
const selectionMode = useSelectionStore((state) => state.selectionMode);
|
||||
@@ -69,10 +69,12 @@ const _Header = () => {
|
||||
styles.container,
|
||||
{
|
||||
marginTop: Platform.OS === "android" ? insets.top : null,
|
||||
backgroundColor: colors.bg,
|
||||
backgroundColor: colors.primary.background,
|
||||
overflow: "hidden",
|
||||
borderBottomWidth: 1,
|
||||
borderBottomColor: hide ? "transparent" : colors.nav,
|
||||
borderBottomColor: hide
|
||||
? "transparent"
|
||||
: colors.secondary.background,
|
||||
justifyContent: "space-between"
|
||||
}
|
||||
]}
|
||||
|
||||
@@ -23,12 +23,12 @@ import { DDS } from "../../services/device-detection";
|
||||
import Navigation from "../../services/navigation";
|
||||
import useNavigationStore from "../../stores/use-navigation-store";
|
||||
import { useSettingStore } from "../../stores/use-setting-store";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { tabBarRef } from "../../utils/global-refs";
|
||||
import { IconButton } from "../ui/icon-button";
|
||||
|
||||
export const LeftMenus = () => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const deviceMode = useSettingStore((state) => state.deviceMode);
|
||||
const canGoBack = useNavigationStore((state) => state.canGoBack);
|
||||
const isTablet = deviceMode === "tablet";
|
||||
@@ -61,17 +61,17 @@ export const LeftMenus = () => {
|
||||
width: 40,
|
||||
borderRadius: 100,
|
||||
marginLeft: -5,
|
||||
marginRight: DDS.isLargeTablet() ? 10 : 25
|
||||
marginRight: DDS.isLargeTablet() ? 10 : 7
|
||||
}}
|
||||
left={40}
|
||||
top={40}
|
||||
right={DDS.isLargeTablet() ? 10 : 25}
|
||||
right={DDS.isLargeTablet() ? 10 : 10}
|
||||
onPress={onLeftButtonPress}
|
||||
onLongPress={() => {
|
||||
Navigation.popToTop();
|
||||
}}
|
||||
name={canGoBack ? "arrow-left" : "menu"}
|
||||
color={colors.pri}
|
||||
color={colors.primary.paragraph}
|
||||
iconStyle={{
|
||||
marginLeft: canGoBack ? -5 : 0
|
||||
}}
|
||||
|
||||
@@ -25,14 +25,15 @@ import Navigation from "../../services/navigation";
|
||||
import SearchService from "../../services/search";
|
||||
import useNavigationStore from "../../stores/use-navigation-store";
|
||||
import { useSettingStore } from "../../stores/use-setting-store";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import { sleep } from "../../utils/time";
|
||||
import { Button } from "../ui/button";
|
||||
import { IconButton } from "../ui/icon-button";
|
||||
|
||||
export const RightMenus = () => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const { contextMenuColors } = useThemeColors("contextMenu");
|
||||
const deviceMode = useSettingStore((state) => state.deviceMode);
|
||||
const rightButtons = useNavigationStore((state) => state.headerRightButtons);
|
||||
const currentScreen = useNavigationStore((state) => state.currentScreen.name);
|
||||
@@ -51,7 +52,7 @@ export const RightMenus = () => {
|
||||
}}
|
||||
testID="icon-search"
|
||||
name="magnify"
|
||||
color={colors.pri}
|
||||
color={colors.primary.paragraph}
|
||||
customStyle={styles.rightBtn}
|
||||
/>
|
||||
) : null}
|
||||
@@ -76,7 +77,7 @@ export const RightMenus = () => {
|
||||
borderRadius: 5,
|
||||
paddingHorizontal: 0,
|
||||
borderWidth: 1,
|
||||
borderColor: colors.accent
|
||||
borderColor: colors.primary.accent
|
||||
}}
|
||||
/>
|
||||
) : null}
|
||||
@@ -87,7 +88,7 @@ export const RightMenus = () => {
|
||||
animationDuration={200}
|
||||
style={{
|
||||
borderRadius: 5,
|
||||
backgroundColor: colors.bg
|
||||
backgroundColor: contextMenuColors.primary.background
|
||||
}}
|
||||
onRequestClose={() => {
|
||||
menuRef.current?.hide();
|
||||
@@ -98,7 +99,7 @@ export const RightMenus = () => {
|
||||
menuRef.current?.show();
|
||||
}}
|
||||
name="dots-vertical"
|
||||
color={colors.pri}
|
||||
color={colors.primary.paragraph}
|
||||
customStyle={styles.rightBtn}
|
||||
/>
|
||||
}
|
||||
@@ -112,7 +113,7 @@ export const RightMenus = () => {
|
||||
}}
|
||||
type="gray"
|
||||
buttonType={{
|
||||
text: colors.pri
|
||||
text: colors.primary.paragraph
|
||||
}}
|
||||
key={item.title}
|
||||
title={item.title}
|
||||
|
||||
@@ -26,7 +26,7 @@ import {
|
||||
eUnSubscribeEvent
|
||||
} from "../../services/event-manager";
|
||||
import useNavigationStore from "../../stores/use-navigation-store";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { eScrollEvent } from "../../utils/events";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import Heading from "../ui/typography/heading";
|
||||
@@ -36,7 +36,7 @@ import Tag from "../ui/tag";
|
||||
const titleState = {};
|
||||
|
||||
export const Title = () => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const currentScreen = useNavigationStore((state) => state.currentScreen);
|
||||
const isNotebook = currentScreen.name === "Notebook";
|
||||
const isTopic = currentScreen?.name === "TopicNotes";
|
||||
@@ -110,15 +110,15 @@ export const Title = () => {
|
||||
<Heading
|
||||
onPress={navigateToNotebook}
|
||||
numberOfLines={1}
|
||||
size={SIZE.xl}
|
||||
size={SIZE.lg}
|
||||
style={{
|
||||
flexWrap: "wrap",
|
||||
marginTop: Platform.OS === "ios" ? -1 : 0
|
||||
}}
|
||||
color={currentScreen.color || colors.heading}
|
||||
color={currentScreen.color || colors.primary.heading}
|
||||
>
|
||||
{isTag ? (
|
||||
<Heading size={SIZE.xl} color={colors.accent}>
|
||||
<Heading size={SIZE.xl} color={colors.primary.accent}>
|
||||
#
|
||||
</Heading>
|
||||
) : null}
|
||||
|
||||
@@ -17,6 +17,9 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import Sodium from "@ammarahmed/react-native-sodium";
|
||||
import dataurl from "@notesnook/core/utils/dataurl";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { Platform, View } from "react-native";
|
||||
import ImageViewer from "react-native-image-zoom-viewer";
|
||||
@@ -26,15 +29,13 @@ import {
|
||||
eSubscribeEvent,
|
||||
eUnSubscribeEvent
|
||||
} from "../../services/event-manager";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import BaseDialog from "../dialog/base-dialog";
|
||||
import { IconButton } from "../ui/icon-button";
|
||||
import { ProgressBarComponent } from "../ui/svg/lazy";
|
||||
import Sodium from "@ammarahmed/react-native-sodium";
|
||||
import dataurl from "@notesnook/core/utils/dataurl";
|
||||
|
||||
const ImagePreview = () => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors("dialog");
|
||||
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [image, setImage] = useState("");
|
||||
const [loading, setLoading] = useState(false);
|
||||
@@ -97,7 +98,7 @@ const ImagePreview = () => {
|
||||
>
|
||||
<ProgressBarComponent
|
||||
indeterminate
|
||||
color={colors.accent}
|
||||
color={colors.primary.accent}
|
||||
borderColor="transparent"
|
||||
/>
|
||||
</View>
|
||||
|
||||
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import React from "react";
|
||||
import {
|
||||
Linking,
|
||||
@@ -27,18 +28,17 @@ import {
|
||||
} from "react-native";
|
||||
import { SwiperFlatList } from "react-native-swiper-flatlist";
|
||||
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
|
||||
import { getElevationStyle } from "../../utils/elevation";
|
||||
import useGlobalSafeAreaInsets from "../../hooks/use-global-safe-area-insets";
|
||||
import SettingsService from "../../services/settings";
|
||||
import { useSettingStore } from "../../stores/use-setting-store";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { getElevationStyle } from "../../utils/elevation";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import { Button } from "../ui/button";
|
||||
import Heading from "../ui/typography/heading";
|
||||
import Paragraph from "../ui/typography/paragraph";
|
||||
import useGlobalSafeAreaInsets from "../../hooks/use-global-safe-area-insets";
|
||||
|
||||
const Intro = ({ navigation }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const isTelemetryEnabled = useSettingStore(
|
||||
(state) => state.settings.telemetry
|
||||
);
|
||||
@@ -64,7 +64,7 @@ const Intro = ({ navigation }) => {
|
||||
style={{
|
||||
width: 100,
|
||||
height: 5,
|
||||
backgroundColor: colors.accent,
|
||||
backgroundColor: colors.primary.accent,
|
||||
borderRadius: 2,
|
||||
marginRight: 7
|
||||
}}
|
||||
@@ -74,7 +74,7 @@ const Intro = ({ navigation }) => {
|
||||
style={{
|
||||
width: 20,
|
||||
height: 5,
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
borderRadius: 2
|
||||
}}
|
||||
/>
|
||||
@@ -117,7 +117,7 @@ const Intro = ({ navigation }) => {
|
||||
</View>
|
||||
</View>
|
||||
),
|
||||
[colors.accent, colors.nav, deviceMode, width]
|
||||
[colors.primary.accent, colors.secondary.background, deviceMode, width]
|
||||
);
|
||||
|
||||
return (
|
||||
@@ -130,13 +130,13 @@ const Intro = ({ navigation }) => {
|
||||
<View
|
||||
style={{
|
||||
width: deviceMode !== "mobile" ? width / 2 : "100%",
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
marginBottom: 20,
|
||||
borderBottomWidth: 1,
|
||||
borderBottomColor: colors.border,
|
||||
borderBottomColor: colors.primary.border,
|
||||
alignSelf: deviceMode !== "mobile" ? "center" : undefined,
|
||||
borderWidth: deviceMode !== "mobile" ? 1 : null,
|
||||
borderColor: deviceMode !== "mobile" ? colors.border : null,
|
||||
borderColor: deviceMode !== "mobile" ? colors.primary.border : null,
|
||||
borderRadius: deviceMode !== "mobile" ? 20 : null,
|
||||
marginTop: deviceMode !== "mobile" ? 50 : null,
|
||||
paddingTop: insets.top + 10,
|
||||
@@ -171,14 +171,14 @@ const Intro = ({ navigation }) => {
|
||||
user: "@andrewsayer on Twitter"
|
||||
}
|
||||
]}
|
||||
paginationActiveColor={colors.accent}
|
||||
paginationActiveColor={colors.primary.accent}
|
||||
paginationStyleItem={{
|
||||
width: 10,
|
||||
height: 5,
|
||||
marginRight: 4,
|
||||
marginLeft: 4
|
||||
}}
|
||||
paginationDefaultColor={colors.border}
|
||||
paginationDefaultColor={colors.primary.border}
|
||||
renderItem={renderItem}
|
||||
/>
|
||||
</View>
|
||||
@@ -229,7 +229,9 @@ const Intro = ({ navigation }) => {
|
||||
name={
|
||||
isTelemetryEnabled ? "checkbox-marked" : "checkbox-blank-outline"
|
||||
}
|
||||
color={isTelemetryEnabled ? colors.accent : colors.icon}
|
||||
color={
|
||||
isTelemetryEnabled ? colors.primary.accent : colors.primary.icon
|
||||
}
|
||||
/>
|
||||
|
||||
<Paragraph
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -19,9 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import React from "react";
|
||||
import { View } from "react-native";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { useMessageStore } from "../../../stores/use-message-store";
|
||||
import { COLORS_NOTE } from "../../../utils/color-scheme";
|
||||
import { ColorValues } from "../../../utils/colors";
|
||||
import { Announcement } from "../../announcements/announcement";
|
||||
import { Card } from "../../list/card";
|
||||
import Paragraph from "../../ui/typography/paragraph";
|
||||
@@ -37,7 +37,7 @@ export const Header = React.memo(
|
||||
noAnnouncement,
|
||||
warning
|
||||
}) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const announcements = useMessageStore((state) => state.announcements);
|
||||
const selectionMode = useSelectionStore((state) => state.selectionMode);
|
||||
|
||||
@@ -47,7 +47,7 @@ export const Header = React.memo(
|
||||
<View
|
||||
style={{
|
||||
padding: 12,
|
||||
backgroundColor: colors.errorBg,
|
||||
backgroundColor: colors.error.background,
|
||||
width: "95%",
|
||||
alignSelf: "center",
|
||||
borderRadius: 5,
|
||||
@@ -55,13 +55,18 @@ export const Header = React.memo(
|
||||
alignItems: "center"
|
||||
}}
|
||||
>
|
||||
<Icon name="sync-alert" size={SIZE.md} color={colors.red} f />
|
||||
<Paragraph style={{ marginLeft: 5 }} color={colors.red}>
|
||||
<Icon
|
||||
name="sync-alert"
|
||||
size={SIZE.md}
|
||||
color={colors.error.icon}
|
||||
f
|
||||
/>
|
||||
<Paragraph style={{ marginLeft: 5 }} color={colors.error.icon}>
|
||||
{warning.title}
|
||||
</Paragraph>
|
||||
</View>
|
||||
) : announcements.length !== 0 && !noAnnouncement ? (
|
||||
<Announcement color={color || colors.accent} />
|
||||
<Announcement color={color || colors.primary.accent} />
|
||||
) : type === "search" ? null : !shouldShow ? (
|
||||
<View
|
||||
style={{
|
||||
@@ -74,7 +79,9 @@ export const Header = React.memo(
|
||||
>
|
||||
{messageCard ? (
|
||||
<Card
|
||||
color={COLORS_NOTE[color?.toLowerCase()] || colors.accent}
|
||||
color={
|
||||
ColorValues[color?.toLowerCase()] || colors.primary.accent
|
||||
}
|
||||
/>
|
||||
) : null}
|
||||
</View>
|
||||
|
||||
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
import { useRef, useState } from "react";
|
||||
import React from "react";
|
||||
import { View } from "react-native";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { useMenuStore } from "../../../stores/use-menu-store";
|
||||
import { ToastEvent } from "../../../services/event-manager";
|
||||
import { getTotalNotes } from "@notesnook/common";
|
||||
@@ -31,7 +31,7 @@ import Heading from "../../ui/typography/heading";
|
||||
import Paragraph from "../../ui/typography/paragraph";
|
||||
|
||||
export const NotebookHeader = ({ notebook, onEditNotebook }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const [isPinnedToMenu, setIsPinnedToMenu] = useState(
|
||||
db.shortcuts.exists(notebook.id)
|
||||
);
|
||||
@@ -75,7 +75,7 @@ export const NotebookHeader = ({ notebook, onEditNotebook }) => {
|
||||
paddingTop: 25
|
||||
}}
|
||||
>
|
||||
<Paragraph color={colors.icon} size={SIZE.xs}>
|
||||
<Paragraph color={colors.secondary.paragraph} size={SIZE.xs}>
|
||||
{new Date(notebook.dateEdited).toLocaleString()}
|
||||
</Paragraph>
|
||||
<View
|
||||
@@ -110,7 +110,7 @@ export const NotebookHeader = ({ notebook, onEditNotebook }) => {
|
||||
height: 40
|
||||
}}
|
||||
type={isPinnedToMenu ? "grayBg" : "grayBg"}
|
||||
color={isPinnedToMenu ? colors.accent : colors.icon}
|
||||
color={isPinnedToMenu ? colors.primary.accent : colors.primary.icon}
|
||||
size={SIZE.lg}
|
||||
/>
|
||||
<IconButton
|
||||
@@ -119,7 +119,7 @@ export const NotebookHeader = ({ notebook, onEditNotebook }) => {
|
||||
tooltipText="Edit this notebook"
|
||||
name="pencil"
|
||||
type="grayBg"
|
||||
color={colors.icon}
|
||||
color={colors.primary.icon}
|
||||
customStyle={{
|
||||
width: 40,
|
||||
height: 40
|
||||
@@ -129,7 +129,7 @@ export const NotebookHeader = ({ notebook, onEditNotebook }) => {
|
||||
</View>
|
||||
|
||||
{notebook.description ? (
|
||||
<Paragraph size={SIZE.md} color={colors.pri}>
|
||||
<Paragraph size={SIZE.md} color={colors.primary.paragraph}>
|
||||
{notebook.description}
|
||||
</Paragraph>
|
||||
) : null}
|
||||
@@ -141,7 +141,7 @@ export const NotebookHeader = ({ notebook, onEditNotebook }) => {
|
||||
fontFamily: null
|
||||
}}
|
||||
size={SIZE.xs}
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
>
|
||||
{notebook.topics.length === 1
|
||||
? "1 topic"
|
||||
|
||||
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import React, { useEffect, useRef, useState } from "react";
|
||||
import { TouchableOpacity, useWindowDimensions, View } from "react-native";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { useSettingStore } from "../../../stores/use-setting-store";
|
||||
import {
|
||||
eSendEvent,
|
||||
@@ -29,7 +29,7 @@ import {
|
||||
} from "../../../services/event-manager";
|
||||
import SettingsService from "../../../services/settings";
|
||||
import { GROUP } from "../../../utils/constants";
|
||||
import { COLORS_NOTE } from "../../../utils/color-scheme";
|
||||
import { ColorValues } from "../../../utils/colors";
|
||||
import { db } from "../../../common/database";
|
||||
import { eOpenJumpToDialog } from "../../../utils/events";
|
||||
import { SIZE } from "../../../utils/size";
|
||||
@@ -41,7 +41,7 @@ import { useCallback } from "react";
|
||||
|
||||
export const SectionHeader = React.memo(
|
||||
function SectionHeader({ item, index, type, color, screen }) {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const { fontScale } = useWindowDimensions();
|
||||
const [groupOptions, setGroupOptions] = useState(
|
||||
db.settings?.getGroupOptions(type)
|
||||
@@ -85,7 +85,7 @@ export const SectionHeader = React.memo(
|
||||
justifyContent: "space-between",
|
||||
paddingHorizontal: 12,
|
||||
height: 35 * fontScale,
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
alignSelf: "center",
|
||||
borderRadius: 5,
|
||||
marginVertical: 5
|
||||
@@ -104,7 +104,7 @@ export const SectionHeader = React.memo(
|
||||
}}
|
||||
>
|
||||
<Heading
|
||||
color={COLORS_NOTE[color?.toLowerCase()] || colors.accent}
|
||||
color={ColorValues[color?.toLowerCase()] || colors.primary.accent}
|
||||
size={SIZE.sm}
|
||||
style={{
|
||||
minWidth: 60,
|
||||
@@ -168,7 +168,7 @@ export const SectionHeader = React.memo(
|
||||
: "Switch to compact mode"
|
||||
}
|
||||
fwdRef={compactModeRef}
|
||||
color={colors.icon}
|
||||
color={colors.secondary.icon}
|
||||
name={listMode == "compact" ? "view-list" : "view-list-outline"}
|
||||
onPress={() => {
|
||||
let settings = {};
|
||||
|
||||
@@ -29,9 +29,8 @@ import { TaggedNotes } from "../../../screens/notes/tagged";
|
||||
import { TopicNotes } from "../../../screens/notes/topic-notes";
|
||||
import useNavigationStore from "../../../stores/use-navigation-store";
|
||||
import { useRelationStore } from "../../../stores/use-relation-store";
|
||||
import { useSettingStore } from "../../../stores/use-setting-store";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { COLORS_NOTE } from "../../../utils/color-scheme";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { ColorValues } from "../../../utils/colors";
|
||||
import { SIZE } from "../../../utils/size";
|
||||
import { Properties } from "../../properties";
|
||||
import { Button } from "../../ui/button";
|
||||
@@ -40,6 +39,7 @@ import { ReminderTime } from "../../ui/reminder-time";
|
||||
import { TimeSince } from "../../ui/time-since";
|
||||
import Heading from "../../ui/typography/heading";
|
||||
import Paragraph from "../../ui/typography/paragraph";
|
||||
import { useIsCompactModeEnabled } from "../../../hooks/use-is-compact-mode-enabled";
|
||||
|
||||
function navigateToTag(item) {
|
||||
const tag = db.tags.tag(item.id);
|
||||
@@ -98,18 +98,15 @@ const NoteItem = ({
|
||||
dateBy = "dateCreated",
|
||||
noOpen = false
|
||||
}) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const notesListMode = useSettingStore(
|
||||
(state) => state.settings.notesListMode
|
||||
);
|
||||
const compactMode = notesListMode === "compact";
|
||||
const { colors } = useThemeColors();
|
||||
const compactMode = useIsCompactModeEnabled(item);
|
||||
const attachmentCount = db.attachments?.ofNote(item.id, "all")?.length || 0;
|
||||
const _update = useRelationStore((state) => state.updater);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
const notebooks = React.useMemo(() => getNotebook(item), [item, _update]);
|
||||
const reminders = db.relations.from(item, "reminder");
|
||||
const reminder = getUpcomingReminder(reminders);
|
||||
const noteColor = COLORS_NOTE[item.color?.toLowerCase()];
|
||||
const noteColor = ColorValues[item.color?.toLowerCase()];
|
||||
const tags = getTags(item);
|
||||
return (
|
||||
<>
|
||||
@@ -151,7 +148,7 @@ const NoteItem = ({
|
||||
borderRadius: 5,
|
||||
marginRight: 5,
|
||||
borderWidth: 0.5,
|
||||
borderColor: colors.icon,
|
||||
borderColor: colors.primary.border,
|
||||
paddingHorizontal: 6,
|
||||
marginBottom: 5
|
||||
}}
|
||||
@@ -181,7 +178,9 @@ const NoteItem = ({
|
||||
{compactMode ? (
|
||||
<Paragraph
|
||||
numberOfLines={1}
|
||||
color={COLORS_NOTE[item.color?.toLowerCase()] || colors.heading}
|
||||
color={
|
||||
ColorValues[item.color?.toLowerCase()] || colors.primary.heading
|
||||
}
|
||||
style={{
|
||||
flexWrap: "wrap"
|
||||
}}
|
||||
@@ -192,7 +191,9 @@ const NoteItem = ({
|
||||
) : (
|
||||
<Heading
|
||||
numberOfLines={1}
|
||||
color={COLORS_NOTE[item.color?.toLowerCase()] || colors.heading}
|
||||
color={
|
||||
ColorValues[item.color?.toLowerCase()] || colors.primary.heading
|
||||
}
|
||||
style={{
|
||||
flexWrap: "wrap"
|
||||
}}
|
||||
@@ -235,13 +236,13 @@ const NoteItem = ({
|
||||
marginRight: 6
|
||||
}}
|
||||
size={SIZE.sm}
|
||||
color={colors.red}
|
||||
color={colors.error.accent}
|
||||
/>
|
||||
) : null}
|
||||
<TimeSince
|
||||
style={{
|
||||
fontSize: SIZE.xs,
|
||||
color: colors.icon,
|
||||
color: colors.secondary.paragraph,
|
||||
marginRight: 6
|
||||
}}
|
||||
time={item[dateBy]}
|
||||
@@ -261,9 +262,12 @@ const NoteItem = ({
|
||||
<Icon
|
||||
name="attachment"
|
||||
size={SIZE.md}
|
||||
color={colors.icon}
|
||||
color={colors.primary.icon}
|
||||
/>
|
||||
<Paragraph color={colors.icon} size={SIZE.xs}>
|
||||
<Paragraph
|
||||
color={colors.secondary.paragraph}
|
||||
size={SIZE.xs}
|
||||
>
|
||||
{attachmentCount}
|
||||
</Paragraph>
|
||||
</View>
|
||||
@@ -278,7 +282,8 @@ const NoteItem = ({
|
||||
marginRight: 6
|
||||
}}
|
||||
color={
|
||||
COLORS_NOTE[item.color?.toLowerCase()] || colors.accent
|
||||
ColorValues[item.color?.toLowerCase()] ||
|
||||
colors.primary.accent
|
||||
}
|
||||
/>
|
||||
) : null}
|
||||
@@ -291,7 +296,7 @@ const NoteItem = ({
|
||||
style={{
|
||||
marginRight: 6
|
||||
}}
|
||||
color={colors.icon}
|
||||
color={colors.primary.icon}
|
||||
/>
|
||||
) : null}
|
||||
|
||||
@@ -336,7 +341,7 @@ const NoteItem = ({
|
||||
) : (
|
||||
<>
|
||||
<Paragraph
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
size={SIZE.xs}
|
||||
style={{
|
||||
marginRight: 6
|
||||
@@ -349,7 +354,7 @@ const NoteItem = ({
|
||||
</Paragraph>
|
||||
|
||||
<Paragraph
|
||||
color={colors.accent}
|
||||
color={colors.primary.accent}
|
||||
size={SIZE.xs}
|
||||
style={{
|
||||
marginRight: 6
|
||||
@@ -377,7 +382,7 @@ const NoteItem = ({
|
||||
marginRight: 6
|
||||
}}
|
||||
size={SIZE.sm}
|
||||
color={colors.red}
|
||||
color={colors.error.accent}
|
||||
/>
|
||||
) : null}
|
||||
|
||||
@@ -389,7 +394,7 @@ const NoteItem = ({
|
||||
style={{
|
||||
marginRight: 6
|
||||
}}
|
||||
color={colors.icon}
|
||||
color={colors.secondary.background}
|
||||
/>
|
||||
) : null}
|
||||
|
||||
@@ -408,7 +413,7 @@ const NoteItem = ({
|
||||
<TimeSince
|
||||
style={{
|
||||
fontSize: SIZE.xs,
|
||||
color: colors.icon,
|
||||
color: colors.secondary.paragraph,
|
||||
marginRight: 6
|
||||
}}
|
||||
time={item[dateBy]}
|
||||
@@ -419,7 +424,7 @@ const NoteItem = ({
|
||||
|
||||
<IconButton
|
||||
testID={notesnook.listitem.menu}
|
||||
color={colors.pri}
|
||||
color={colors.primary.paragraph}
|
||||
name="dots-horizontal"
|
||||
size={SIZE.xl}
|
||||
onPress={() => !noOpen && showActionSheet(item, isTrash)}
|
||||
|
||||
@@ -23,8 +23,7 @@ import Icon from "react-native-vector-icons/MaterialCommunityIcons";
|
||||
import { notesnook } from "../../../../e2e/test.ids";
|
||||
import { TopicNotes } from "../../../screens/notes/topic-notes";
|
||||
import { useSelectionStore } from "../../../stores/use-selection-store";
|
||||
import { useSettingStore } from "../../../stores/use-setting-store";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { SIZE } from "../../../utils/size";
|
||||
import { Properties } from "../../properties";
|
||||
import { Button } from "../../ui/button";
|
||||
@@ -32,6 +31,7 @@ import { IconButton } from "../../ui/icon-button";
|
||||
import Heading from "../../ui/typography/heading";
|
||||
import Paragraph from "../../ui/typography/paragraph";
|
||||
import { getFormattedDate } from "@notesnook/common";
|
||||
import { useIsCompactModeEnabled } from "../../../hooks/use-is-compact-mode-enabled";
|
||||
|
||||
const showActionSheet = (item) => {
|
||||
Properties.present(item);
|
||||
@@ -49,11 +49,8 @@ export const NotebookItem = ({
|
||||
dateBy,
|
||||
totalNotes
|
||||
}) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const notebooksListMode = useSettingStore(
|
||||
(state) => state.settings.notebooksListMode
|
||||
);
|
||||
const compactMode = notebooksListMode === "compact";
|
||||
const { colors } = useThemeColors();
|
||||
const compactMode = useIsCompactModeEnabled(item);
|
||||
const topics = item.topics?.slice(0, 3) || [];
|
||||
|
||||
return (
|
||||
@@ -112,8 +109,6 @@ export const NotebookItem = ({
|
||||
key={topic.id}
|
||||
height={null}
|
||||
textStyle={{
|
||||
fontWeight: "normal",
|
||||
fontFamily: null,
|
||||
marginRight: 0
|
||||
}}
|
||||
type="grayBg"
|
||||
@@ -125,7 +120,7 @@ export const NotebookItem = ({
|
||||
maxWidth: 120,
|
||||
borderWidth: 0.5,
|
||||
paddingVertical: 2.5,
|
||||
borderColor: colors.icon,
|
||||
borderColor: colors.primary.border,
|
||||
paddingHorizontal: 6,
|
||||
marginVertical: 5,
|
||||
marginRight: 5
|
||||
@@ -149,7 +144,7 @@ export const NotebookItem = ({
|
||||
{isTrash ? (
|
||||
<>
|
||||
<Paragraph
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
size={SIZE.xs}
|
||||
style={{
|
||||
textAlignVertical: "center",
|
||||
@@ -160,7 +155,7 @@ export const NotebookItem = ({
|
||||
new Date(item.dateDeleted).toISOString().slice(0, 10)}
|
||||
</Paragraph>
|
||||
<Paragraph
|
||||
color={colors.accent}
|
||||
color={colors.primary.accent}
|
||||
size={SIZE.xs}
|
||||
style={{
|
||||
textAlignVertical: "center",
|
||||
@@ -172,7 +167,7 @@ export const NotebookItem = ({
|
||||
</>
|
||||
) : (
|
||||
<Paragraph
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
size={SIZE.xs}
|
||||
style={{
|
||||
marginRight: 6
|
||||
@@ -182,7 +177,7 @@ export const NotebookItem = ({
|
||||
</Paragraph>
|
||||
)}
|
||||
<Paragraph
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
size={SIZE.xs}
|
||||
style={{
|
||||
marginRight: 6
|
||||
@@ -203,7 +198,7 @@ export const NotebookItem = ({
|
||||
marginRight: 10,
|
||||
marginTop: 2
|
||||
}}
|
||||
color={colors.accent}
|
||||
color={colors.primary.accent}
|
||||
/>
|
||||
) : null}
|
||||
</View>
|
||||
@@ -218,7 +213,7 @@ export const NotebookItem = ({
|
||||
{compactMode ? (
|
||||
<>
|
||||
<Paragraph
|
||||
color={colors.icon}
|
||||
color={colors.primary.icon}
|
||||
size={SIZE.xs}
|
||||
style={{
|
||||
marginRight: 6
|
||||
@@ -234,7 +229,7 @@ export const NotebookItem = ({
|
||||
) : null}
|
||||
|
||||
<IconButton
|
||||
color={colors.heading}
|
||||
color={colors.primary.heading}
|
||||
name="dots-horizontal"
|
||||
testID={notesnook.ids.notebook.menu}
|
||||
size={SIZE.xl}
|
||||
|
||||
@@ -20,7 +20,7 @@ import React from "react";
|
||||
import { View } from "react-native";
|
||||
import { notesnook } from "../../../../e2e/test.ids";
|
||||
import type { Reminder } from "../../../services/notifications";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { SIZE } from "../../../utils/size";
|
||||
import { Properties } from "../../properties";
|
||||
import { IconButton } from "../../ui/icon-button";
|
||||
@@ -41,7 +41,7 @@ const ReminderItem = React.memo(
|
||||
index: number;
|
||||
isSheet: boolean;
|
||||
}) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const openReminder = () => {
|
||||
ReminderSheet.present(item, undefined, isSheet);
|
||||
};
|
||||
@@ -90,7 +90,7 @@ const ReminderItem = React.memo(
|
||||
{item.disabled ? (
|
||||
<View
|
||||
style={{
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
borderRadius: 5,
|
||||
flexDirection: "row",
|
||||
paddingHorizontal: 6,
|
||||
@@ -105,11 +105,11 @@ const ReminderItem = React.memo(
|
||||
<Icon
|
||||
name="bell-off-outline"
|
||||
size={SIZE.md}
|
||||
color={colors.errorText}
|
||||
color={colors.error.icon}
|
||||
/>
|
||||
<Paragraph
|
||||
size={SIZE.xs}
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
style={{ marginLeft: 5 }}
|
||||
>
|
||||
Disabled
|
||||
@@ -119,7 +119,7 @@ const ReminderItem = React.memo(
|
||||
{item.mode === "repeat" && item.recurringMode ? (
|
||||
<View
|
||||
style={{
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
borderRadius: 5,
|
||||
flexDirection: "row",
|
||||
paddingHorizontal: 6,
|
||||
@@ -131,10 +131,10 @@ const ReminderItem = React.memo(
|
||||
height: 30
|
||||
}}
|
||||
>
|
||||
<Icon name="reload" size={SIZE.md} color={colors.accent} />
|
||||
<Icon name="reload" size={SIZE.md} color={colors.primary.accent} />
|
||||
<Paragraph
|
||||
size={SIZE.xs}
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
style={{ marginLeft: 5 }}
|
||||
>
|
||||
{item.recurringMode.slice(0, 1).toUpperCase() +
|
||||
@@ -160,7 +160,7 @@ const ReminderItem = React.memo(
|
||||
</View>
|
||||
<IconButton
|
||||
testID={notesnook.listitem.menu}
|
||||
color={colors.pri}
|
||||
color={colors.primary.paragraph}
|
||||
name="dots-horizontal"
|
||||
size={SIZE.xl}
|
||||
onPress={() => Properties.present(item, [], isSheet)}
|
||||
|
||||
@@ -17,37 +17,36 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import React from "react";
|
||||
import { View } from "react-native";
|
||||
import useIsSelected from "../../../hooks/use-selected";
|
||||
import { useEditorStore } from "../../../stores/use-editor-store";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { hexToRGBA } from "../../../utils/color-scheme/utils";
|
||||
|
||||
export const Filler = ({ item }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
|
||||
const { colors } = useThemeColors();
|
||||
const currentEditingNote = useEditorStore(
|
||||
(state) => state.currentEditingNote
|
||||
);
|
||||
|
||||
const color = "gray";
|
||||
const [selected] = useIsSelected(item);
|
||||
|
||||
return currentEditingNote === item.id ? (
|
||||
return currentEditingNote === item.id || selected ? (
|
||||
<View
|
||||
style={{
|
||||
position: "absolute",
|
||||
width: "110%",
|
||||
height: "150%",
|
||||
backgroundColor:
|
||||
currentEditingNote === item.id
|
||||
? hexToRGBA(colors[color], 0.12)
|
||||
: null,
|
||||
backgroundColor: colors.selected.background,
|
||||
borderLeftWidth: 5,
|
||||
borderLeftColor:
|
||||
currentEditingNote === item.id
|
||||
? colors[item.color || "accent"]
|
||||
? item.color
|
||||
? colors.static[item.color]
|
||||
: colors.selected.accent
|
||||
: "transparent"
|
||||
}}
|
||||
></View>
|
||||
collapsable={false}
|
||||
/>
|
||||
) : null;
|
||||
};
|
||||
|
||||
@@ -17,10 +17,10 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import React, { useRef } from "react";
|
||||
import { useIsCompactModeEnabled } from "../../../hooks/use-is-compact-mode-enabled";
|
||||
import { useSelectionStore } from "../../../stores/use-selection-store";
|
||||
import { useSettingStore } from "../../../stores/use-setting-store";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { PressableButton } from "../../ui/pressable";
|
||||
import { Filler } from "./back-fill";
|
||||
import { SelectionIcon } from "./selection";
|
||||
@@ -29,51 +29,33 @@ const SelectionWrapper = ({
|
||||
children,
|
||||
item,
|
||||
background,
|
||||
onLongPress,
|
||||
onPress,
|
||||
testID,
|
||||
isSheet
|
||||
}) => {
|
||||
const itemId = useRef(item.id);
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const notebooksListMode = useSettingStore(
|
||||
(state) => state.settings.notebooksListMode
|
||||
);
|
||||
const notesListMode = useSettingStore(
|
||||
(state) => state.settings.notesListMode
|
||||
);
|
||||
const listMode =
|
||||
item.type === "notebook" || item.itemType === "notebook"
|
||||
? notebooksListMode
|
||||
: notesListMode;
|
||||
const compactMode =
|
||||
(item.type === "notebook" ||
|
||||
item.itemType === "notebook" ||
|
||||
item.itemType === "note" ||
|
||||
item.type === "note") &&
|
||||
listMode === "compact";
|
||||
const { colors, isDark } = useThemeColors();
|
||||
const compactMode = useIsCompactModeEnabled(item);
|
||||
|
||||
if (item.id !== itemId.current) {
|
||||
itemId.current = item.id;
|
||||
}
|
||||
|
||||
const _onLongPress = () => {
|
||||
const onLongPress = () => {
|
||||
if (!useSelectionStore.getState().selectionMode) {
|
||||
useSelectionStore.getState().setSelectionMode(true);
|
||||
}
|
||||
useSelectionStore.getState().setSelectedItem(item);
|
||||
};
|
||||
|
||||
const _onPress = async () => {
|
||||
await onPress();
|
||||
};
|
||||
return (
|
||||
<PressableButton
|
||||
customColor={isSheet ? colors.transGray : "transparent"}
|
||||
customColor={isSheet ? colors.primary.hover : "transparent"}
|
||||
testID={testID}
|
||||
onLongPress={_onLongPress}
|
||||
onPress={_onPress}
|
||||
customSelectedColor={colors.transGray}
|
||||
customAlpha={!colors.night ? -0.02 : 0.02}
|
||||
onLongPress={onLongPress}
|
||||
onPress={onPress}
|
||||
customSelectedColor={colors.primary.hover}
|
||||
customAlpha={!isDark ? -0.02 : 0.02}
|
||||
customOpacity={1}
|
||||
customStyle={{
|
||||
flexDirection: "row",
|
||||
|
||||
@@ -17,51 +17,21 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import React from "react";
|
||||
import { View } from "react-native";
|
||||
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
|
||||
import { useIsCompactModeEnabled } from "../../../hooks/use-is-compact-mode-enabled";
|
||||
import useIsSelected from "../../../hooks/use-selected";
|
||||
import { useSelectionStore } from "../../../stores/use-selection-store";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { SIZE } from "../../../utils/size";
|
||||
import { useSettingStore } from "../../../stores/use-setting-store";
|
||||
|
||||
export const SelectionIcon = ({ item }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
|
||||
const { colors } = useThemeColors();
|
||||
const selectionMode = useSelectionStore((state) => state.selectionMode);
|
||||
const selectedItemsList = useSelectionStore(
|
||||
(state) => state.selectedItemsList
|
||||
);
|
||||
const [selected, setSelected] = useState(false);
|
||||
const notebooksListMode = useSettingStore(
|
||||
(state) => state.settings.notebooksListMode
|
||||
);
|
||||
const notesListMode = useSettingStore(
|
||||
(state) => state.settings.notesListMode
|
||||
);
|
||||
const listMode = item.type === "notebook" ? notebooksListMode : notesListMode;
|
||||
const [selected] = useIsSelected(item);
|
||||
|
||||
const compactMode =
|
||||
(item.type === "notebook" || item.type === "note") &&
|
||||
listMode === "compact";
|
||||
|
||||
useEffect(() => {
|
||||
if (selectionMode) {
|
||||
let exists = selectedItemsList.filter(
|
||||
(o) => o.dateCreated === item.dateCreated
|
||||
);
|
||||
|
||||
if (exists[0]) {
|
||||
if (!selected) {
|
||||
setSelected(true);
|
||||
}
|
||||
} else {
|
||||
if (selected) {
|
||||
setSelected(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, [selectedItemsList, item.id, selectionMode, item.dateCreated, selected]);
|
||||
const compactMode = useIsCompactModeEnabled(item);
|
||||
|
||||
return selectionMode ? (
|
||||
<View
|
||||
@@ -73,14 +43,14 @@ export const SelectionIcon = ({ item }) => {
|
||||
marginRight: 10,
|
||||
borderWidth: 1,
|
||||
borderRadius: 100,
|
||||
borderColor: colors.border
|
||||
borderColor: colors.primary.border
|
||||
}}
|
||||
pointerEvents="none"
|
||||
>
|
||||
{selected ? (
|
||||
<Icon
|
||||
size={compactMode ? SIZE.xl - 2 : SIZE.xl}
|
||||
color={selected ? colors.accent : colors.icon}
|
||||
color={selected ? colors.selected.accent : colors.primary.icon}
|
||||
name={"check"}
|
||||
/>
|
||||
) : null}
|
||||
|
||||
@@ -21,7 +21,7 @@ import React from "react";
|
||||
import { View } from "react-native";
|
||||
import { notesnook } from "../../../../e2e/test.ids";
|
||||
import { TaggedNotes } from "../../../screens/notes/tagged";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { SIZE } from "../../../utils/size";
|
||||
import { Properties } from "../../properties";
|
||||
import { IconButton } from "../../ui/icon-button";
|
||||
@@ -31,7 +31,7 @@ import Paragraph from "../../ui/typography/paragraph";
|
||||
|
||||
const TagItem = React.memo(
|
||||
({ item, index }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors, isDark } = useThemeColors();
|
||||
const onPress = () => {
|
||||
TaggedNotes.navigate(item, true);
|
||||
};
|
||||
@@ -39,9 +39,9 @@ const TagItem = React.memo(
|
||||
return (
|
||||
<PressableButton
|
||||
onPress={onPress}
|
||||
selectedColor={colors.nav}
|
||||
selectedColor={colors.secondary.background}
|
||||
testID={notesnook.ids.tag.get(index)}
|
||||
alpha={!colors.night ? -0.02 : 0.02}
|
||||
alpha={!isDark ? -0.02 : 0.02}
|
||||
opacity={1}
|
||||
customStyle={{
|
||||
paddingHorizontal: 12,
|
||||
@@ -61,7 +61,7 @@ const TagItem = React.memo(
|
||||
<Heading
|
||||
size={SIZE.md}
|
||||
style={{
|
||||
color: colors.accent
|
||||
color: colors.primary.accent
|
||||
}}
|
||||
>
|
||||
#
|
||||
@@ -69,7 +69,7 @@ const TagItem = React.memo(
|
||||
{item.alias}
|
||||
</Heading>
|
||||
<Paragraph
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
size={SIZE.xs}
|
||||
style={{
|
||||
marginTop: 5
|
||||
@@ -84,7 +84,7 @@ const TagItem = React.memo(
|
||||
</View>
|
||||
|
||||
<IconButton
|
||||
color={colors.heading}
|
||||
color={colors.primary.heading}
|
||||
name="dots-horizontal"
|
||||
size={SIZE.xl}
|
||||
onPress={() => {
|
||||
|
||||
@@ -21,15 +21,15 @@ import React from "react";
|
||||
import { View } from "react-native";
|
||||
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
|
||||
import { useMessageStore } from "../../stores/use-message-store";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { hexToRGBA } from "../../utils/color-scheme/utils";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { hexToRGBA } from "../../utils/colors";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import { PressableButton } from "../ui/pressable";
|
||||
import Paragraph from "../ui/typography/paragraph";
|
||||
|
||||
export const Card = ({ color, warning }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
color = color ? color : colors.accent;
|
||||
const { colors } = useThemeColors();
|
||||
color = color ? color : colors.primary.accent;
|
||||
const messageBoardState = useMessageStore((state) => state.message);
|
||||
const announcement = useMessageStore((state) => state.announcement);
|
||||
|
||||
@@ -62,7 +62,7 @@ export const Card = ({ color, warning }) => {
|
||||
width: 40,
|
||||
backgroundColor:
|
||||
messageBoardState.type === "error"
|
||||
? hexToRGBA(colors.red, 0.15)
|
||||
? hexToRGBA(colors.static.red, 0.15)
|
||||
: hexToRGBA(color, 0.15),
|
||||
height: 40,
|
||||
borderRadius: 100,
|
||||
@@ -73,7 +73,7 @@ export const Card = ({ color, warning }) => {
|
||||
<Icon
|
||||
size={SIZE.lg}
|
||||
color={
|
||||
messageBoardState.type === "error" ? colors.errorText : color
|
||||
messageBoardState.type === "error" ? colors.error.icon : color
|
||||
}
|
||||
name={messageBoardState.icon}
|
||||
/>
|
||||
@@ -86,7 +86,7 @@ export const Card = ({ color, warning }) => {
|
||||
marginRight: 10
|
||||
}}
|
||||
>
|
||||
<Paragraph color={colors.icon} size={SIZE.xs}>
|
||||
<Paragraph color={colors.secondary.paragraph} size={SIZE.xs}>
|
||||
{messageBoardState.message}
|
||||
</Paragraph>
|
||||
<Paragraph
|
||||
@@ -94,7 +94,7 @@ export const Card = ({ color, warning }) => {
|
||||
flexWrap: "wrap",
|
||||
flexShrink: 1
|
||||
}}
|
||||
color={colors.heading}
|
||||
color={colors.primary.heading}
|
||||
>
|
||||
{messageBoardState.actionText}
|
||||
</Paragraph>
|
||||
@@ -111,7 +111,9 @@ export const Card = ({ color, warning }) => {
|
||||
>
|
||||
<Icon
|
||||
name="chevron-right"
|
||||
color={messageBoardState.type === "error" ? colors.red : color}
|
||||
color={
|
||||
messageBoardState.type === "error" ? colors.error.icon : color
|
||||
}
|
||||
size={SIZE.lg}
|
||||
/>
|
||||
</View>
|
||||
|
||||
@@ -23,8 +23,8 @@ import { notesnook } from "../../../e2e/test.ids";
|
||||
import useGlobalSafeAreaInsets from "../../hooks/use-global-safe-area-insets";
|
||||
import { useTip } from "../../services/tip-manager";
|
||||
import { useSettingStore } from "../../stores/use-setting-store";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { COLORS_NOTE } from "../../utils/color-scheme";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { ColorValues } from "../../utils/colors";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import { Tip } from "../tip";
|
||||
import { Button } from "../ui/button";
|
||||
@@ -40,7 +40,7 @@ export const Empty = React.memo(
|
||||
type,
|
||||
screen
|
||||
}) {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const insets = useGlobalSafeAreaInsets();
|
||||
const { height } = useWindowDimensions();
|
||||
const introCompleted = useSettingStore(
|
||||
@@ -69,7 +69,7 @@ export const Empty = React.memo(
|
||||
<>
|
||||
<Tip
|
||||
color={
|
||||
COLORS_NOTE[headerProps.color?.toLowerCase()]
|
||||
ColorValues[headerProps.color?.toLowerCase()]
|
||||
? headerProps.color
|
||||
: "accent"
|
||||
}
|
||||
@@ -87,12 +87,10 @@ export const Empty = React.memo(
|
||||
iconPosition="right"
|
||||
icon="arrow-right"
|
||||
onPress={placeholderData.action}
|
||||
accentColor={
|
||||
COLORS_NOTE[headerProps.color?.toLowerCase()]
|
||||
? headerProps.color
|
||||
: "accent"
|
||||
}
|
||||
accentText="light"
|
||||
buttonType={{
|
||||
text:
|
||||
colors.static[headerProps.color] || colors.primary.accent
|
||||
}}
|
||||
style={{
|
||||
alignSelf: "flex-start",
|
||||
borderRadius: 5,
|
||||
@@ -118,7 +116,8 @@ export const Empty = React.memo(
|
||||
<ActivityIndicator
|
||||
size={SIZE.lg}
|
||||
color={
|
||||
COLORS_NOTE[headerProps.color?.toLowerCase()] || colors.accent
|
||||
ColorValues[headerProps.color?.toLowerCase()] ||
|
||||
colors.primary.accent
|
||||
}
|
||||
/>
|
||||
</View>
|
||||
|
||||
@@ -24,7 +24,7 @@ import Animated, { FadeInDown } from "react-native-reanimated";
|
||||
import { notesnook } from "../../../e2e/test.ids";
|
||||
import { eSendEvent } from "../../services/event-manager";
|
||||
import Sync from "../../services/sync";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { db } from "../../common/database";
|
||||
import { eScrollEvent } from "../../utils/events";
|
||||
import { tabBarRef } from "../../utils/global-refs";
|
||||
@@ -93,7 +93,7 @@ const List = ({
|
||||
handlers,
|
||||
ScrollComponent
|
||||
}) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const scrollRef = useRef();
|
||||
const [notesListMode, notebooksListMode] = useSettingStore((state) => [
|
||||
state.settings.notesListMode,
|
||||
@@ -188,9 +188,9 @@ const List = ({
|
||||
keyboardDismissMode="interactive"
|
||||
refreshControl={
|
||||
<RefreshControl
|
||||
tintColor={colors.accent}
|
||||
colors={[colors.accent]}
|
||||
progressBackgroundColor={colors.nav}
|
||||
tintColor={colors.primary.accent}
|
||||
colors={[colors.primary.accent]}
|
||||
progressBackgroundColor={colors.secondary.background}
|
||||
onRefresh={_onRefresh}
|
||||
refreshing={false}
|
||||
/>
|
||||
|
||||
@@ -33,7 +33,7 @@ import {
|
||||
} from "../../services/event-manager";
|
||||
import Navigation from "../../services/navigation";
|
||||
import Sync from "../../services/sync";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { eOnLoadNote, eShowMergeDialog } from "../../utils/events";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import { sleep } from "../../utils/time";
|
||||
@@ -49,7 +49,7 @@ import { useSettingStore } from "../../stores/use-setting-store";
|
||||
import { getFormattedDate } from "@notesnook/common";
|
||||
|
||||
const MergeConflicts = () => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [keep, setKeep] = useState(null);
|
||||
const [copy, setCopy] = useState(null);
|
||||
@@ -152,16 +152,20 @@ const MergeConflicts = () => {
|
||||
}}
|
||||
>
|
||||
{back && (
|
||||
<IconButton onPress={close} color={colors.pri} name="arrow-left" />
|
||||
<IconButton
|
||||
onPress={close}
|
||||
color={colors.primary.paragraph}
|
||||
name="arrow-left"
|
||||
/>
|
||||
)}
|
||||
<Paragraph
|
||||
style={{ flexWrap: "wrap" }}
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
size={SIZE.xs}
|
||||
>
|
||||
<Text
|
||||
style={{
|
||||
color: isCurrent ? colors.accent : colors.red,
|
||||
color: isCurrent ? colors.primary.accent : colors.static.red,
|
||||
fontWeight: "bold"
|
||||
}}
|
||||
>
|
||||
@@ -200,15 +204,17 @@ const MergeConflicts = () => {
|
||||
<Button
|
||||
title="Discard"
|
||||
type="accent"
|
||||
accentColor="red"
|
||||
buttonType={{
|
||||
color: colors.static.red,
|
||||
text: colors.static.white
|
||||
}}
|
||||
height={30}
|
||||
style={{
|
||||
borderRadius: 100,
|
||||
paddingHorizontal: 12
|
||||
}}
|
||||
fontSize={SIZE.xs}
|
||||
accentText="light"
|
||||
color={colors.errorText}
|
||||
color={colors.error.paragraph}
|
||||
onPress={() => {
|
||||
setDialogVisible(true);
|
||||
}}
|
||||
@@ -257,7 +263,7 @@ const MergeConflicts = () => {
|
||||
>
|
||||
<SafeAreaView
|
||||
style={{
|
||||
backgroundColor: colors.bg,
|
||||
backgroundColor: colors.primary.background,
|
||||
paddingTop: insets.top
|
||||
}}
|
||||
>
|
||||
@@ -299,9 +305,9 @@ const MergeConflicts = () => {
|
||||
<Animated.View
|
||||
style={{
|
||||
height: height / 2 - (50 + insets.top / 2),
|
||||
backgroundColor: colors.bg,
|
||||
backgroundColor: colors.primary.background,
|
||||
borderBottomWidth: 1,
|
||||
borderBottomColor: colors.nav
|
||||
borderBottomColor: colors.secondary.background
|
||||
}}
|
||||
>
|
||||
<Editor
|
||||
@@ -335,7 +341,7 @@ const MergeConflicts = () => {
|
||||
<Animated.View
|
||||
style={{
|
||||
height: height / 2 - (50 + insets.top / 2),
|
||||
backgroundColor: colors.bg,
|
||||
backgroundColor: colors.primary.background,
|
||||
borderRadius: 10
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -23,7 +23,7 @@ import { FlatList } from "react-native-gesture-handler";
|
||||
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
|
||||
import { db } from "../../common/database";
|
||||
import { presentSheet } from "../../services/event-manager";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { openLinkInBrowser } from "../../utils/functions";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import DialogHeader from "../dialog/dialog-header";
|
||||
@@ -37,7 +37,7 @@ import { getFormattedDate, getTimeAgo } from "@notesnook/common";
|
||||
export default function NoteHistory({ note, fwdRef }) {
|
||||
const [history, setHistory] = useState([]);
|
||||
const [_loading, setLoading] = useState(true);
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
@@ -89,12 +89,12 @@ export default function NoteHistory({ note, fwdRef }) {
|
||||
}}
|
||||
>
|
||||
<Paragraph>{getDate(item.dateCreated, item.dateModified)}</Paragraph>
|
||||
<Paragraph color={colors.icon} size={SIZE.xs}>
|
||||
<Paragraph color={colors.secondary.paragraph} size={SIZE.xs}>
|
||||
{getTimeAgo(item.dateModified)}
|
||||
</Paragraph>
|
||||
</PressableButton>
|
||||
),
|
||||
[colors.icon, preview]
|
||||
[colors.secondary.paragraph, preview]
|
||||
);
|
||||
|
||||
return (
|
||||
@@ -128,8 +128,8 @@ export default function NoteHistory({ note, fwdRef }) {
|
||||
height: 200
|
||||
}}
|
||||
>
|
||||
<Icon name="history" size={60} color={colors.icon} />
|
||||
<Paragraph color={colors.icon}>
|
||||
<Icon name="history" size={60} color={colors.primary.icon} />
|
||||
<Paragraph color={colors.secondary.paragraph}>
|
||||
No note history found on this device.
|
||||
</Paragraph>
|
||||
</View>
|
||||
@@ -138,7 +138,7 @@ export default function NoteHistory({ note, fwdRef }) {
|
||||
/>
|
||||
<Paragraph
|
||||
size={SIZE.xs}
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
style={{
|
||||
alignSelf: "center"
|
||||
}}
|
||||
@@ -151,7 +151,10 @@ export default function NoteHistory({ note, fwdRef }) {
|
||||
colors
|
||||
);
|
||||
}}
|
||||
style={{ color: colors.accent, textDecorationLine: "underline" }}
|
||||
style={{
|
||||
color: colors.primary.accent,
|
||||
textDecorationLine: "underline"
|
||||
}}
|
||||
>
|
||||
Learn how this works.
|
||||
</Text>
|
||||
|
||||
@@ -27,7 +27,7 @@ import { eSendEvent, ToastEvent } from "../../services/event-manager";
|
||||
import Navigation from "../../services/navigation";
|
||||
import { useEditorStore } from "../../stores/use-editor-store";
|
||||
import { useSelectionStore } from "../../stores/use-selection-store";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { useTrashStore } from "../../stores/use-trash-store";
|
||||
import { eCloseSheet, eOnLoadNote } from "../../utils/events";
|
||||
import { sleep } from "../../utils/time";
|
||||
@@ -38,7 +38,7 @@ import { Button } from "../ui/button";
|
||||
import Paragraph from "../ui/typography/paragraph";
|
||||
|
||||
export default function NotePreview({ session, content, note }) {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const editorId = ":noteHistory";
|
||||
|
||||
async function restore() {
|
||||
@@ -137,7 +137,7 @@ export default function NotePreview({ session, content, note }) {
|
||||
alignItems: "center"
|
||||
}}
|
||||
>
|
||||
<Paragraph color={colors.icon}>
|
||||
<Paragraph color={colors.secondary.paragraph}>
|
||||
Preview not available, content is encrypted.
|
||||
</Paragraph>
|
||||
</View>
|
||||
|
||||
@@ -24,7 +24,7 @@ import { db } from "../../common/database";
|
||||
import { usePricing } from "../../hooks/use-pricing";
|
||||
import { DDS } from "../../services/device-detection";
|
||||
import { eSendEvent, presentSheet } from "../../services/event-manager";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { useUserStore } from "../../stores/use-user-store";
|
||||
import { getElevationStyle } from "../../utils/elevation";
|
||||
import {
|
||||
@@ -49,7 +49,7 @@ import { Group } from "./group";
|
||||
import { PricingPlans } from "./pricing-plans";
|
||||
|
||||
export const Component = ({ close, promo }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const user = useUserStore((state) => state.user);
|
||||
const userCanRequestTrial =
|
||||
user && (!user.subscription || !user.subscription.expiry) ? true : false;
|
||||
@@ -87,7 +87,7 @@ export const Component = ({ close, promo }) => {
|
||||
<View
|
||||
style={{
|
||||
width: "100%",
|
||||
backgroundColor: colors.bg,
|
||||
backgroundColor: colors.primary.background,
|
||||
justifyContent: "space-between",
|
||||
borderRadius: 10,
|
||||
maxHeight: "100%"
|
||||
@@ -106,7 +106,7 @@ export const Component = ({ close, promo }) => {
|
||||
width: 50,
|
||||
height: 50
|
||||
}}
|
||||
color={colors.pri}
|
||||
color={colors.primary.paragraph}
|
||||
name="close"
|
||||
/>
|
||||
|
||||
@@ -131,7 +131,7 @@ export const Component = ({ close, promo }) => {
|
||||
<SvgView
|
||||
width={350}
|
||||
height={350}
|
||||
src={LAUNCH_ROCKET(colors.accent)}
|
||||
src={LAUNCH_ROCKET(colors.primary.accent)}
|
||||
/>
|
||||
</View>
|
||||
|
||||
@@ -144,7 +144,7 @@ export const Component = ({ close, promo }) => {
|
||||
}}
|
||||
>
|
||||
Notesnook{" "}
|
||||
<Heading size={SIZE.lg} color={colors.accent}>
|
||||
<Heading size={SIZE.lg} color={colors.primary.accent}>
|
||||
Pro
|
||||
</Heading>
|
||||
</Heading>
|
||||
@@ -155,7 +155,7 @@ export const Component = ({ close, promo }) => {
|
||||
marginBottom: 20
|
||||
}}
|
||||
size={SIZE.md}
|
||||
color={colors.accent}
|
||||
color={colors.primary.accent}
|
||||
/>
|
||||
) : (
|
||||
<Paragraph
|
||||
@@ -225,7 +225,7 @@ export const Component = ({ close, promo }) => {
|
||||
|
||||
{!user || userCanRequestTrial ? (
|
||||
<Paragraph
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
size={SIZE.xs}
|
||||
style={{
|
||||
alignSelf: "center",
|
||||
|
||||
@@ -26,7 +26,7 @@ import {
|
||||
eUnSubscribeEvent
|
||||
} from "../../services/event-manager";
|
||||
import PremiumService from "../../services/premium";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import {
|
||||
eOpenPremiumDialog,
|
||||
eOpenResultDialog,
|
||||
@@ -44,7 +44,7 @@ import { CompactFeatures } from "./compact-features";
|
||||
import { Offer } from "./offer";
|
||||
|
||||
export const Expiring = () => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [status, setStatus] = useState({
|
||||
title: "Your trial is ending soon",
|
||||
@@ -146,7 +146,7 @@ export const Expiring = () => {
|
||||
size={SIZE.xs}
|
||||
style={{
|
||||
textDecorationLine: "underline",
|
||||
color: colors.icon,
|
||||
color: colors.secondary.paragraph,
|
||||
marginTop: 10
|
||||
}}
|
||||
>
|
||||
@@ -159,7 +159,7 @@ export const Expiring = () => {
|
||||
|
||||
<View
|
||||
style={{
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
width: "100%",
|
||||
borderBottomRightRadius: 10,
|
||||
borderBottomLeftRadius: 10
|
||||
|
||||
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
import React from "react";
|
||||
import { Text, View } from "react-native";
|
||||
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import Paragraph from "../ui/typography/paragraph";
|
||||
import { ProTag } from "./pro-tag";
|
||||
@@ -33,7 +33,7 @@ export const FeatureBlock = ({
|
||||
pro,
|
||||
proTagBg
|
||||
}) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
|
||||
return vertical ? (
|
||||
<View
|
||||
@@ -42,7 +42,7 @@ export const FeatureBlock = ({
|
||||
alignItems: "center",
|
||||
paddingHorizontal: 12,
|
||||
marginBottom: 10,
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
borderRadius: 10,
|
||||
paddingVertical: 12
|
||||
}}
|
||||
@@ -69,9 +69,9 @@ export const FeatureBlock = ({
|
||||
minWidth: 100
|
||||
}}
|
||||
>
|
||||
<Icon color={colors.icon} name={icon} size={SIZE.xl} />
|
||||
<Icon color={colors.primary.icon} name={icon} size={SIZE.xl} />
|
||||
<Paragraph size={SIZE.md}>
|
||||
<Text style={{ color: colors.accent }}>{highlight}</Text>
|
||||
<Text style={{ color: colors.primary.accent }}>{highlight}</Text>
|
||||
{content ? "\n" + content : null}
|
||||
</Paragraph>
|
||||
|
||||
@@ -87,7 +87,7 @@ export const FeatureBlock = ({
|
||||
height: 3,
|
||||
marginTop: 10,
|
||||
borderRadius: 100,
|
||||
backgroundColor: colors.accent
|
||||
backgroundColor: colors.primary.accent
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import React from "react";
|
||||
import { ScrollView, View } from "react-native";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import Heading from "../ui/typography/heading";
|
||||
import Paragraph from "../ui/typography/paragraph";
|
||||
@@ -27,20 +27,20 @@ import { FeatureBlock } from "./feature";
|
||||
import { ProTag } from "./pro-tag";
|
||||
|
||||
export const Group = ({ item, index }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
|
||||
return (
|
||||
<View
|
||||
style={{
|
||||
paddingHorizontal: 12,
|
||||
backgroundColor: index % 2 !== 0 ? colors.bg : colors.nav,
|
||||
backgroundColor: index % 2 !== 0 ? colors.primary.background : colors.secondary.background,
|
||||
paddingVertical: 40
|
||||
}}
|
||||
>
|
||||
{item?.pro ? (
|
||||
<ProTag
|
||||
size={SIZE.sm}
|
||||
background={index % 2 === 0 ? colors.bg : colors.nav}
|
||||
background={index % 2 === 0 ? colors.primary.background : colors.secondary.background}
|
||||
/>
|
||||
) : null}
|
||||
<Heading>{item.title}</Heading>
|
||||
@@ -60,7 +60,7 @@ export const Group = ({ item, index }) => {
|
||||
{...item}
|
||||
detail={item.detail}
|
||||
pro={item.pro}
|
||||
proTagBg={index % 2 === 0 ? colors.bg : colors.nav}
|
||||
proTagBg={index % 2 === 0 ? colors.primary.background : colors.secondary.background}
|
||||
/>
|
||||
))}
|
||||
</ScrollView>
|
||||
@@ -71,7 +71,7 @@ export const Group = ({ item, index }) => {
|
||||
marginTop: 10
|
||||
}}
|
||||
size={SIZE.xs}
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
>
|
||||
{item.info}
|
||||
</Paragraph>
|
||||
|
||||
@@ -71,7 +71,7 @@ class PremiumDialog extends React.Component {
|
||||
<BaseDialog
|
||||
animation="slide"
|
||||
bounce={false}
|
||||
background={this.props.colors.bg}
|
||||
background={this.props.colors.primary.background}
|
||||
onRequestClose={this.onClose}
|
||||
>
|
||||
<Component
|
||||
|
||||
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import React from "react";
|
||||
import { Text } from "react-native";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import Paragraph from "../ui/typography/paragraph";
|
||||
|
||||
@@ -28,7 +28,7 @@ export const Offer = ({
|
||||
text = "on yearly plan, offer ends soon",
|
||||
padding = 0
|
||||
}) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
|
||||
return (
|
||||
<Paragraph
|
||||
@@ -39,8 +39,8 @@ export const Offer = ({
|
||||
size={SIZE.xxxl}
|
||||
>
|
||||
GET {off}
|
||||
<Text style={{ color: colors.accent }}>%</Text> OFF!{"\n"}
|
||||
<Paragraph color={colors.icon}>{text}</Paragraph>
|
||||
<Text style={{ color: colors.primary.accent }}>%</Text> OFF!{"\n"}
|
||||
<Paragraph color={colors.secondary.paragraph}>{text}</Paragraph>
|
||||
</Paragraph>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -27,7 +27,7 @@ import {
|
||||
eSubscribeEvent,
|
||||
eUnSubscribeEvent
|
||||
} from "../../services/event-manager";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { getElevationStyle } from "../../utils/elevation";
|
||||
import {
|
||||
eCloseActionSheet,
|
||||
@@ -42,7 +42,7 @@ import Heading from "../ui/typography/heading";
|
||||
import Paragraph from "../ui/typography/paragraph";
|
||||
|
||||
export const PremiumToast = ({ context = "global", offset = 0 }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const [msg, setMsg] = useState(null);
|
||||
const timer = useRef();
|
||||
const keyboard = useKeyboard();
|
||||
@@ -92,7 +92,7 @@ export const PremiumToast = ({ context = "global", offset = 0 }) => {
|
||||
exiting={FadeOutUp}
|
||||
style={{
|
||||
position: "absolute",
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
zIndex: 999,
|
||||
...getElevationStyle(20),
|
||||
padding: 12,
|
||||
@@ -119,7 +119,7 @@ export const PremiumToast = ({ context = "global", offset = 0 }) => {
|
||||
style={{
|
||||
flexWrap: "wrap"
|
||||
}}
|
||||
color={colors.accent}
|
||||
color={colors.primary.accent}
|
||||
size={SIZE.md}
|
||||
>
|
||||
{msg.title}
|
||||
@@ -130,7 +130,7 @@ export const PremiumToast = ({ context = "global", offset = 0 }) => {
|
||||
flexWrap: "wrap"
|
||||
}}
|
||||
size={SIZE.sm}
|
||||
color={colors.pri}
|
||||
color={colors.primary.paragraph}
|
||||
>
|
||||
{msg.desc}
|
||||
</Paragraph>
|
||||
|
||||
@@ -28,7 +28,7 @@ import {
|
||||
ToastEvent
|
||||
} from "../../services/event-manager";
|
||||
import PremiumService from "../../services/premium";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { useUserStore } from "../../stores/use-user-store";
|
||||
import {
|
||||
eClosePremiumDialog,
|
||||
@@ -66,7 +66,7 @@ export const PricingPlans = ({
|
||||
heading = true,
|
||||
compact = false
|
||||
}) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const user = useUserStore((state) => state.user);
|
||||
const [product, setProduct] = useState(null);
|
||||
const [buying, setBuying] = useState(false);
|
||||
@@ -176,7 +176,7 @@ export const PricingPlans = ({
|
||||
height: 100
|
||||
}}
|
||||
>
|
||||
<ActivityIndicator color={colors.accent} size={25} />
|
||||
<ActivityIndicator color={colors.primary.accent} size={25} />
|
||||
</View>
|
||||
) : (
|
||||
<View
|
||||
@@ -251,7 +251,7 @@ export const PricingPlans = ({
|
||||
<Paragraph
|
||||
style={{
|
||||
textDecorationLine: "line-through",
|
||||
color: colors.icon
|
||||
color: colors.secondary.paragraph
|
||||
}}
|
||||
size={SIZE.sm}
|
||||
>
|
||||
@@ -273,7 +273,7 @@ export const PricingPlans = ({
|
||||
marginBottom: 20
|
||||
}}
|
||||
>
|
||||
<Heading color={colors.accent}>
|
||||
<Heading color={colors.primary.accent}>
|
||||
Get {monthlyPlan?.info?.discount}% off in{" "}
|
||||
{monthlyPlan?.info?.country}
|
||||
</Heading>
|
||||
@@ -455,7 +455,7 @@ export const PricingPlans = ({
|
||||
|
||||
{!user || !upgrade ? (
|
||||
<Paragraph
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
size={SIZE.xs}
|
||||
style={{
|
||||
alignSelf: "center",
|
||||
@@ -479,7 +479,7 @@ export const PricingPlans = ({
|
||||
<Paragraph
|
||||
textBreakStrategy="balanced"
|
||||
size={SIZE.xs}
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
style={{
|
||||
alignSelf: "center",
|
||||
marginTop: 10,
|
||||
@@ -493,7 +493,7 @@ export const PricingPlans = ({
|
||||
) : (
|
||||
<Paragraph
|
||||
size={SIZE.xs}
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
style={{
|
||||
alignSelf: "center",
|
||||
marginTop: 10,
|
||||
@@ -513,7 +513,7 @@ export const PricingPlans = ({
|
||||
>
|
||||
<Paragraph
|
||||
size={SIZE.xs}
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
style={{
|
||||
maxWidth: "100%",
|
||||
textAlign: "center"
|
||||
@@ -530,7 +530,7 @@ export const PricingPlans = ({
|
||||
style={{
|
||||
textDecorationLine: "underline"
|
||||
}}
|
||||
color={colors.accent}
|
||||
color={colors.primary.accent}
|
||||
>
|
||||
Terms of Service{" "}
|
||||
</Paragraph>
|
||||
@@ -545,7 +545,7 @@ export const PricingPlans = ({
|
||||
style={{
|
||||
textDecorationLine: "underline"
|
||||
}}
|
||||
color={colors.accent}
|
||||
color={colors.primary.accent}
|
||||
>
|
||||
Privacy Policy.
|
||||
</Paragraph>
|
||||
|
||||
@@ -20,16 +20,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
import React from "react";
|
||||
import { View } from "react-native";
|
||||
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import Paragraph from "../ui/typography/paragraph";
|
||||
|
||||
export const ProTag = ({ width, size, background }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
|
||||
return (
|
||||
<View
|
||||
style={{
|
||||
backgroundColor: background || colors.bg,
|
||||
backgroundColor: background || colors.primary.background,
|
||||
borderRadius: 100,
|
||||
width: width || 60,
|
||||
justifyContent: "center",
|
||||
@@ -43,10 +43,10 @@ export const ProTag = ({ width, size, background }) => {
|
||||
marginRight: 3
|
||||
}}
|
||||
size={size}
|
||||
color={colors.accent}
|
||||
color={colors.primary.accent}
|
||||
name="crown"
|
||||
/>
|
||||
<Paragraph size={size - 1.5} color={colors.accent}>
|
||||
<Paragraph size={size - 1.5} color={colors.primary.accent}>
|
||||
PRO
|
||||
</Paragraph>
|
||||
</View>
|
||||
|
||||
@@ -26,11 +26,14 @@ import { eSendEvent } from "../../services/event-manager";
|
||||
import Navigation from "../../services/navigation";
|
||||
import { useMenuStore } from "../../stores/use-menu-store";
|
||||
import { useSettingStore } from "../../stores/use-setting-store";
|
||||
import { COLORS_NOTE } from "../../utils/color-scheme";
|
||||
import { ColorValues } from "../../utils/colors";
|
||||
import { refreshNotesPage } from "../../utils/events";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import { PressableButton } from "../ui/pressable";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
|
||||
export const ColorTags = ({ item }) => {
|
||||
const { colors } = useThemeColors();
|
||||
const [note, setNote] = useState(item);
|
||||
const setColorNotes = useMenuStore((state) => state.setColorNotes);
|
||||
const isTablet = useSettingStore((state) => state.deviceMode) !== "mobile";
|
||||
@@ -50,13 +53,14 @@ export const ColorTags = ({ item }) => {
|
||||
const _renderColor = (c) => {
|
||||
const color = {
|
||||
name: c,
|
||||
value: COLORS_NOTE[c?.toLowerCase()]
|
||||
value: ColorValues[c?.toLowerCase()]
|
||||
};
|
||||
|
||||
return (
|
||||
<PressableButton
|
||||
type="accent"
|
||||
accentColor={color.name.toLowerCase()}
|
||||
accentColor={colors.static[color.name?.toLowerCase()]}
|
||||
accentText={colors.static.white}
|
||||
testID={notesnook.ids.dialogs.actionsheet.color(c)}
|
||||
key={color.value}
|
||||
onPress={() => changeColor(color)}
|
||||
@@ -88,7 +92,7 @@ export const ColorTags = ({ item }) => {
|
||||
justifyContent: isTablet ? "center" : "space-between"
|
||||
}}
|
||||
>
|
||||
{Object.keys(COLORS_NOTE).map(_renderColor)}
|
||||
{Object.keys(ColorValues).map(_renderColor)}
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -19,12 +19,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import React from "react";
|
||||
import { View } from "react-native";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import Paragraph from "../ui/typography/paragraph";
|
||||
import { getFormattedDate } from "@notesnook/common";
|
||||
export const DateMeta = ({ item }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
|
||||
const getNameFromKey = (key) => {
|
||||
switch (key) {
|
||||
@@ -62,10 +62,10 @@ export const DateMeta = ({ item }) => {
|
||||
paddingVertical: 3
|
||||
}}
|
||||
>
|
||||
<Paragraph size={SIZE.xs} color={colors.icon}>
|
||||
<Paragraph size={SIZE.xs} color={colors.secondary.paragraph}>
|
||||
{getNameFromKey(key)}
|
||||
</Paragraph>
|
||||
<Paragraph size={SIZE.xs} color={colors.icon}>
|
||||
<Paragraph size={SIZE.xs} color={colors.secondary.paragraph}>
|
||||
{getFormattedDate(item[key], "date-time")}
|
||||
</Paragraph>
|
||||
</View>
|
||||
@@ -74,6 +74,10 @@ export const DateMeta = ({ item }) => {
|
||||
return (
|
||||
<View
|
||||
style={{
|
||||
paddingVertical: 5,
|
||||
marginTop: 5,
|
||||
borderTopWidth: 1,
|
||||
borderTopColor: colors.secondary.background,
|
||||
paddingHorizontal: 12
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
/*
|
||||
This file is part of the Notesnook project (https://notesnook.com/)
|
||||
|
||||
Copyright (C) 2023 Streetwriters (Private) Limited
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import Clipboard from "@react-native-clipboard/clipboard";
|
||||
import React from "react";
|
||||
import { View } from "react-native";
|
||||
import { db } from "../../common/database";
|
||||
import { ToastEvent } from "../../services/event-manager";
|
||||
import { useSettingStore } from "../../stores/use-setting-store";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import { Button } from "../ui/button";
|
||||
export const DevMode = ({ item }) => {
|
||||
const devMode = useSettingStore((state) => state.settings.devMode);
|
||||
|
||||
return devMode ? (
|
||||
<View
|
||||
style={{
|
||||
width: "100%",
|
||||
paddingHorizontal: 12,
|
||||
marginTop: 10
|
||||
}}
|
||||
>
|
||||
<Button
|
||||
onPress={async () => {
|
||||
let additionalData = {};
|
||||
if (item.type === "note") {
|
||||
let content = await db.content.raw(item.contentId);
|
||||
if (content) {
|
||||
content = db.debug.strip(content);
|
||||
additionalData.content = content;
|
||||
}
|
||||
}
|
||||
additionalData.lastSynced = await db.lastSynced();
|
||||
let _note = { ...item };
|
||||
_note.additionalData = additionalData;
|
||||
Clipboard.setString(db.debug.strip(_note));
|
||||
|
||||
ToastEvent.show({
|
||||
heading: "Debug data copied!",
|
||||
type: "success",
|
||||
context: "local"
|
||||
});
|
||||
}}
|
||||
fontSize={SIZE.sm}
|
||||
title="Copy debug data"
|
||||
icon="clipboard"
|
||||
height={30}
|
||||
type="warn"
|
||||
style={{
|
||||
alignSelf: "flex-end"
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
) : null;
|
||||
};
|
||||
@@ -23,26 +23,25 @@ import { db } from "../../common/database";
|
||||
import { DDS } from "../../services/device-detection";
|
||||
import { presentSheet } from "../../services/event-manager";
|
||||
import SearchService from "../../services/search";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { COLORS_NOTE } from "../../utils/color-scheme";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { ColorValues } from "../../utils/colors";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import SheetProvider from "../sheet-provider";
|
||||
import { ReminderTime } from "../ui/reminder-time";
|
||||
import Heading from "../ui/typography/heading";
|
||||
import Paragraph from "../ui/typography/paragraph";
|
||||
import { DateMeta } from "./date-meta";
|
||||
import { DevMode } from "./dev-mode";
|
||||
import { Items } from "./items";
|
||||
import Notebooks from "./notebooks";
|
||||
import { Synced } from "./synced";
|
||||
import { Tags, TagStrip } from "./tags";
|
||||
const Line = ({ top = 6, bottom = 6 }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
return (
|
||||
<View
|
||||
style={{
|
||||
height: 1,
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.primary.border,
|
||||
width: "100%",
|
||||
marginTop: top,
|
||||
marginBottom: bottom
|
||||
@@ -52,9 +51,9 @@ const Line = ({ top = 6, bottom = 6 }) => {
|
||||
};
|
||||
|
||||
export const Properties = ({ close = () => {}, item, buttons = [] }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const alias = item.alias || item.title;
|
||||
const isColor = !!COLORS_NOTE[item.title];
|
||||
const isColor = !!ColorValues[item.title];
|
||||
|
||||
if (!item || !item.id) {
|
||||
return (
|
||||
@@ -68,7 +67,7 @@ export const Properties = ({ close = () => {}, item, buttons = [] }) => {
|
||||
keyboardShouldPersistTaps="always"
|
||||
keyboardDismissMode="none"
|
||||
style={{
|
||||
backgroundColor: colors.bg,
|
||||
backgroundColor: colors.primary.background,
|
||||
borderBottomRightRadius: DDS.isLargeTablet() ? 10 : 1,
|
||||
borderBottomLeftRadius: DDS.isLargeTablet() ? 10 : 1,
|
||||
maxHeight: "100%"
|
||||
@@ -81,12 +80,13 @@ export const Properties = ({ close = () => {}, item, buttons = [] }) => {
|
||||
style={{
|
||||
paddingHorizontal: 12,
|
||||
marginTop: 5,
|
||||
zIndex: 10
|
||||
zIndex: 10,
|
||||
marginBottom: 6
|
||||
}}
|
||||
>
|
||||
<Heading size={SIZE.lg}>
|
||||
{item.type === "tag" && !isColor ? (
|
||||
<Heading size={SIZE.xl} color={colors.accent}>
|
||||
<Heading size={SIZE.xl} color={colors.primary.accent}>
|
||||
#
|
||||
</Heading>
|
||||
) : null}
|
||||
@@ -112,7 +112,6 @@ export const Properties = ({ close = () => {}, item, buttons = [] }) => {
|
||||
/>
|
||||
) : null}
|
||||
</View>
|
||||
<Line top={12} />
|
||||
|
||||
<DateMeta item={item} />
|
||||
<Line bottom={0} />
|
||||
@@ -137,7 +136,6 @@ export const Properties = ({ close = () => {}, item, buttons = [] }) => {
|
||||
}}
|
||||
/>
|
||||
<Synced item={item} close={close} />
|
||||
<DevMode item={item} />
|
||||
|
||||
{DDS.isTab ? (
|
||||
<View
|
||||
|
||||
@@ -23,13 +23,13 @@ import Icon from "react-native-vector-icons/MaterialCommunityIcons";
|
||||
import { useActions } from "../../hooks/use-actions";
|
||||
import { DDS } from "../../services/device-detection";
|
||||
import { useSettingStore } from "../../stores/use-setting-store";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import { Button } from "../ui/button";
|
||||
import { PressableButton } from "../ui/pressable";
|
||||
import Paragraph from "../ui/typography/paragraph";
|
||||
export const Items = ({ item, buttons, close }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const dimensions = useSettingStore((state) => state.dimensions);
|
||||
const actions = useActions({ item, close });
|
||||
const data = actions.filter((i) => buttons.indexOf(i.id) > -1 && !i.hidden);
|
||||
@@ -70,10 +70,10 @@ export const Items = ({ item, buttons, close }) => {
|
||||
size={DDS.isTab ? SIZE.xxl : SIZE.lg}
|
||||
color={
|
||||
item.on
|
||||
? colors.accent
|
||||
? colors.primary.accent
|
||||
: item.id.match(/(delete|trash)/g)
|
||||
? colors.errorText
|
||||
: colors.icon
|
||||
? colors.error.icon
|
||||
: colors.secondary.icon
|
||||
}
|
||||
/>
|
||||
</PressableButton>
|
||||
@@ -89,10 +89,10 @@ export const Items = ({ item, buttons, close }) => {
|
||||
key={item.name + item.title}
|
||||
buttonType={{
|
||||
text: item.on
|
||||
? colors.accent
|
||||
? colors.primary.accent
|
||||
: item.name === "Delete" || item.name === "PermDelete"
|
||||
? colors.errorText
|
||||
: colors.pri
|
||||
? colors.error.paragraph
|
||||
: colors.primary.paragraph
|
||||
}}
|
||||
onPress={item.func}
|
||||
title={item.title}
|
||||
@@ -142,10 +142,10 @@ export const Items = ({ item, buttons, close }) => {
|
||||
size={DDS.isTab ? SIZE.xxl : SIZE.md + 4}
|
||||
color={
|
||||
item.on
|
||||
? colors.accent
|
||||
? colors.primary.accent
|
||||
: item.name === "Delete" || item.name === "PermDelete"
|
||||
? colors.errorText
|
||||
: colors.icon
|
||||
? colors.error.icon
|
||||
: colors.secondary.icon
|
||||
}
|
||||
/>
|
||||
</PressableButton>
|
||||
|
||||
@@ -30,14 +30,14 @@ import {
|
||||
} from "../../services/event-manager";
|
||||
import Navigation from "../../services/navigation";
|
||||
import { useNotebookStore } from "../../stores/use-notebook-store";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import { Button } from "../ui/button";
|
||||
import Heading from "../ui/typography/heading";
|
||||
import { eClearEditor } from "../../utils/events";
|
||||
|
||||
export default function Notebooks({ note, close, full }) {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const notebooks = useNotebookStore((state) => state.notebooks);
|
||||
function getNotebooks(item) {
|
||||
let filteredNotebooks = [];
|
||||
@@ -95,15 +95,15 @@ export default function Notebooks({ note, close, full }) {
|
||||
flexGrow: 1,
|
||||
padding: 6,
|
||||
borderWidth: full ? 0 : 1,
|
||||
borderColor: colors.nav,
|
||||
borderColor: colors.primary.background,
|
||||
borderRadius: 10,
|
||||
backgroundColor: full ? "transparent" : colors.nav,
|
||||
backgroundColor: full ? "transparent" : colors.secondary.background,
|
||||
minHeight: 42
|
||||
}}
|
||||
>
|
||||
<Icon
|
||||
name="book-outline"
|
||||
color={colors.accent}
|
||||
color={colors.primary.accent}
|
||||
size={SIZE.sm}
|
||||
style={{
|
||||
marginRight: 5
|
||||
@@ -130,7 +130,7 @@ export default function Notebooks({ note, close, full }) {
|
||||
style={{
|
||||
flexDirection: "row",
|
||||
marginLeft: 8,
|
||||
borderLeftColor: colors.nav,
|
||||
borderLeftColor: colors.primary.hover,
|
||||
borderLeftWidth: 1,
|
||||
paddingLeft: 8
|
||||
}}
|
||||
|
||||
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
import React from "react";
|
||||
import { View } from "react-native";
|
||||
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { useUserStore } from "../../stores/use-user-store";
|
||||
import { openLinkInBrowser } from "../../utils/functions";
|
||||
import { SIZE } from "../../utils/size";
|
||||
@@ -29,7 +29,7 @@ import { Button } from "../ui/button";
|
||||
import Heading from "../ui/typography/heading";
|
||||
import Paragraph from "../ui/typography/paragraph";
|
||||
export const Synced = ({ item, close }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const user = useUserStore((state) => state.user);
|
||||
const lastSynced = useUserStore((state) => state.lastSynced);
|
||||
|
||||
@@ -46,10 +46,10 @@ export const Synced = ({ item, close }) => {
|
||||
paddingTop: 10,
|
||||
marginTop: 10,
|
||||
borderTopWidth: 1,
|
||||
borderTopColor: colors.nav
|
||||
borderTopColor: colors.secondary.background
|
||||
}}
|
||||
>
|
||||
<Icon name="shield-key-outline" color={colors.accent} size={SIZE.xxxl} />
|
||||
<Icon name="shield-key-outline" color={colors.primary.accent} size={SIZE.xxxl} />
|
||||
|
||||
<View
|
||||
style={{
|
||||
@@ -59,7 +59,7 @@ export const Synced = ({ item, close }) => {
|
||||
}}
|
||||
>
|
||||
<Heading
|
||||
color={colors.heading}
|
||||
color={colors.primary.heading}
|
||||
size={SIZE.xs}
|
||||
style={{
|
||||
flexWrap: "wrap"
|
||||
@@ -72,7 +72,7 @@ export const Synced = ({ item, close }) => {
|
||||
flexWrap: "wrap"
|
||||
}}
|
||||
size={SIZE.xs}
|
||||
color={colors.pri}
|
||||
color={colors.primary.paragraph}
|
||||
>
|
||||
No one can view this {item.itemType || item.type} except you.
|
||||
</Paragraph>
|
||||
|
||||
@@ -21,14 +21,14 @@ import React from "react";
|
||||
import { View } from "react-native";
|
||||
import { db } from "../../common/database";
|
||||
import { TaggedNotes } from "../../screens/notes/tagged";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import { sleep } from "../../utils/time";
|
||||
import ManageTagsSheet from "../sheets/manage-tags";
|
||||
import { Button } from "../ui/button";
|
||||
import { ColorTags } from "./color-tags";
|
||||
export const Tags = ({ item, close }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
|
||||
return item.id ? (
|
||||
<View
|
||||
@@ -50,7 +50,7 @@ export const Tags = ({ item, close }) => {
|
||||
ManageTagsSheet.present([item]);
|
||||
}}
|
||||
buttonType={{
|
||||
text: colors.accent
|
||||
text: colors.primary.accent
|
||||
}}
|
||||
title="Add tags"
|
||||
type="grayBg"
|
||||
|
||||
@@ -34,7 +34,7 @@ export const Topics = ({ item, close }) => {
|
||||
title={topic.title}
|
||||
type="grayBg"
|
||||
// buttonType={{
|
||||
// text: colors.accent
|
||||
// text: colors.primary.accent
|
||||
// }}
|
||||
height={30}
|
||||
onPress={() => open(topic)}
|
||||
|
||||
@@ -26,7 +26,7 @@ import Navigation from "../../services/navigation";
|
||||
import SearchService from "../../services/search";
|
||||
import useNavigationStore from "../../stores/use-navigation-store";
|
||||
import { useSelectionStore } from "../../stores/use-selection-store";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { deleteItems } from "../../utils/functions";
|
||||
import { tabBarRef } from "../../utils/global-refs";
|
||||
import { SIZE } from "../../utils/size";
|
||||
@@ -39,7 +39,7 @@ import Heading from "../ui/typography/heading";
|
||||
import ManageTagsSheet from "../sheets/manage-tags";
|
||||
|
||||
export const SelectionHeader = React.memo(() => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const selectionMode = useSelectionStore((state) => state.selectionMode);
|
||||
const selectedItemsList = useSelectionStore(
|
||||
(state) => state.selectedItemsList
|
||||
@@ -131,7 +131,7 @@ export const SelectionHeader = React.memo(() => {
|
||||
width: "100%",
|
||||
height: Platform.OS === "android" ? 50 + insets.top : 50,
|
||||
paddingTop: Platform.OS === "android" ? insets.top : null,
|
||||
backgroundColor: colors.bg,
|
||||
backgroundColor: colors.primary.background,
|
||||
justifyContent: "space-between",
|
||||
alignItems: "center",
|
||||
flexDirection: "row",
|
||||
@@ -162,13 +162,13 @@ export const SelectionHeader = React.memo(() => {
|
||||
setSelectionMode(!selectionMode);
|
||||
}}
|
||||
size={SIZE.xl}
|
||||
color={colors.icon}
|
||||
color={colors.primary.icon}
|
||||
name="close"
|
||||
/>
|
||||
|
||||
<View
|
||||
style={{
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
height: 40,
|
||||
borderRadius: 100,
|
||||
paddingHorizontal: 16,
|
||||
@@ -177,7 +177,7 @@ export const SelectionHeader = React.memo(() => {
|
||||
alignItems: "center"
|
||||
}}
|
||||
>
|
||||
<Heading size={SIZE.md} color={colors.accent}>
|
||||
<Heading size={SIZE.md} color={colors.primary.accent}>
|
||||
{selectedItemsList.length}
|
||||
</Heading>
|
||||
</View>
|
||||
@@ -200,7 +200,7 @@ export const SelectionHeader = React.memo(() => {
|
||||
customStyle={{
|
||||
marginLeft: 10
|
||||
}}
|
||||
color={allSelected ? colors.accent : colors.pri}
|
||||
color={colors.primary.paragraph}
|
||||
name="select-all"
|
||||
size={SIZE.xl}
|
||||
/>
|
||||
@@ -218,7 +218,7 @@ export const SelectionHeader = React.memo(() => {
|
||||
customStyle={{
|
||||
marginLeft: 10
|
||||
}}
|
||||
color={colors.pri}
|
||||
color={colors.primary.icon}
|
||||
tooltipText="Manage tags"
|
||||
tooltipPosition={4}
|
||||
name="pound"
|
||||
@@ -233,9 +233,9 @@ export const SelectionHeader = React.memo(() => {
|
||||
customStyle={{
|
||||
marginLeft: 10
|
||||
}}
|
||||
color={colors.pri}
|
||||
tooltipText="Add to notebooks"
|
||||
tooltipPosition={4}
|
||||
color={colors.primary.paragraph}
|
||||
name="plus"
|
||||
size={SIZE.xl}
|
||||
/>
|
||||
@@ -249,7 +249,7 @@ export const SelectionHeader = React.memo(() => {
|
||||
customStyle={{
|
||||
marginLeft: 10
|
||||
}}
|
||||
color={colors.pri}
|
||||
color={colors.primary.paragraph}
|
||||
name="export"
|
||||
size={SIZE.xl}
|
||||
/>
|
||||
@@ -292,7 +292,7 @@ export const SelectionHeader = React.memo(() => {
|
||||
}`}
|
||||
tooltipPosition={4}
|
||||
testID="select-minus"
|
||||
color={colors.pri}
|
||||
color={colors.primary.paragraph}
|
||||
name="minus"
|
||||
size={SIZE.xl}
|
||||
/>
|
||||
@@ -306,7 +306,7 @@ export const SelectionHeader = React.memo(() => {
|
||||
}}
|
||||
tooltipText="Remove from favorites"
|
||||
tooltipPosition={4}
|
||||
color={colors.pri}
|
||||
color={colors.primary.paragraph}
|
||||
name="star-off"
|
||||
size={SIZE.xl}
|
||||
/>
|
||||
@@ -335,9 +335,9 @@ export const SelectionHeader = React.memo(() => {
|
||||
|
||||
return;
|
||||
}}
|
||||
color={colors.pri}
|
||||
tooltipText="Move to trash"
|
||||
tooltipPosition={1}
|
||||
color={colors.primary.paragraph}
|
||||
name="delete"
|
||||
size={SIZE.xl}
|
||||
/>
|
||||
@@ -349,7 +349,7 @@ export const SelectionHeader = React.memo(() => {
|
||||
customStyle={{
|
||||
marginLeft: 10
|
||||
}}
|
||||
color={colors.pri}
|
||||
color={colors.primary.paragraph}
|
||||
onPress={restoreItem}
|
||||
name="delete-restore"
|
||||
tooltipText="Restore"
|
||||
@@ -361,7 +361,7 @@ export const SelectionHeader = React.memo(() => {
|
||||
customStyle={{
|
||||
marginLeft: 10
|
||||
}}
|
||||
color={colors.pri}
|
||||
color={colors.primary.paragraph}
|
||||
onPress={deleteItem}
|
||||
tooltipText="Delete"
|
||||
tooltipPosition={4}
|
||||
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
eSubscribeEvent,
|
||||
eUnSubscribeEvent
|
||||
} from "../../services/event-manager";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { eCloseSheet, eOpenSheet } from "../../utils/events";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import { sleep } from "../../utils/time";
|
||||
@@ -34,7 +34,7 @@ import SheetWrapper from "../ui/sheet";
|
||||
import Heading from "../ui/typography/heading";
|
||||
import Paragraph from "../ui/typography/paragraph";
|
||||
const SheetProvider = ({ context = "global" }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [data, setData] = useState(null);
|
||||
const actionSheetRef = useRef();
|
||||
@@ -121,13 +121,13 @@ const SheetProvider = ({ context = "global" }) => {
|
||||
marginTop: 15
|
||||
}}
|
||||
size={50}
|
||||
color={colors.accent}
|
||||
color={colors.primary.accent}
|
||||
/>
|
||||
) : null}
|
||||
|
||||
{data?.icon ? (
|
||||
<Icon
|
||||
color={colors[data.iconColor] || colors.accent}
|
||||
color={colors[dialogData.iconColor] || colors.primary.accent}
|
||||
name={data.icon}
|
||||
size={50}
|
||||
/>
|
||||
@@ -193,7 +193,7 @@ const SheetProvider = ({ context = "global" }) => {
|
||||
onPress={data.action}
|
||||
key={data.actionText}
|
||||
title={data.actionText}
|
||||
accentColor={data.iconColor || "accent"}
|
||||
accentColor={data.iconColor}
|
||||
accentText="light"
|
||||
type="accent"
|
||||
height={40}
|
||||
@@ -229,10 +229,10 @@ const SheetProvider = ({ context = "global" }) => {
|
||||
}}
|
||||
size={SIZE.xs}
|
||||
onPress={data.learnMorePress}
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
>
|
||||
<Icon
|
||||
color={colors.icon}
|
||||
color={colors.primary.icon}
|
||||
name="information-outline"
|
||||
size={SIZE.xs}
|
||||
/>{" "}
|
||||
|
||||
@@ -354,7 +354,7 @@ export class AddNotebookSheet extends React.Component {
|
||||
refs[this.prevIndex].setNativeProps({
|
||||
text: value,
|
||||
style: {
|
||||
borderBottomColor: colors.accent
|
||||
borderBottomColor: colors.primary.accent
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -369,7 +369,9 @@ export class AddNotebookSheet extends React.Component {
|
||||
testID: "topic-add-button",
|
||||
icon: this.state.editTopic ? "check" : "plus",
|
||||
onPress: this.onSubmit,
|
||||
color: topicInputFocused ? colors.accent : colors.icon
|
||||
color: topicInputFocused
|
||||
? colors.primary.accent
|
||||
: colors.secondary.icon
|
||||
}}
|
||||
placeholder="Add a topic"
|
||||
/>
|
||||
@@ -413,7 +415,7 @@ const TopicItem = ({ item, index, colors, onPress, onDelete }) => {
|
||||
flexDirection: "row",
|
||||
justifyContent: "space-between",
|
||||
alignItems: "center",
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
borderRadius: 5,
|
||||
marginVertical: 5
|
||||
}}
|
||||
@@ -436,11 +438,11 @@ const TopicItem = ({ item, index, colors, onPress, onDelete }) => {
|
||||
style={[
|
||||
styles.topicInput,
|
||||
{
|
||||
color: colors.pri
|
||||
color: colors.primary.paragraph
|
||||
}
|
||||
]}
|
||||
defaultValue={item}
|
||||
placeholderTextColor={colors.placeholder}
|
||||
placeholderTextColor={colors.primary.placeholder}
|
||||
/>
|
||||
|
||||
<View
|
||||
@@ -459,7 +461,7 @@ const TopicItem = ({ item, index, colors, onPress, onDelete }) => {
|
||||
}}
|
||||
name="pencil"
|
||||
size={SIZE.lg - 5}
|
||||
color={colors.icon}
|
||||
color={colors.secondary.icon}
|
||||
/>
|
||||
<IconButton
|
||||
onPress={() => {
|
||||
@@ -467,7 +469,7 @@ const TopicItem = ({ item, index, colors, onPress, onDelete }) => {
|
||||
}}
|
||||
name="minus"
|
||||
size={SIZE.lg}
|
||||
color={colors.icon}
|
||||
color={colors.secondary.icon}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
@@ -31,8 +31,8 @@ import SearchService from "../../../services/search";
|
||||
import { useNotebookStore } from "../../../stores/use-notebook-store";
|
||||
import { useSelectionStore } from "../../../stores/use-selection-store";
|
||||
import { useSettingStore } from "../../../stores/use-setting-store";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { eOnTopicSheetUpdate } from "../../../utils/events";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { Dialog } from "../../dialog";
|
||||
import DialogHeader from "../../dialog/dialog-header";
|
||||
import { presentDialog } from "../../dialog/functions";
|
||||
@@ -45,7 +45,7 @@ import { useItemSelectionStore } from "./store";
|
||||
import { useRelationStore } from "../../../stores/use-relation-store";
|
||||
|
||||
const MoveNoteSheet = ({ note, actionSheetRef }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const notebooks = useNotebookStore((state) =>
|
||||
state.notebooks.filter((n) => n?.type === "notebook")
|
||||
);
|
||||
@@ -385,7 +385,11 @@ const MoveNoteSheet = ({ note, actionSheetRef }) => {
|
||||
alignItems: "center"
|
||||
}}
|
||||
>
|
||||
<Icon name="book-outline" color={colors.icon} size={100} />
|
||||
<Icon
|
||||
name="book-outline"
|
||||
color={colors.primary.icon}
|
||||
size={100}
|
||||
/>
|
||||
<Paragraph style={{ marginBottom: 10 }}>
|
||||
You do not have any notebooks.
|
||||
</Paragraph>
|
||||
@@ -431,7 +435,9 @@ const MoveNoteSheet = ({ note, actionSheetRef }) => {
|
||||
})}
|
||||
icon={(expanded) => ({
|
||||
name: expanded ? "chevron-up" : "chevron-down",
|
||||
color: expanded ? colors.accent : colors.pri
|
||||
color: expanded
|
||||
? colors.primary.accent
|
||||
: colors.primary.paragraph
|
||||
})}
|
||||
onScrollEnd={() => {
|
||||
actionSheetRef.current?.handleChildScrollEnd();
|
||||
|
||||
@@ -19,9 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import React, { useRef, useState } from "react";
|
||||
import { View } from "react-native";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import Input from "../../ui/input";
|
||||
import Paragraph from "../../ui/typography/paragraph";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
|
||||
export const ListHeaderInputItem = ({
|
||||
onSubmit,
|
||||
@@ -30,7 +30,8 @@ export const ListHeaderInputItem = ({
|
||||
testID
|
||||
}) => {
|
||||
const [focused, setFocused] = useState(false);
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors("sheet");
|
||||
|
||||
const [inputValue, setInputValue] = useState();
|
||||
const inputRef = useRef();
|
||||
return (
|
||||
@@ -57,7 +58,7 @@ export const ListHeaderInputItem = ({
|
||||
}}
|
||||
button={{
|
||||
icon: inputValue ? "plus" : "magnify",
|
||||
color: focused ? colors.accent : colors.icon,
|
||||
color: focused ? colors.selected.icon : colors.secondary.icon,
|
||||
onPress: async () => {
|
||||
const result = await onSubmit(inputValue);
|
||||
if (result) {
|
||||
@@ -71,13 +72,13 @@ export const ListHeaderInputItem = ({
|
||||
{inputValue ? (
|
||||
<View
|
||||
style={{
|
||||
backgroundColor: colors.shade,
|
||||
backgroundColor: colors.primary.shade,
|
||||
padding: 5,
|
||||
borderRadius: 5,
|
||||
marginBottom: 10
|
||||
}}
|
||||
>
|
||||
<Paragraph color={colors.accent}>
|
||||
<Paragraph color={colors.primary.accent}>
|
||||
Tap on + to add {`"${inputValue}"`}
|
||||
</Paragraph>
|
||||
</View>
|
||||
|
||||
@@ -17,11 +17,11 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { View } from "react-native";
|
||||
import { db } from "../../../common/database";
|
||||
import { useSelectionStore } from "../../../stores/use-selection-store";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { SIZE } from "../../../utils/size";
|
||||
import { IconButton } from "../../ui/icon-button";
|
||||
import { PressableButton } from "../../ui/pressable";
|
||||
@@ -44,7 +44,7 @@ const SelectionIndicator = ({
|
||||
const isSelected = itemState === "selected";
|
||||
const isIntermediate = itemState === "intermediate";
|
||||
const isRemoved = !isSelected && hasNotes;
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors("sheet");
|
||||
|
||||
useEffect(() => {
|
||||
onChange?.();
|
||||
@@ -61,10 +61,10 @@ const SelectionIndicator = ({
|
||||
}}
|
||||
color={
|
||||
isRemoved
|
||||
? colors.red
|
||||
? colors.static.red
|
||||
: isIntermediate || isSelected
|
||||
? colors.accent
|
||||
: colors.icon
|
||||
? colors.selected.icon
|
||||
: colors.primary.icon
|
||||
}
|
||||
onPress={() => {
|
||||
if (multiSelect) return selectItem();
|
||||
@@ -119,7 +119,7 @@ export const ListItem = ({
|
||||
const { toggleSelection } = useSelectionContext();
|
||||
const multiSelect = useItemSelectionStore((state) => state.multiSelect);
|
||||
const [showSelectedIndicator, setShowSelectedIndicator] = useState(false);
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors("sheet");
|
||||
const [expanded, setExpanded] = useState(false);
|
||||
|
||||
function selectItem() {
|
||||
@@ -209,7 +209,7 @@ export const ListItem = ({
|
||||
)}
|
||||
|
||||
{infoText ? (
|
||||
<Paragraph size={SIZE.xs} color={colors.icon}>
|
||||
<Paragraph size={SIZE.xs} color={colors.primary.icon}>
|
||||
{infoText}
|
||||
</Paragraph>
|
||||
) : null}
|
||||
@@ -225,7 +225,7 @@ export const ListItem = ({
|
||||
{showSelectedIndicator ? (
|
||||
<View
|
||||
style={{
|
||||
backgroundColor: colors.accent,
|
||||
backgroundColor: colors.primary.accent,
|
||||
width: 7,
|
||||
height: 7,
|
||||
borderRadius: 100,
|
||||
@@ -238,7 +238,7 @@ export const ListItem = ({
|
||||
<IconButton
|
||||
name={"plus"}
|
||||
testID="add-item-icon"
|
||||
color={colors.pri}
|
||||
color={colors.primary.paragraph}
|
||||
size={SIZE.xl}
|
||||
onPress={() => {
|
||||
onAddSublistItem(item);
|
||||
|
||||
@@ -27,7 +27,7 @@ import { db } from "../../../common/database";
|
||||
import { presentSheet, ToastEvent } from "../../../services/event-manager";
|
||||
import Exporter from "../../../services/exporter";
|
||||
import PremiumService from "../../../services/premium";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { useUserStore } from "../../../stores/use-user-store";
|
||||
import { getElevationStyle } from "../../../utils/elevation";
|
||||
import { ph, pv, SIZE } from "../../../utils/size";
|
||||
@@ -45,7 +45,7 @@ import { eCloseSheet } from "../../../utils/events";
|
||||
import { requestInAppReview } from "../../../services/app-review";
|
||||
|
||||
const ExportNotesSheet = ({ notes, update }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const [exporting, setExporting] = useState(false);
|
||||
const [complete, setComplete] = useState(false);
|
||||
const [result, setResult] = useState({});
|
||||
@@ -168,7 +168,7 @@ const ExportNotesSheet = ({ notes, update }) => {
|
||||
>
|
||||
<View
|
||||
style={{
|
||||
backgroundColor: colors.shade,
|
||||
backgroundColor: colors.primary.shade,
|
||||
borderRadius: 5,
|
||||
height: 60,
|
||||
width: 60,
|
||||
@@ -178,7 +178,7 @@ const ExportNotesSheet = ({ notes, update }) => {
|
||||
>
|
||||
<Icon
|
||||
name={item.icon}
|
||||
color={item.pro ? colors.accent : colors.icon}
|
||||
color={item.pro ? colors.primary.accent : colors.primary.icon}
|
||||
size={SIZE.xxxl + 10}
|
||||
/>
|
||||
</View>
|
||||
@@ -194,7 +194,7 @@ const ExportNotesSheet = ({ notes, update }) => {
|
||||
<Paragraph
|
||||
style={{ marginLeft: 10 }}
|
||||
size={SIZE.sm}
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
>
|
||||
{item.desc}
|
||||
</Paragraph>
|
||||
@@ -228,7 +228,7 @@ const ExportNotesSheet = ({ notes, update }) => {
|
||||
<>
|
||||
<IconButton
|
||||
name="export"
|
||||
color={colors.icon}
|
||||
color={colors.primary.icon}
|
||||
size={50}
|
||||
customStyle={{
|
||||
width: 70,
|
||||
@@ -240,7 +240,7 @@ const ExportNotesSheet = ({ notes, update }) => {
|
||||
textAlign: "center",
|
||||
marginTop: 10
|
||||
}}
|
||||
color={colors.icon}
|
||||
color={colors.secondary.heading}
|
||||
>
|
||||
{notes.length > 1
|
||||
? `${notes.length} Notes exported`
|
||||
|
||||
@@ -24,7 +24,7 @@ import { getVersion } from "react-native-device-info";
|
||||
import { db } from "../../../common/database";
|
||||
import { eSendEvent, ToastEvent } from "../../../services/event-manager";
|
||||
import PremiumService from "../../../services/premium";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { useUserStore } from "../../../stores/use-user-store";
|
||||
import { eCloseSheet } from "../../../utils/events";
|
||||
import { openLinkInBrowser } from "../../../utils/functions";
|
||||
@@ -36,7 +36,7 @@ import { Button } from "../../ui/button";
|
||||
import Seperator from "../../ui/seperator";
|
||||
import Paragraph from "../../ui/typography/paragraph";
|
||||
export const Issue = ({ defaultTitle, defaultBody, issueTitle }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const body = useRef(defaultBody);
|
||||
const title = useRef(defaultTitle);
|
||||
const user = useUserStore((state) => state.user);
|
||||
@@ -79,7 +79,7 @@ Logged in: ${user ? "yes" : "no"}`,
|
||||
<Text
|
||||
style={{
|
||||
textDecorationLine: "underline",
|
||||
color: colors.accent
|
||||
color: colors.primary.accent
|
||||
}}
|
||||
onPress={() => {
|
||||
Linking.openURL(issue_url);
|
||||
@@ -136,15 +136,15 @@ Logged in: ${user ? "yes" : "no"}`,
|
||||
defaultValue={title.current}
|
||||
style={{
|
||||
borderWidth: 1,
|
||||
borderColor: colors.nav,
|
||||
borderColor: colors.secondary.background,
|
||||
borderRadius: 5,
|
||||
padding: 12,
|
||||
fontFamily: "OpenSans-Regular",
|
||||
marginBottom: 10,
|
||||
fontSize: SIZE.md,
|
||||
color: colors.heading
|
||||
color: colors.primary.heading
|
||||
}}
|
||||
placeholderTextColor={colors.placeholder}
|
||||
placeholderTextColor={colors.primary.placeholder}
|
||||
/>
|
||||
|
||||
<TextInput
|
||||
@@ -173,20 +173,20 @@ For example:
|
||||
}}
|
||||
style={{
|
||||
borderWidth: 1,
|
||||
borderColor: colors.nav,
|
||||
borderColor: colors.secondary.background,
|
||||
borderRadius: 5,
|
||||
padding: 12,
|
||||
fontFamily: "OpenSans-Regular",
|
||||
maxHeight: 200,
|
||||
fontSize: SIZE.sm,
|
||||
marginBottom: 2.5,
|
||||
color: colors.pri
|
||||
color: colors.primary.paragraph
|
||||
}}
|
||||
placeholderTextColor={colors.placeholder}
|
||||
placeholderTextColor={colors.primary.placeholder}
|
||||
/>
|
||||
<Paragraph
|
||||
size={SIZE.xs}
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
>{`App version: ${getVersion()} Platform: ${Platform.OS} Model: ${
|
||||
Platform.constants.Brand
|
||||
}-${Platform.constants.Model}-${Platform.constants.Version}`}</Paragraph>
|
||||
@@ -201,7 +201,7 @@ For example:
|
||||
/>
|
||||
|
||||
<Paragraph
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
size={SIZE.xs}
|
||||
style={{
|
||||
marginTop: 10,
|
||||
@@ -215,7 +215,7 @@ For example:
|
||||
}}
|
||||
style={{
|
||||
textDecorationLine: "underline",
|
||||
color: colors.accent
|
||||
color: colors.primary.accent
|
||||
}}
|
||||
>
|
||||
github.com/streetwriters/notesnook.
|
||||
@@ -225,7 +225,7 @@ For example:
|
||||
<Text
|
||||
style={{
|
||||
textDecorationLine: "underline",
|
||||
color: colors.accent
|
||||
color: colors.primary.accent
|
||||
}}
|
||||
onPress={async () => {
|
||||
try {
|
||||
|
||||
@@ -25,7 +25,7 @@ import { db } from "../../../common/database";
|
||||
import { ToastEvent, presentSheet } from "../../../services/event-manager";
|
||||
import Navigation from "../../../services/navigation";
|
||||
import { useTagStore } from "../../../stores/use-tag-store";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { SIZE } from "../../../utils/size";
|
||||
import Input from "../../ui/input";
|
||||
import { PressableButton } from "../../ui/pressable";
|
||||
@@ -33,7 +33,7 @@ import Heading from "../../ui/typography/heading";
|
||||
import Paragraph from "../../ui/typography/paragraph";
|
||||
import { IconButton } from "../../ui/icon-button";
|
||||
const ManageTagsSheet = (props) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const [notes, setNotes] = useState(props.notes || []);
|
||||
const allTags = useTagStore((state) => state.tags);
|
||||
const [tags, setTags] = useState([]);
|
||||
@@ -128,7 +128,7 @@ const ManageTagsSheet = (props) => {
|
||||
<Input
|
||||
button={{
|
||||
icon: "magnify",
|
||||
color: colors.accent,
|
||||
color: colors.primary.accent,
|
||||
size: SIZE.lg
|
||||
}}
|
||||
testID="tag-input"
|
||||
@@ -163,12 +163,12 @@ const ManageTagsSheet = (props) => {
|
||||
padding: 12
|
||||
}}
|
||||
onPress={onSubmit}
|
||||
type="accent"
|
||||
type="selected"
|
||||
>
|
||||
<Heading size={SIZE.sm} color={colors.light}>
|
||||
<Heading size={SIZE.sm} color={colors.selected.heading}>
|
||||
Add {'"' + "#" + query + '"'}
|
||||
</Heading>
|
||||
<Icon name="plus" color={colors.light} size={SIZE.lg} />
|
||||
<Icon name="plus" color={colors.selected.icon} size={SIZE.lg} />
|
||||
</PressableButton>
|
||||
) : null}
|
||||
{!allTags || allTags.length === 0 ? (
|
||||
@@ -180,10 +180,13 @@ const ManageTagsSheet = (props) => {
|
||||
alignItems: "center"
|
||||
}}
|
||||
>
|
||||
<Heading size={50} color={colors.icon}>
|
||||
<Heading size={50} color={colors.secondary.heading}>
|
||||
#
|
||||
</Heading>
|
||||
<Paragraph textBreakStrategy="balanced" color={colors.icon}>
|
||||
<Paragraph
|
||||
textBreakStrategy="balanced"
|
||||
color={colors.secondary.paragraph}
|
||||
>
|
||||
You do not have any tags.
|
||||
</Paragraph>
|
||||
</View>
|
||||
@@ -213,7 +216,7 @@ ManageTagsSheet.present = (notes) => {
|
||||
export default ManageTagsSheet;
|
||||
|
||||
const TagItem = ({ tag, notes, setNotes }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const someNotesTagged = notes.some(
|
||||
(note) => note.tags?.indexOf(tag.title) !== -1
|
||||
);
|
||||
@@ -258,7 +261,11 @@ const TagItem = ({ tag, notes, setNotes }) => {
|
||||
width: 23,
|
||||
height: 23
|
||||
}}
|
||||
color={someNotesTagged || allNotesTagged ? colors.accent : colors.icon}
|
||||
color={
|
||||
someNotesTagged || allNotesTagged
|
||||
? colors.selected.icon
|
||||
: colors.primary.icon
|
||||
}
|
||||
testID={
|
||||
allNotesTagged
|
||||
? "check-circle-outline"
|
||||
|
||||
@@ -29,7 +29,7 @@ import {
|
||||
ToastEvent
|
||||
} from "../../../services/event-manager";
|
||||
import SettingsService from "../../../services/settings";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { eCloseSheet } from "../../../utils/events";
|
||||
import { sleep } from "../../../utils/time";
|
||||
import { Dialog } from "../../dialog";
|
||||
@@ -56,7 +56,7 @@ type Progress = {
|
||||
};
|
||||
|
||||
export default function Migrate() {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [error, _setError] = useState<Error>();
|
||||
const [reset, setReset] = useState(false);
|
||||
@@ -152,8 +152,8 @@ export default function Migrate() {
|
||||
animated={true}
|
||||
useNativeDriver
|
||||
indeterminate
|
||||
unfilledColor={colors.nav}
|
||||
color={colors.accent}
|
||||
unfilledColor={colors.secondary.background}
|
||||
color={colors.primary.accent}
|
||||
borderWidth={0}
|
||||
/>
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import {
|
||||
} from "../../../services/event-manager";
|
||||
import Navigation from "../../../services/navigation";
|
||||
import SearchService from "../../../services/search";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { eCloseSheet } from "../../../utils/events";
|
||||
import { SIZE } from "../../../utils/size";
|
||||
import { Dialog } from "../../dialog";
|
||||
@@ -60,7 +60,7 @@ export const MoveNotes = ({
|
||||
selectedTopic?: TopicType;
|
||||
fwdRef: RefObject<ActionSheetRef>;
|
||||
}) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const [currentNotebook, setCurrentNotebook] = useState(notebook);
|
||||
const { height } = useWindowDimensions();
|
||||
let notes = db.notes?.all as NoteType[];
|
||||
@@ -153,12 +153,20 @@ export const MoveNotes = ({
|
||||
>
|
||||
<Paragraph
|
||||
numberOfLines={1}
|
||||
color={item?.id === topic?.id ? colors.accent : colors.pri}
|
||||
color={
|
||||
item?.id === topic?.id
|
||||
? colors.primary.accent
|
||||
: colors.primary.paragraph
|
||||
}
|
||||
>
|
||||
{item.title}
|
||||
</Paragraph>
|
||||
{item.type == "note" && item.headline ? (
|
||||
<Paragraph numberOfLines={1} color={colors.icon} size={SIZE.xs}>
|
||||
<Paragraph
|
||||
numberOfLines={1}
|
||||
color={colors.secondary.paragraph}
|
||||
size={SIZE.xs}
|
||||
>
|
||||
{item.headline}
|
||||
</Paragraph>
|
||||
) : null}
|
||||
@@ -169,7 +177,7 @@ export const MoveNotes = ({
|
||||
style={{
|
||||
fontSize: SIZE.xs
|
||||
}}
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
>
|
||||
{item.notes?.length} Notes
|
||||
</Paragraph>
|
||||
@@ -183,14 +191,22 @@ export const MoveNotes = ({
|
||||
backgroundColor: "transparent"
|
||||
}}
|
||||
name="check"
|
||||
type="grayAccent"
|
||||
color={colors.accent}
|
||||
type="selected"
|
||||
color={colors.selected.icon}
|
||||
/>
|
||||
) : null}
|
||||
</PressableButton>
|
||||
);
|
||||
},
|
||||
[colors.accent, colors.icon, colors.pri, select, selectedNoteIds, topic]
|
||||
[
|
||||
colors.primary.accent,
|
||||
colors.secondary.paragraph,
|
||||
colors.primary.paragraph,
|
||||
colors.selected.icon,
|
||||
select,
|
||||
selectedNoteIds,
|
||||
topic
|
||||
]
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -241,7 +257,9 @@ export const MoveNotes = ({
|
||||
marginTop: 5
|
||||
}}
|
||||
>
|
||||
<Paragraph color={colors.accent}>in {topic.title}</Paragraph>
|
||||
<Paragraph color={colors.selected.paragraph}>
|
||||
in {topic.title}
|
||||
</Paragraph>
|
||||
|
||||
<Paragraph
|
||||
style={{
|
||||
@@ -273,7 +291,7 @@ export const MoveNotes = ({
|
||||
alignItems: "center"
|
||||
}}
|
||||
>
|
||||
<Paragraph color={colors.icon}>
|
||||
<Paragraph color={colors.secondary.paragraph}>
|
||||
{topic ? "No notes to show" : "No topics in this notebook"}
|
||||
</Paragraph>
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import { getVersion } from "react-native-device-info";
|
||||
import { features } from "../../../features";
|
||||
import { eSendEvent, presentSheet } from "../../../services/event-manager";
|
||||
import SettingsService from "../../../services/settings";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { eCloseSheet } from "../../../utils/events";
|
||||
import { SIZE } from "../../../utils/size";
|
||||
import { Button } from "../../ui/button";
|
||||
@@ -37,7 +37,7 @@ export type FeatureType = {
|
||||
};
|
||||
|
||||
const NewFeature = ({ features }: { features: FeatureType[] }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
|
||||
return (
|
||||
<View
|
||||
@@ -47,7 +47,7 @@ const NewFeature = ({ features }: { features: FeatureType[] }) => {
|
||||
paddingTop: 12
|
||||
}}
|
||||
>
|
||||
<Heading color={colors.icon} size={SIZE.md}>
|
||||
<Heading color={colors.secondary.heading} size={SIZE.md}>
|
||||
New Version Highlights 🎉
|
||||
</Heading>
|
||||
|
||||
@@ -57,7 +57,7 @@ const NewFeature = ({ features }: { features: FeatureType[] }) => {
|
||||
<View
|
||||
key={item.title}
|
||||
style={{
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
padding: 12,
|
||||
borderRadius: 10,
|
||||
width: "100%",
|
||||
|
||||
@@ -21,14 +21,14 @@ import React, { useEffect, useState } from "react";
|
||||
import { View } from "react-native";
|
||||
import useSyncProgress from "../../../hooks/use-sync-progress";
|
||||
import { presentSheet } from "../../../services/event-manager";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { SIZE } from "../../../utils/size";
|
||||
import Seperator from "../../ui/seperator";
|
||||
import { ProgressBarComponent } from "../../ui/svg/lazy";
|
||||
import Heading from "../../ui/typography/heading";
|
||||
import Paragraph from "../../ui/typography/paragraph";
|
||||
export const Progress = () => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const { progress } = useSyncProgress();
|
||||
const [currentProgress, setCurrentProgress] = useState(0.1);
|
||||
|
||||
@@ -65,14 +65,14 @@ export const Progress = () => {
|
||||
animated={true}
|
||||
useNativeDriver
|
||||
progress={currentProgress || 0.1}
|
||||
unfilledColor={colors.nav}
|
||||
color={colors.accent}
|
||||
unfilledColor={colors.secondary.background}
|
||||
color={colors.primary.accent}
|
||||
borderWidth={0}
|
||||
/>
|
||||
</View>
|
||||
|
||||
{progress ? (
|
||||
<Paragraph color={colors.icon}>
|
||||
<Paragraph color={colors.secondary.paragraph}>
|
||||
{progress.type?.slice(0, 1).toUpperCase() + progress.type?.slice(1)}
|
||||
ing {progress?.current}/{progress?.total}
|
||||
</Paragraph>
|
||||
|
||||
@@ -25,7 +25,7 @@ import { db } from "../../../common/database";
|
||||
import { presentSheet, ToastEvent } from "../../../services/event-manager";
|
||||
import Navigation from "../../../services/navigation";
|
||||
import { useAttachmentStore } from "../../../stores/use-attachment-store";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { openLinkInBrowser } from "../../../utils/functions";
|
||||
import { SIZE } from "../../../utils/size";
|
||||
import DialogHeader from "../../dialog/dialog-header";
|
||||
@@ -38,7 +38,7 @@ import Paragraph from "../../ui/typography/paragraph";
|
||||
import { requestInAppReview } from "../../../services/app-review";
|
||||
|
||||
const PublishNoteSheet = ({ note: item, update }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const actionSheetRef = useRef();
|
||||
const loading = useAttachmentStore((state) => state.loading);
|
||||
const [selfDestruct, setSelfDestruct] = useState(false);
|
||||
@@ -130,7 +130,7 @@ const PublishNoteSheet = ({ note: item, update }) => {
|
||||
width: "100%"
|
||||
}}
|
||||
>
|
||||
<ActivityIndicator size={25} color={colors.accent} />
|
||||
<ActivityIndicator size={25} color={colors.primary.accent} />
|
||||
<Paragraph
|
||||
style={{
|
||||
textAlign: "center"
|
||||
@@ -152,7 +152,7 @@ const PublishNoteSheet = ({ note: item, update }) => {
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
marginTop: 10,
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
padding: 12,
|
||||
borderRadius: 5
|
||||
}}
|
||||
@@ -170,7 +170,10 @@ const PublishNoteSheet = ({ note: item, update }) => {
|
||||
<Paragraph
|
||||
onPress={async () => {
|
||||
try {
|
||||
await openLinkInBrowser(publishUrl, colors.accent);
|
||||
await openLinkInBrowser(
|
||||
publishUrl,
|
||||
colors.primary.accent
|
||||
);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
@@ -178,11 +181,11 @@ const PublishNoteSheet = ({ note: item, update }) => {
|
||||
size={SIZE.xs}
|
||||
style={{
|
||||
marginTop: 5,
|
||||
color: colors.pri
|
||||
color: colors.primary.paragraph
|
||||
}}
|
||||
>
|
||||
<Icon color={colors.accent} name="open-in-new" /> Open in
|
||||
browser
|
||||
<Icon color={colors.primary.accent} name="open-in-new" /> Open
|
||||
in browser
|
||||
</Paragraph>
|
||||
</View>
|
||||
|
||||
@@ -195,7 +198,7 @@ const PublishNoteSheet = ({ note: item, update }) => {
|
||||
context: "local"
|
||||
});
|
||||
}}
|
||||
color={colors.accent}
|
||||
color={colors.primary.accent}
|
||||
size={SIZE.lg}
|
||||
name="content-copy"
|
||||
/>
|
||||
@@ -212,7 +215,7 @@ const PublishNoteSheet = ({ note: item, update }) => {
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
marginBottom: 10,
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
paddingVertical: 12,
|
||||
borderRadius: 5,
|
||||
marginTop: 10
|
||||
@@ -223,7 +226,7 @@ const PublishNoteSheet = ({ note: item, update }) => {
|
||||
if (publishing) return;
|
||||
setIsLocked(!isLocked);
|
||||
}}
|
||||
color={isLocked ? colors.accent : colors.icon}
|
||||
color={isLocked ? colors.selected.icon : colors.primary.icon}
|
||||
size={SIZE.xl}
|
||||
name={
|
||||
isLocked
|
||||
@@ -253,7 +256,7 @@ const PublishNoteSheet = ({ note: item, update }) => {
|
||||
style={{
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
paddingVertical: 12,
|
||||
borderRadius: 5
|
||||
}}
|
||||
@@ -262,7 +265,7 @@ const PublishNoteSheet = ({ note: item, update }) => {
|
||||
onPress={() => {
|
||||
setSelfDestruct(!selfDestruct);
|
||||
}}
|
||||
color={selfDestruct ? colors.accent : colors.icon}
|
||||
color={selfDestruct ? colors.selected.icon : colors.primary.icon}
|
||||
size={SIZE.xl}
|
||||
name={
|
||||
selfDestruct
|
||||
@@ -343,7 +346,7 @@ const PublishNoteSheet = ({ note: item, update }) => {
|
||||
)}
|
||||
|
||||
<Paragraph
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
size={SIZE.xs}
|
||||
style={{
|
||||
textAlign: "center",
|
||||
@@ -354,7 +357,7 @@ const PublishNoteSheet = ({ note: item, update }) => {
|
||||
try {
|
||||
await openLinkInBrowser(
|
||||
"https://docs.notesnook.com/monographs/",
|
||||
colors.accent
|
||||
colors.primary.accent
|
||||
);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
|
||||
@@ -220,7 +220,7 @@ class RecoveryKeySheet extends React.Component {
|
||||
<View
|
||||
style={{
|
||||
width: "100%",
|
||||
backgroundColor: colors.bg,
|
||||
backgroundColor: colors.primary.background,
|
||||
justifyContent: "space-between",
|
||||
paddingHorizontal: 12,
|
||||
borderRadius: 10,
|
||||
@@ -241,7 +241,7 @@ class RecoveryKeySheet extends React.Component {
|
||||
}}
|
||||
>
|
||||
<Paragraph
|
||||
color={colors.pri}
|
||||
color={colors.primary.paragraph}
|
||||
size={SIZE.sm}
|
||||
numberOfLines={2}
|
||||
selectable
|
||||
@@ -327,7 +327,7 @@ class RecoveryKeySheet extends React.Component {
|
||||
<Seperator />
|
||||
|
||||
<Paragraph
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
size={SIZE.sm}
|
||||
numberOfLines={2}
|
||||
style={{
|
||||
|
||||
@@ -28,7 +28,7 @@ import {
|
||||
} from "../../../services/event-manager";
|
||||
import { Reminder } from "../../../services/notifications";
|
||||
import { useRelationStore } from "../../../stores/use-relation-store";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { SIZE } from "../../../utils/size";
|
||||
import DialogHeader from "../../dialog/dialog-header";
|
||||
import List from "../../list";
|
||||
@@ -71,17 +71,16 @@ export const RelationsList = ({
|
||||
onAdd
|
||||
}: RelationsListProps) => {
|
||||
const updater = useRelationStore((state) => state.updater);
|
||||
const [items, setItems] = useState<Reminder[]>([]);
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
|
||||
const items =
|
||||
(db.relations?.[relationType]?.(
|
||||
{ id: item?.id, type: item?.type },
|
||||
referenceType
|
||||
) as any) || [];
|
||||
|
||||
const hasNoRelations = !items || items.length === 0;
|
||||
useEffect(() => {
|
||||
setItems(
|
||||
db.relations?.[relationType]?.(
|
||||
{ id: item?.id, type: item.type },
|
||||
referenceType
|
||||
) as any
|
||||
);
|
||||
}, [item?.id, item?.type, referenceType, relationType, updater]);
|
||||
|
||||
return (
|
||||
<View
|
||||
style={{ paddingHorizontal: 12, height: hasNoRelations ? 300 : "100%" }}
|
||||
@@ -102,7 +101,7 @@ export const RelationsList = ({
|
||||
<Icon
|
||||
name={IconsByType[referenceType as keyof typeof IconsByType]}
|
||||
size={60}
|
||||
color={colors.icon}
|
||||
color={colors.primary.icon}
|
||||
/>
|
||||
<Paragraph>
|
||||
No {referenceType}s linked to this {item.type}.
|
||||
|
||||
@@ -27,7 +27,7 @@ import {
|
||||
PresentSheetOptions
|
||||
} from "../../../services/event-manager";
|
||||
import Notifications, { Reminder } from "../../../services/notifications";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { SIZE } from "../../../utils/size";
|
||||
import { ItemReference } from "../../../utils/types";
|
||||
import List from "../../list";
|
||||
@@ -47,7 +47,7 @@ export default function ReminderNotify({
|
||||
update,
|
||||
reminder
|
||||
}: ReminderSheetProps) {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const references = db.relations?.to(reminder as ItemReference, "note") || [];
|
||||
|
||||
const QuickActions = [
|
||||
@@ -101,7 +101,7 @@ export default function ReminderNotify({
|
||||
alignItems: "center"
|
||||
}}
|
||||
>
|
||||
<Icon name="bell" size={20} color={colors.accent} />
|
||||
<Icon name="bell" size={20} color={colors.primary.accent} />
|
||||
<Paragraph style={{ marginLeft: 5 }}>
|
||||
{dayjs(reminder?.date).format("ddd, YYYY-MM-DD hh:mm A")}
|
||||
</Paragraph>
|
||||
@@ -142,14 +142,14 @@ export default function ReminderNotify({
|
||||
height:
|
||||
160 * references?.length < 500 ? 160 * references?.length : 500,
|
||||
borderTopWidth: 1,
|
||||
borderTopColor: colors.nav,
|
||||
borderTopColor: colors.secondary.background,
|
||||
marginTop: 5,
|
||||
paddingTop: 5
|
||||
}}
|
||||
>
|
||||
<Paragraph
|
||||
style={{
|
||||
color: colors.icon,
|
||||
color: colors.secondary.paragraph,
|
||||
fontSize: SIZE.xs,
|
||||
marginBottom: 10
|
||||
}}
|
||||
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
ToastEvent,
|
||||
presentSheet
|
||||
} from "../../../services/event-manager";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { SIZE } from "../../../utils/size";
|
||||
import { Button } from "../../ui/button";
|
||||
import Input from "../../ui/input";
|
||||
@@ -95,7 +95,7 @@ export default function ReminderSheet({
|
||||
reminder,
|
||||
reference
|
||||
}: ReminderSheetProps) {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors, isDark } = useThemeColors();
|
||||
const [reminderMode, setReminderMode] = useState<Reminder["mode"]>(
|
||||
reminder?.mode || "once"
|
||||
);
|
||||
@@ -299,7 +299,7 @@ export default function ReminderSheet({
|
||||
type={
|
||||
reminderMode ===
|
||||
ReminderModes[mode as keyof typeof ReminderModes]
|
||||
? "grayAccent"
|
||||
? "selected"
|
||||
: "gray"
|
||||
}
|
||||
onPress={() => {
|
||||
@@ -327,7 +327,7 @@ export default function ReminderSheet({
|
||||
{reminderMode === ReminderModes.Repeat ? (
|
||||
<View
|
||||
style={{
|
||||
backgroundColor: colors.nav,
|
||||
backgroundColor: colors.secondary.background,
|
||||
padding: 12,
|
||||
borderRadius: 5,
|
||||
marginBottom: 12
|
||||
@@ -391,8 +391,8 @@ export default function ReminderSheet({
|
||||
marginRight: 10,
|
||||
backgroundColor:
|
||||
selectedDays.indexOf(index) > -1
|
||||
? colors.accent
|
||||
: colors.bg
|
||||
? colors.primary.accent
|
||||
: colors.primary.background
|
||||
}}
|
||||
onPress={() => {
|
||||
setSelectedDays((days) => {
|
||||
@@ -421,8 +421,8 @@ export default function ReminderSheet({
|
||||
marginRight: 10,
|
||||
backgroundColor:
|
||||
selectedDays.indexOf(index + 1) > -1
|
||||
? colors.accent
|
||||
: colors.bg
|
||||
? colors.primary.accent
|
||||
: colors.primary.background
|
||||
}}
|
||||
onPress={() => {
|
||||
setSelectedDays((days) => {
|
||||
@@ -463,9 +463,9 @@ export default function ReminderSheet({
|
||||
date={date}
|
||||
maximumDate={dayjs(date).add(3, "months").toDate()}
|
||||
onDateChange={handleConfirm}
|
||||
textColor={colors.night ? "#ffffff" : "#000000"}
|
||||
fadeToColor={colors.bg}
|
||||
theme={colors.night ? "dark" : "light"}
|
||||
textColor={isDark ? colors.static.white : colors.static.black}
|
||||
fadeToColor={colors.primary.background}
|
||||
theme={isDark ? "dark" : "light"}
|
||||
androidVariant="nativeAndroid"
|
||||
is24hourSource="locale"
|
||||
locale={
|
||||
@@ -500,7 +500,7 @@ export default function ReminderSheet({
|
||||
marginBottom: 12,
|
||||
paddingTop: 12,
|
||||
borderTopWidth: 1,
|
||||
borderTopColor: colors.nav
|
||||
borderTopColor: colors.secondary.background
|
||||
}}
|
||||
>
|
||||
{Object.keys(ReminderNotificationModes).map((mode) => (
|
||||
@@ -551,11 +551,11 @@ export default function ReminderSheet({
|
||||
alignItems: "center",
|
||||
justifyContent: "flex-start",
|
||||
marginBottom: 10,
|
||||
backgroundColor: colors.nav
|
||||
backgroundColor: colors.secondary.background
|
||||
}}
|
||||
>
|
||||
<>
|
||||
<Paragraph size={SIZE.xs} color={colors.icon}>
|
||||
<Paragraph size={SIZE.xs} color={colors.secondary.paragraph}>
|
||||
{recurringMode === RecurringModes.Daily
|
||||
? "Repeats daily " + `at ${dayjs(date).format("hh:mm A")}.`
|
||||
: selectedDays.length === 7 &&
|
||||
|
||||
@@ -33,7 +33,7 @@ import {
|
||||
} from "../../../services/event-manager";
|
||||
import SettingsService from "../../../services/settings";
|
||||
import { initialize } from "../../../stores";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { eCloseRestoreDialog, eOpenRestoreDialog } from "../../../utils/events";
|
||||
import { SIZE } from "../../../utils/size";
|
||||
import { Dialog } from "../../dialog";
|
||||
@@ -109,7 +109,7 @@ const RestoreDataSheet = () => {
|
||||
export default RestoreDataSheet;
|
||||
|
||||
const RestoreDataComponent = ({ close, setRestoring, restoring }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const [files, setFiles] = useState([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [backupDirectoryAndroid, setBackupDirectoryAndroid] = useState(false);
|
||||
@@ -242,7 +242,7 @@ const RestoreDataComponent = ({ close, setRestoring, restoring }) => {
|
||||
borderRadius: 0,
|
||||
flexDirection: "row",
|
||||
borderBottomWidth: 0.5,
|
||||
borderBottomColor: colors.nav
|
||||
borderBottomColor: colors.secondary.background
|
||||
}}
|
||||
>
|
||||
<View
|
||||
@@ -377,7 +377,7 @@ const RestoreDataComponent = ({ close, setRestoring, restoring }) => {
|
||||
height: 100
|
||||
}}
|
||||
>
|
||||
<ActivityIndicator color={colors.accent} size={SIZE.lg} />
|
||||
<ActivityIndicator color={colors.primary.accent} size={SIZE.lg} />
|
||||
</View>
|
||||
) : (
|
||||
<View
|
||||
@@ -427,14 +427,14 @@ const RestoreDataComponent = ({ close, setRestoring, restoring }) => {
|
||||
}}
|
||||
size={SIZE.xs}
|
||||
textBreakStrategy="balanced"
|
||||
color={colors.icon}
|
||||
color={colors.secondary.paragraph}
|
||||
>
|
||||
Select the folder that includes your backup files to
|
||||
list them here.
|
||||
</Paragraph>
|
||||
</>
|
||||
) : (
|
||||
<Paragraph color={colors.icon}>No backups found</Paragraph>
|
||||
<Paragraph color={colors.secondary.paragraph}>No backups found</Paragraph>
|
||||
)}
|
||||
</View>
|
||||
)
|
||||
@@ -446,8 +446,8 @@ const RestoreDataComponent = ({ close, setRestoring, restoring }) => {
|
||||
height: 200
|
||||
}}
|
||||
>
|
||||
<ActivityIndicator color={colors.accent} />
|
||||
<Paragraph color={colors.icon}>
|
||||
<ActivityIndicator color={colors.primary.accent} />
|
||||
<Paragraph color={colors.secondary.paragraph}>
|
||||
Restoring {progress ? progress?.collection : null}
|
||||
{progress ? `(${progress.current}/${progress.total}) ` : null}
|
||||
...Please wait.
|
||||
|
||||
@@ -22,7 +22,7 @@ import { View } from "react-native";
|
||||
import { db } from "../../../common/database";
|
||||
import { eSendEvent } from "../../../services/event-manager";
|
||||
import Navigation from "../../../services/navigation";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { GROUP, SORT } from "../../../utils/constants";
|
||||
import { refreshNotesPage } from "../../../utils/events";
|
||||
import { SIZE } from "../../../utils/size";
|
||||
@@ -30,8 +30,8 @@ import { Button } from "../../ui/button";
|
||||
import Seperator from "../../ui/seperator";
|
||||
import Heading from "../../ui/typography/heading";
|
||||
const Sort = ({ type, screen }) => {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const isTopicSheet = screen === "TopicSheet";
|
||||
const { colors } = useThemeColors();
|
||||
const [groupOptions, setGroupOptions] = useState(
|
||||
db.settings.getGroupOptions(type)
|
||||
);
|
||||
@@ -61,7 +61,7 @@ const Sort = ({ type, screen }) => {
|
||||
<View
|
||||
style={{
|
||||
width: "100%",
|
||||
backgroundColor: colors.bg,
|
||||
backgroundColor: colors.primary.background,
|
||||
justifyContent: "space-between"
|
||||
}}
|
||||
>
|
||||
@@ -104,7 +104,7 @@ const Sort = ({ type, screen }) => {
|
||||
fontSize={SIZE.sm - 1}
|
||||
type="transparent"
|
||||
buttonType={{
|
||||
text: colors.accent
|
||||
text: colors.primary.accent
|
||||
}}
|
||||
style={{
|
||||
borderRadius: 100,
|
||||
@@ -122,7 +122,7 @@ const Sort = ({ type, screen }) => {
|
||||
justifyContent: "flex-start",
|
||||
flexWrap: "wrap",
|
||||
borderBottomWidth: isTopicSheet ? 0 : 1,
|
||||
borderBottomColor: colors.nav,
|
||||
borderBottomColor: colors.secondary.background,
|
||||
marginBottom: 12,
|
||||
paddingHorizontal: 12,
|
||||
paddingBottom: 12,
|
||||
@@ -136,7 +136,7 @@ const Sort = ({ type, screen }) => {
|
||||
height={40}
|
||||
iconPosition="left"
|
||||
icon={"check"}
|
||||
buttonType={{ text: colors.accent }}
|
||||
buttonType={{ text: colors.primary.accent }}
|
||||
fontSize={SIZE.sm}
|
||||
iconSize={SIZE.md}
|
||||
/>
|
||||
@@ -149,7 +149,7 @@ const Sort = ({ type, screen }) => {
|
||||
item === "dateEdited") ? null : (
|
||||
<Button
|
||||
key={item}
|
||||
type={groupOptions.sortBy === item ? "grayBg" : "gray"}
|
||||
type={groupOptions.sortBy === item ? "selected" : "gray"}
|
||||
title={SORT[item]}
|
||||
height={40}
|
||||
iconPosition="left"
|
||||
@@ -160,7 +160,9 @@ const Sort = ({ type, screen }) => {
|
||||
}}
|
||||
buttonType={{
|
||||
text:
|
||||
groupOptions.sortBy === item ? colors.accent : colors.icon
|
||||
groupOptions.sortBy === item
|
||||
? colors.primary.accent
|
||||
: colors.secondary.paragraph
|
||||
}}
|
||||
fontSize={SIZE.sm}
|
||||
onPress={async () => {
|
||||
@@ -205,12 +207,14 @@ const Sort = ({ type, screen }) => {
|
||||
<Button
|
||||
key={item}
|
||||
testID={"btn-" + item}
|
||||
type={groupOptions.groupBy === GROUP[item] ? "grayBg" : "gray"}
|
||||
type={
|
||||
groupOptions.groupBy === GROUP[item] ? "selected" : "gray"
|
||||
}
|
||||
buttonType={{
|
||||
text:
|
||||
groupOptions.groupBy === GROUP[item]
|
||||
? colors.accent
|
||||
: colors.icon
|
||||
? colors.primary.accent
|
||||
: colors.secondary.paragraph
|
||||
}}
|
||||
onPress={async () => {
|
||||
let _groupOptions = {
|
||||
|
||||
@@ -45,7 +45,7 @@ import {
|
||||
import useNavigationStore, {
|
||||
NotebookScreenParams
|
||||
} from "../../../stores/use-navigation-store";
|
||||
import { useThemeStore } from "../../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import {
|
||||
eOnNewTopicAdded,
|
||||
eOnTopicSheetUpdate,
|
||||
@@ -98,7 +98,7 @@ export const TopicsSheet = () => {
|
||||
);
|
||||
const [selection, setSelection] = useState<TopicType[]>([]);
|
||||
const [enabled, setEnabled] = useState(false);
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors("sheet");
|
||||
const ref = useRef<ActionSheetRef>(null);
|
||||
const isTopic = currentScreen.name === "TopicNotes";
|
||||
const [topics, setTopics] = useState(
|
||||
@@ -245,9 +245,9 @@ export const TopicsSheet = () => {
|
||||
maxHeight: 300,
|
||||
borderTopRightRadius: 15,
|
||||
borderTopLeftRadius: 15,
|
||||
backgroundColor: colors.bg,
|
||||
backgroundColor: colors.primary.background,
|
||||
borderWidth: 1,
|
||||
borderColor: colors.nav,
|
||||
borderColor: colors.primary.border,
|
||||
borderBottomWidth: 0
|
||||
}}
|
||||
openAnimationConfig={{
|
||||
@@ -267,7 +267,7 @@ export const TopicsSheet = () => {
|
||||
elevation={10}
|
||||
indicatorStyle={{
|
||||
width: 100,
|
||||
backgroundColor: colors.nav
|
||||
backgroundColor: colors.secondary.background
|
||||
}}
|
||||
keyboardHandlerEnabled={false}
|
||||
snapPoints={Config.isTesting === "true" ? [100] : [25, 100]}
|
||||
@@ -285,8 +285,6 @@ export const TopicsSheet = () => {
|
||||
<PressableButton
|
||||
testID={notesnook.buttons.add}
|
||||
type="accent"
|
||||
accentColor={"accent"}
|
||||
accentText="light"
|
||||
onPress={openEditor}
|
||||
customStyle={{
|
||||
borderRadius: 100
|
||||
@@ -319,7 +317,7 @@ export const TopicsSheet = () => {
|
||||
alignItems: "center"
|
||||
}}
|
||||
>
|
||||
<Paragraph size={SIZE.xs} color={colors.icon}>
|
||||
<Paragraph size={SIZE.xs} color={colors.primary.icon}>
|
||||
TOPICS
|
||||
</Paragraph>
|
||||
<View
|
||||
@@ -356,7 +354,7 @@ export const TopicsSheet = () => {
|
||||
});
|
||||
return;
|
||||
}}
|
||||
color={colors.pri}
|
||||
color={colors.primary.icon}
|
||||
tooltipText="Move to trash"
|
||||
tooltipPosition={1}
|
||||
name="delete"
|
||||
@@ -376,7 +374,7 @@ export const TopicsSheet = () => {
|
||||
});
|
||||
}}
|
||||
testID="group-topic-button"
|
||||
color={colors.pri}
|
||||
color={colors.primary.icon}
|
||||
size={22}
|
||||
customStyle={{
|
||||
width: 40,
|
||||
@@ -387,7 +385,7 @@ export const TopicsSheet = () => {
|
||||
name="plus"
|
||||
onPress={PLACEHOLDER_DATA.action}
|
||||
testID="add-topic-button"
|
||||
color={colors.pri}
|
||||
color={colors.primary.icon}
|
||||
size={22}
|
||||
customStyle={{
|
||||
width: 40,
|
||||
@@ -406,7 +404,7 @@ export const TopicsSheet = () => {
|
||||
ref.current?.snapToIndex(1);
|
||||
}
|
||||
}}
|
||||
color={colors.pri}
|
||||
color={colors.primary.icon}
|
||||
size={22}
|
||||
customStyle={{
|
||||
width: 40,
|
||||
@@ -429,8 +427,8 @@ export const TopicsSheet = () => {
|
||||
onRefresh={() => {
|
||||
onRequestUpdate();
|
||||
}}
|
||||
colors={[colors.accent]}
|
||||
progressBackgroundColor={colors.bg}
|
||||
colors={[colors.primary.accent]}
|
||||
progressBackgroundColor={colors.primary.background}
|
||||
/>
|
||||
}
|
||||
keyExtractor={(item) => (item as TopicType).id}
|
||||
@@ -444,7 +442,7 @@ export const TopicsSheet = () => {
|
||||
height: 200
|
||||
}}
|
||||
>
|
||||
<Paragraph color={colors.icon}>No topics</Paragraph>
|
||||
<Paragraph color={colors.primary.icon}>No topics</Paragraph>
|
||||
</View>
|
||||
}
|
||||
ListFooterComponent={<View style={{ height: 50 }} />}
|
||||
@@ -478,7 +476,7 @@ const TopicItem = ({
|
||||
sheetRef: RefObject<ActionSheetRef>;
|
||||
}) => {
|
||||
const screen = useNavigationStore((state) => state.currentScreen);
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors("sheet");
|
||||
const selection = useSelection();
|
||||
const isSelected =
|
||||
selection.selection.findIndex((selected) => selected.id === item.id) > -1;
|
||||
@@ -487,7 +485,7 @@ const TopicItem = ({
|
||||
|
||||
return (
|
||||
<PressableButton
|
||||
type={isSelected || isFocused ? "grayBg" : "transparent"}
|
||||
type={isSelected || isFocused ? "selected" : "transparent"}
|
||||
onLongPress={() => {
|
||||
if (selection.enabled) return;
|
||||
selection.setEnabled(true);
|
||||
@@ -519,7 +517,7 @@ const TopicItem = ({
|
||||
{selection.enabled ? (
|
||||
<IconButton
|
||||
size={SIZE.lg}
|
||||
color={isSelected ? colors.accent : colors.icon}
|
||||
color={isSelected ? colors.selected.icon : colors.primary.icon}
|
||||
name={
|
||||
isSelected
|
||||
? "check-circle-outline"
|
||||
@@ -530,7 +528,7 @@ const TopicItem = ({
|
||||
<Paragraph size={SIZE.sm}>
|
||||
{item.title}{" "}
|
||||
{notesCount ? (
|
||||
<Paragraph size={SIZE.xs} color={colors.icon}>
|
||||
<Paragraph size={SIZE.xs} color={colors.secondary.paragraph}>
|
||||
{notesCount}
|
||||
</Paragraph>
|
||||
) : null}
|
||||
@@ -550,7 +548,7 @@ const TopicItem = ({
|
||||
right={0}
|
||||
bottom={0}
|
||||
top={0}
|
||||
color={colors.pri}
|
||||
color={colors.primary.icon}
|
||||
size={SIZE.xl}
|
||||
/>
|
||||
</PressableButton>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -23,8 +23,8 @@ import Navigation from "../../services/navigation";
|
||||
import useNavigationStore from "../../stores/use-navigation-store";
|
||||
import { useMenuStore } from "../../stores/use-menu-store";
|
||||
import { useNoteStore } from "../../stores/use-notes-store";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { COLORS_NOTE } from "../../utils/color-scheme";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { ColorValues } from "../../utils/colors";
|
||||
import { db } from "../../common/database";
|
||||
import { normalize, SIZE } from "../../utils/size";
|
||||
import { presentDialog } from "../dialog/functions";
|
||||
@@ -58,7 +58,7 @@ export const ColorSection = React.memo(
|
||||
|
||||
const ColorItem = React.memo(
|
||||
function ColorItem({ item, alias }) {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors, isDark } = useThemeColors();
|
||||
const setColorNotes = useMenuStore((state) => state.setColorNotes);
|
||||
const [headerTextState, setHeaderTextState] = useState(null);
|
||||
alias = db.colors.alias(item.id) || "";
|
||||
@@ -116,8 +116,8 @@ const ColorItem = React.memo(
|
||||
headerTextState?.id === item.id ? "rgba(0,0,0,0.04)" : "transparent"
|
||||
}
|
||||
onLongPress={onLongPress}
|
||||
customSelectedColor={COLORS_NOTE[item.title.toLowerCase()]}
|
||||
customAlpha={!colors.night ? -0.02 : 0.02}
|
||||
customSelectedColor={ColorValues[item.title.toLowerCase()]}
|
||||
customAlpha={!isDark ? -0.02 : 0.02}
|
||||
customOpacity={0.12}
|
||||
onPress={() => onPress(item)}
|
||||
customStyle={{
|
||||
@@ -149,7 +149,7 @@ const ColorItem = React.memo(
|
||||
style={{
|
||||
width: SIZE.lg - 2,
|
||||
height: SIZE.lg - 2,
|
||||
backgroundColor: COLORS_NOTE[item.title.toLowerCase()],
|
||||
backgroundColor: ColorValues[item.title.toLowerCase()],
|
||||
borderRadius: 100,
|
||||
justifyContent: "center",
|
||||
marginRight: 10
|
||||
@@ -157,11 +157,11 @@ const ColorItem = React.memo(
|
||||
/>
|
||||
</View>
|
||||
{headerTextState?.id === item.id ? (
|
||||
<Heading color={colors.heading} size={SIZE.md}>
|
||||
<Heading color={colors.selected.heading} size={SIZE.md}>
|
||||
{alias.slice(0, 1).toUpperCase() + alias.slice(1)}
|
||||
</Heading>
|
||||
) : (
|
||||
<Paragraph color={colors.pri} size={SIZE.md}>
|
||||
<Paragraph color={colors.primary.paragraph} size={SIZE.md}>
|
||||
{alias.slice(0, 1).toUpperCase() + alias.slice(1)}
|
||||
</Paragraph>
|
||||
)}
|
||||
|
||||
@@ -26,20 +26,19 @@ import { eSendEvent } from "../../services/event-manager";
|
||||
import Navigation from "../../services/navigation";
|
||||
import { useNoteStore } from "../../stores/use-notes-store";
|
||||
import { useSettingStore } from "../../stores/use-setting-store";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { useUserStore } from "../../stores/use-user-store";
|
||||
import { toggleDarkMode } from "../../utils/color-scheme/utils";
|
||||
import { MenuItemsList, SUBSCRIPTION_STATUS } from "../../utils/constants";
|
||||
import { eOpenPremiumDialog } from "../../utils/events";
|
||||
import { ColorSection } from "./color-section";
|
||||
import { MenuItem } from "./menu-item";
|
||||
import { TagsSection } from "./pinned-section";
|
||||
import { UserStatus } from "./user-status";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
|
||||
export const SideMenu = React.memo(
|
||||
function SideMenu() {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const deviceMode = useSettingStore((state) => state.deviceMode);
|
||||
const { colors, isDark } = useThemeColors();
|
||||
const insets = useGlobalSafeAreaInsets();
|
||||
const subscriptionType = useUserStore(
|
||||
(state) => state.user?.subscription?.type
|
||||
@@ -51,11 +50,13 @@ export const SideMenu = React.memo(
|
||||
const noTextMode = false;
|
||||
const BottomItemsList = [
|
||||
{
|
||||
name: colors.night ? "Day" : "Night",
|
||||
name: isDark ? "Day" : "Night",
|
||||
icon: "theme-light-dark",
|
||||
func: toggleDarkMode,
|
||||
func: () => {
|
||||
useThemeStore.getState().setColorScheme();
|
||||
},
|
||||
switch: true,
|
||||
on: !!colors.night,
|
||||
on: !!isDark,
|
||||
close: false
|
||||
},
|
||||
{
|
||||
@@ -102,16 +103,18 @@ export const SideMenu = React.memo(
|
||||
style={{
|
||||
height: "100%",
|
||||
width: "100%",
|
||||
backgroundColor: colors.nav
|
||||
backgroundColor: colors.primary.background
|
||||
}}
|
||||
>
|
||||
<View
|
||||
style={{
|
||||
height: "100%",
|
||||
width: "100%",
|
||||
backgroundColor: deviceMode !== "mobile" ? colors.nav : colors.bg,
|
||||
backgroundColor: colors.primary.background,
|
||||
paddingTop: insets.top,
|
||||
borderRadius: 10
|
||||
borderRadius: 10,
|
||||
borderTopLeftRadius: 0,
|
||||
borderBottomLeftRadius: 0
|
||||
}}
|
||||
>
|
||||
<FlatList
|
||||
|
||||
@@ -23,7 +23,7 @@ import Icon from "react-native-vector-icons/MaterialCommunityIcons";
|
||||
import ToggleSwitch from "toggle-switch-react-native";
|
||||
import Navigation from "../../services/navigation";
|
||||
import useNavigationStore from "../../stores/use-navigation-store";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { normalize, SIZE } from "../../utils/size";
|
||||
import { Button } from "../ui/button";
|
||||
import { PressableButton } from "../ui/pressable";
|
||||
@@ -34,7 +34,7 @@ import Tag from "../ui/tag";
|
||||
|
||||
export const MenuItem = React.memo(
|
||||
function MenuItem({ item, index, testID, rightBtn }) {
|
||||
const colors = useThemeStore((state) => state.colors);
|
||||
const { colors } = useThemeColors();
|
||||
const [headerTextState, setHeaderTextState] = useState(
|
||||
useNavigationStore.getState().currentScreen
|
||||
);
|
||||
@@ -85,7 +85,7 @@ export const MenuItem = React.memo(
|
||||
testID={testID}
|
||||
key={item.name + index}
|
||||
onPress={_onPress}
|
||||
type={!isFocused ? "gray" : "grayBg"}
|
||||
type={isFocused ? "selected" : "gray"}
|
||||
customStyle={{
|
||||
width: "100%",
|
||||
alignSelf: "center",
|
||||
@@ -113,15 +113,15 @@ export const MenuItem = React.memo(
|
||||
name={item.icon}
|
||||
color={
|
||||
item.icon === "crown"
|
||||
? colors.yellow
|
||||
? colors.static.yellow
|
||||
: isFocused
|
||||
? colors.accent
|
||||
: colors.pri
|
||||
? colors.selected.icon
|
||||
: colors.secondary.icon
|
||||
}
|
||||
size={SIZE.lg - 2}
|
||||
/>
|
||||
{isFocused ? (
|
||||
<Heading color={colors.heading} size={SIZE.md}>
|
||||
<Heading color={colors.selected.heading} size={SIZE.md}>
|
||||
{item.name}
|
||||
</Heading>
|
||||
) : (
|
||||
@@ -134,8 +134,8 @@ export const MenuItem = React.memo(
|
||||
{item.switch ? (
|
||||
<ToggleSwitch
|
||||
isOn={item.on}
|
||||
onColor={colors.accent}
|
||||
offColor={colors.icon}
|
||||
onColor={colors.primary.accent}
|
||||
offColor={colors.primary.icon}
|
||||
size="small"
|
||||
animationSpeed={150}
|
||||
onToggle={_onPress}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user