Skip to content

Commit

Permalink
mobile: fix multi file sharing
Browse files Browse the repository at this point in the history
  • Loading branch information
ammarahm-ed committed Dec 24, 2024
1 parent 33c7eb5 commit bee06ec
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 33 deletions.
10 changes: 10 additions & 0 deletions apps/mobile/native/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,16 @@
<data android:mimeType="application/*" />
</intent-filter>

<intent-filter android:label="Make Note">
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/*" />
<data android:mimeType="image/*" />
<data android:mimeType="video/*" />
<data android:mimeType="image/*" />
<data android:mimeType="application/*" />
</intent-filter>

<intent-filter android:label="Make Note">
<action android:name="android.intent.action.PROCESS_TEXT" />
<category android:name="android.intent.category.DEFAULT" />
Expand Down
70 changes: 37 additions & 33 deletions apps/mobile/share/share.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import { SafeAreaProvider } from "react-native-safe-area-context";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
import isURL from "validator/lib/isURL";
import { DatabaseLogger, db } from "../app/common/database";
import Storage from "../app/common/database/storage";
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";
Expand Down Expand Up @@ -620,41 +620,45 @@ const ShareView = () => {
>
Tap to remove an attachment.
</Paragraph>
<TouchableOpacity
activeOpacity={1}
style={{
flexDirection: "row",
alignSelf: "center",
alignItems: "center",
width: "100%",
marginTop: 6
}}
onPress={() => {
setCompress(!compress);
}}
>
<Icon
size={20}
name={
compress
? "checkbox-marked"
: "checkbox-blank-outline"
}
color={
compress ? colors.primary.accent : colors.primary.icon
}
/>

<Text
{rawFiles.some((item) => isImage(item.type)) ? (
<TouchableOpacity
activeOpacity={1}
style={{
flexShrink: 1,
marginLeft: 3,
fontSize: 12
flexDirection: "row",
alignSelf: "center",
alignItems: "center",
width: "100%",
marginTop: 6
}}
onPress={() => {
setCompress(!compress);
}}
>
Compress image (recommended)
</Text>
</TouchableOpacity>
<Icon
size={20}
name={
compress
? "checkbox-marked"
: "checkbox-blank-outline"
}
color={
compress
? colors.primary.accent
: colors.primary.icon
}
/>

<Text
style={{
flexShrink: 1,
marginLeft: 3,
fontSize: 12
}}
>
Compress image(s) (recommended)
</Text>
</TouchableOpacity>
) : null}
</View>
) : null}
<View
Expand Down

0 comments on commit bee06ec

Please sign in to comment.