diff --git a/apps/mobile/app/components/attachments/actions.tsx b/apps/mobile/app/components/attachments/actions.tsx index 4ee2de59e..908bf4052 100644 --- a/apps/mobile/app/components/attachments/actions.tsx +++ b/apps/mobile/app/components/attachments/actions.tsx @@ -19,6 +19,7 @@ along with this program. If not, see . import { formatBytes } from "@notesnook/common"; import { Attachment, Note, VirtualizedGrouping } from "@notesnook/core"; +import { strings } from "@notesnook/intl"; import { useThemeColors } from "@notesnook/theme"; import Clipboard from "@react-native-clipboard/clipboard"; import React, { RefObject, useEffect, useState } from "react"; @@ -26,6 +27,7 @@ import { TextInput, View } from "react-native"; import { ActionSheetRef } from "react-native-actions-sheet"; import { ScrollView } from "react-native-gesture-handler"; import { db } from "../../common/database"; +import { Radius, Spacing } from "../../common/design/spacing"; import filesystem from "../../common/filesystem"; import downloadAttachment from "../../common/filesystem/download-attachment"; import { useAttachmentProgress } from "../../hooks/use-attachment-progress"; @@ -37,6 +39,7 @@ import { eSendEvent, presentSheet } from "../../services/event-manager"; +import Navigation from "../../services/navigation"; import PremiumService from "../../services/premium"; import { useAttachmentStore } from "../../stores/use-attachment-store"; import { @@ -46,20 +49,19 @@ import { eOnLoadNote } from "../../utils/events"; import { AppFontSize } from "../../utils/size"; +import { DefaultAppStyles } from "../../utils/styles"; import { Dialog } from "../dialog"; import { presentDialog } from "../dialog/functions"; import { openNote } from "../list-items/note/wrapper"; import { DateMeta } from "../properties/date-meta"; import SheetProvider from "../sheet-provider"; -import { Button } from "../ui/button"; +import AppIcon from "../ui/AppIcon"; +import { createFormRef, validators } from "../ui/input/form-input"; import { Notice } from "../ui/notice"; import { Pressable } from "../ui/pressable"; +import LineSeparator from "../ui/seperator/line-separator"; import Heading from "../ui/typography/heading"; import Paragraph from "../ui/typography/paragraph"; -import { strings } from "@notesnook/intl"; -import { DefaultAppStyles } from "../../utils/styles"; -import Navigation from "../../services/navigation"; -import { createFormRef, validators } from "../ui/input/form-input"; const Actions = ({ attachment, @@ -94,7 +96,7 @@ const Actions = ({ downloadAttachment(attachment.hash, context === "global"); fwdRef.current?.hide(); }, - icon: "download" + icon: "download-simple" }, { name: strings.network.reupload(), @@ -114,7 +116,7 @@ const Actions = ({ type: attachment.mimeType.startsWith("image") ? "image" : "file" }); }, - icon: "upload" + icon: "upload-simple" }, { name: strings.fileCheck(), @@ -149,7 +151,7 @@ const Actions = ({ name: undefined }); }, - icon: "file-check" + icon: "file" }, { name: strings.rename(), @@ -197,7 +199,7 @@ const Actions = ({ }); }, 500); }, - icon: "form-textbox" + icon: "pencil-simple" }, { name: strings.delete(), @@ -249,7 +251,7 @@ const Actions = ({ }); }, 500); }, - icon: "delete-outline" + icon: "trash" } ]; @@ -267,6 +269,7 @@ const Actions = ({ onMomentumScrollEnd={() => { fwdRef?.current?.handleChildScrollEnd(); }} + bounces={false} nestedScrollEnabled={true} style={{ maxHeight: "100%" @@ -277,42 +280,34 @@ const Actions = ({ 0 ? 0 : DefaultAppStyles.GAP_VERTICAL + paddingHorizontal: Spacing.LEVEL_3, + paddingTop: Spacing.LEVEL_4, + gap: Spacing.LEVEL_1 }} > - - {filename} - + {filename} - + {attachment.mimeType} + {formatBytes(attachment.size)} - + {notes.length ? ( - + {strings.notes(notes.length)} ) : null} + { Clipboard.setString(attachment.hash); @@ -322,82 +317,123 @@ const Actions = ({ context: "local" }); }} - size={AppFontSize.xs} + fontSize="XS" color={colors.secondary.paragraph} > + {" "} {attachment.hash} + + {notes && notes.length > 0 ? ( - - <> - - {strings.listOf()} {strings.dataTypesPlural.note()}: - + <> + + + <> + + {strings.notes(notes.length)} + - {notes.map((item) => ( - { - eSendEvent(eCloseSheet, contextId); - close?.(); - eSendEvent(eCloseAttachmentDialog); - Navigation.navigate("FluidPanelsView"); - openNote(item, (item as any).type === "trash"); - }} - style={{ - paddingVertical: DefaultAppStyles.GAP_VERTICAL, - alignItems: "flex-start", - - paddingHorizontal: DefaultAppStyles.GAP - }} - key={item.id} - > - {item.title} - - ))} - - + {notes.map((item) => ( + { + eSendEvent(eCloseSheet, contextId); + close?.(); + eSendEvent(eCloseAttachmentDialog); + Navigation.navigate("FluidPanelsView"); + openNote(item, (item as any).type === "trash"); + }} + style={{ + alignItems: "flex-start" + }} + key={item.id} + > + {item.title} + + ))} + + + ) : null} - {actions.map((item) => ( -