diff --git a/apps/mobile/app/components/ui/button/index.tsx b/apps/mobile/app/components/ui/button/index.tsx index b062c212d..ed0a13fbb 100644 --- a/apps/mobile/app/components/ui/button/index.tsx +++ b/apps/mobile/app/components/ui/button/index.tsx @@ -143,7 +143,6 @@ export const Button = ({ {!title ? null : ( ; - animatedViewProps?: Animated.AnimateProps; hidden?: boolean; } diff --git a/apps/mobile/app/components/ui/typography/heading.tsx b/apps/mobile/app/components/ui/typography/heading.tsx index e2cac62f9..3b61632d6 100644 --- a/apps/mobile/app/components/ui/typography/heading.tsx +++ b/apps/mobile/app/components/ui/typography/heading.tsx @@ -17,24 +17,16 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -import React, { useMemo } from "react"; -import { Platform, Text, TextProps, ViewStyle } from "react-native"; -import Animated, { - ComplexAnimationBuilder, - Layout -} from "react-native-reanimated"; import { useThemeColors } from "@notesnook/theme"; +import React from "react"; +import { Platform, Text, TextProps, ViewStyle } from "react-native"; import { SIZE } from "../../../utils/size"; interface HeadingProps extends TextProps { color?: string; size?: number; - layout?: ComplexAnimationBuilder; - animated?: boolean; extraBold?: boolean; } -const AnimatedText = Animated.createAnimatedComponent(Text); - const extraBoldStyle = { fontFamily: Platform.OS === "android" ? "OpenSans-Bold" : undefined, fontWeight: Platform.OS === "ios" ? "800" : undefined @@ -48,16 +40,13 @@ const Heading = ({ color, size = SIZE.xl, style, - animated, extraBold, ...restProps }: HeadingProps) => { const { colors } = useThemeColors(); - const Component = useMemo(() => (animated ? AnimatedText : Text), [animated]); return ( - + > ); }; diff --git a/apps/mobile/app/components/ui/typography/paragraph.tsx b/apps/mobile/app/components/ui/typography/paragraph.tsx index fa3ea651a..b929ef144 100644 --- a/apps/mobile/app/components/ui/typography/paragraph.tsx +++ b/apps/mobile/app/components/ui/typography/paragraph.tsx @@ -17,34 +17,24 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -import React, { useMemo } from "react"; -import { Text, TextProps } from "react-native"; -import Animated, { - ComplexAnimationBuilder, - Layout -} from "react-native-reanimated"; import { useThemeColors } from "@notesnook/theme"; +import React from "react"; +import { Text, TextProps } from "react-native"; import { SIZE } from "../../../utils/size"; interface ParagraphProps extends TextProps { color?: string; size?: number; - layout?: ComplexAnimationBuilder; - animated?: boolean; } -const AnimatedText = Animated.createAnimatedComponent(Text); const Paragraph = ({ color, size = SIZE.sm, style, - animated, ...restProps }: ParagraphProps) => { const { colors } = useThemeColors(); - const Component = useMemo(() => (animated ? AnimatedText : Text), [animated]); return ( - { NotesnookShare = require('../share/index').default; return Platform.OS === 'ios' ? ( - + ) : ( - + ); }; diff --git a/apps/mobile/native/index.js b/apps/mobile/native/index.js index 64684857b..f4c376a82 100644 --- a/apps/mobile/native/index.js +++ b/apps/mobile/native/index.js @@ -53,17 +53,4 @@ const ShareProvider = () => { ); }; - - -AppRegistry.registerComponent('NotesnookShare', () => ShareProvider); - -const QuickNoteProvider = () => { - QuickNoteIOS = require('../share/quick-note').default; - return ( - - - - ); -}; - -AppRegistry.registerComponent('QuickNoteIOS', () => QuickNoteProvider); +AppRegistry.registerComponent('NotesnookShare', () => ShareProvider); \ No newline at end of file diff --git a/apps/mobile/share/quick-note.js b/apps/mobile/share/quick-note.js deleted file mode 100644 index 0e370b1c2..000000000 --- a/apps/mobile/share/quick-note.js +++ /dev/null @@ -1,35 +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 . -*/ - -import { Component } from "react"; -import RNBootSplash from "react-native-bootsplash"; - -export default class QuickNoteIOS extends Component { - constructor(props, context) { - super(props, context); - } - - componentDidMount() { - RNBootSplash.hide({ fade: true }); - } - - render() { - return null; - } -} diff --git a/apps/mobile/share/search.tsx b/apps/mobile/share/search.tsx index 75929d7c5..3c0c018fb 100644 --- a/apps/mobile/share/search.tsx +++ b/apps/mobile/share/search.tsx @@ -32,13 +32,13 @@ import { } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import Icon from "react-native-vector-icons/MaterialCommunityIcons"; +import create from "zustand"; import { db } from "../app/common/database"; +import Paragraph from "../app/components/ui/typography/paragraph"; import { useDBItem } from "../app/hooks/use-db-item"; import { useNotebook } from "../app/hooks/use-notebook"; import { getElevationStyle } from "../app/utils/elevation"; import { initDatabase, useShareStore } from "./store"; -import { createItemSelectionStore } from "../app/stores/item-selection-store"; -import create from "zustand"; export const useNotebookExpandedStore = create<{ expanded: { @@ -211,7 +211,7 @@ const NotebookItem = ({ flexDirection: "column" }} > - {notebook.title} - + @@ -314,7 +314,7 @@ const ListItem = ({ flexDirection: "column" }} > - {item.type === "tag" ? "#" : ""} {item.title} - + @@ -333,12 +333,10 @@ const ListItem = ({ export const Search = ({ close, getKeyboardHeight, - quicknote, mode }: { close?: () => void; getKeyboardHeight: () => number; - quicknote?: boolean; mode: SearchMode; }) => { const { colors } = useThemeColors(); @@ -405,12 +403,6 @@ export const Search = ({ [close, mode, items] ); - const customStyles = quicknote - ? { - marginTop: -(insets.top || 0), - paddingTop: insets.top - } - : {}; const searchHeight = height - getKeyboardHeight(); return ( - Add #{searchKeyword} - + ) : null} diff --git a/apps/mobile/share/share.js b/apps/mobile/share/share.js index 143d46a10..78985045c 100644 --- a/apps/mobile/share/share.js +++ b/apps/mobile/share/share.js @@ -47,11 +47,16 @@ import Icon from "react-native-vector-icons/MaterialCommunityIcons"; import isURL from "validator/lib/isURL"; import { db } from "../app/common/database"; import Storage from "../app/common/database/storage"; +import { Button } from "../app/components/ui/button"; +import Heading from "../app/components/ui/typography/heading"; +import Paragraph from "../app/components/ui/typography/paragraph"; +import { useDBItem } from "../app/hooks/use-db-item"; import { eSendEvent } from "../app/services/event-manager"; import { FILE_SIZE_LIMIT, IMAGE_SIZE_LIMIT } from "../app/utils/constants"; import { getElevationStyle } from "../app/utils/elevation"; import { eOnLoadNote } from "../app/utils/events"; import { NoteBundle } from "../app/utils/note-bundle"; +import { SIZE } from "../app/utils/size"; import { AddNotebooks } from "./add-notebooks"; import { AddTags } from "./add-tags"; import { Editor } from "./editor"; @@ -110,7 +115,7 @@ const modes = { } }; -const ShareView = ({ quicknote = false }) => { +const ShareView = () => { const { colors } = useThemeColors(); const appendNote = useShareStore((state) => state.appendNote); const [note, setNote] = useState({ ...defaultNote }); @@ -251,11 +256,7 @@ const ShareView = ({ quicknote = false }) => { const close = async () => { setNote({ ...defaultNote }); setLoadingExtension(true); - if (quicknote) { - ShareExtension.openURL("ShareMedia://MainApp"); - } else { - ShareExtension.close(); - } + ShareExtension.close(); }; const onPress = async () => { @@ -368,99 +369,41 @@ const ShareView = ({ quicknote = false }) => { 500 ? 500 : width, - height: quicknote ? height : height - kh, + height: height - kh, alignSelf: "center", - justifyContent: quicknote ? "flex-start" : "flex-end" + justifyContent: "flex-end" }} > {loadingPage ? : null} - {quicknote && !searchMode ? ( + { + if (searchMode) { + setSearchMode(null); + } else { + close(); + } + }} + style={{ + width: "100%", + height: "100%", + position: "absolute" + }} + > -