mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 16:33:26 +00:00
chore: cleanup
This commit is contained in:
@@ -14,7 +14,7 @@ import { useDownloadManager } from "~/hooks/DownloadManagerContext";
|
|||||||
import { usePlayerStore } from "~/stores/player/store";
|
import { usePlayerStore } from "~/stores/player/store";
|
||||||
|
|
||||||
const DownloadsScreen: React.FC = () => {
|
const DownloadsScreen: React.FC = () => {
|
||||||
const { startDownload, downloads, removeDownload } = useDownloadManager();
|
const { startDownload, downloads } = useDownloadManager();
|
||||||
const resetVideo = usePlayerStore((state) => state.resetVideo);
|
const resetVideo = usePlayerStore((state) => state.resetVideo);
|
||||||
const setAsset = usePlayerStore((state) => state.setAsset);
|
const setAsset = usePlayerStore((state) => state.setAsset);
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -94,7 +94,6 @@ const DownloadsScreen: React.FC = () => {
|
|||||||
key={item.id}
|
key={item.id}
|
||||||
{...item}
|
{...item}
|
||||||
onPress={() => handlePress(item.asset)}
|
onPress={() => handlePress(item.asset)}
|
||||||
onLongPress={removeDownload}
|
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
@@ -16,11 +16,10 @@ export interface DownloadItemProps {
|
|||||||
fileSize: number;
|
fileSize: number;
|
||||||
downloaded: number;
|
downloaded: number;
|
||||||
isFinished: boolean;
|
isFinished: boolean;
|
||||||
onLongPress: (id: string) => void;
|
|
||||||
statusText?: string;
|
statusText?: string;
|
||||||
asset?: Asset;
|
asset?: Asset;
|
||||||
onPress: (asset?: Asset) => void;
|
|
||||||
isHLS?: boolean;
|
isHLS?: boolean;
|
||||||
|
onPress: (asset?: Asset) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ContextMenuActions {
|
enum ContextMenuActions {
|
||||||
@@ -45,11 +44,10 @@ export const DownloadItem: React.FC<DownloadItemProps> = ({
|
|||||||
fileSize,
|
fileSize,
|
||||||
downloaded,
|
downloaded,
|
||||||
isFinished,
|
isFinished,
|
||||||
onLongPress,
|
|
||||||
statusText,
|
statusText,
|
||||||
asset,
|
asset,
|
||||||
onPress,
|
|
||||||
isHLS,
|
isHLS,
|
||||||
|
onPress,
|
||||||
}) => {
|
}) => {
|
||||||
const percentage = progress * 100;
|
const percentage = progress * 100;
|
||||||
const formattedFileSize = formatBytes(fileSize);
|
const formattedFileSize = formatBytes(fileSize);
|
||||||
@@ -105,11 +103,7 @@ export const DownloadItem: React.FC<DownloadItemProps> = ({
|
|||||||
onPress={onContextMenuPress}
|
onPress={onContextMenuPress}
|
||||||
previewBackgroundColor="transparent"
|
previewBackgroundColor="transparent"
|
||||||
>
|
>
|
||||||
<TouchableOpacity
|
<TouchableOpacity onPress={() => onPress(asset)} activeOpacity={0.7}>
|
||||||
onPress={() => onPress(asset)}
|
|
||||||
onLongPress={() => onLongPress(id)}
|
|
||||||
activeOpacity={0.7}
|
|
||||||
>
|
|
||||||
<View
|
<View
|
||||||
marginBottom={16}
|
marginBottom={16}
|
||||||
borderRadius={8}
|
borderRadius={8}
|
||||||
|
Reference in New Issue
Block a user