2023-05-09 14:49:13 +00:00
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import * as List from '../../containers/List';
|
|
|
|
import SafeAreaView from '../../containers/SafeAreaView';
|
|
|
|
import StatusBar from '../../containers/StatusBar';
|
2023-05-09 22:21:02 +00:00
|
|
|
import ListPicker from './ListPicker';
|
2023-05-30 14:07:34 +00:00
|
|
|
import { useUserPreferences } from '../../lib/methods/userPreferences';
|
2023-05-09 22:21:02 +00:00
|
|
|
import {
|
|
|
|
AUDIO_PREFERENCE_DOWNLOAD,
|
|
|
|
IMAGES_PREFERENCE_DOWNLOAD,
|
|
|
|
MediaDownloadOption,
|
|
|
|
VIDEO_PREFERENCE_DOWNLOAD
|
|
|
|
} from '../../lib/constants';
|
|
|
|
|
2023-05-09 14:49:13 +00:00
|
|
|
const MediaAutoDownload = () => {
|
2023-05-30 14:07:34 +00:00
|
|
|
const [imagesPreference, setImagesPreference] = useUserPreferences<MediaDownloadOption>(
|
2023-05-09 22:21:02 +00:00
|
|
|
IMAGES_PREFERENCE_DOWNLOAD,
|
|
|
|
MediaDownloadOption.NEVER
|
|
|
|
);
|
2023-05-30 14:07:34 +00:00
|
|
|
const [videoPreference, setVideoPreference] = useUserPreferences<MediaDownloadOption>(
|
2023-05-09 22:21:02 +00:00
|
|
|
VIDEO_PREFERENCE_DOWNLOAD,
|
|
|
|
MediaDownloadOption.NEVER
|
|
|
|
);
|
2023-05-30 14:07:34 +00:00
|
|
|
const [audioPreference, setAudioPreference] = useUserPreferences<MediaDownloadOption>(
|
2023-05-09 22:21:02 +00:00
|
|
|
AUDIO_PREFERENCE_DOWNLOAD,
|
|
|
|
MediaDownloadOption.NEVER
|
|
|
|
);
|
2023-05-09 14:49:13 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<SafeAreaView testID='security-privacy-view'>
|
|
|
|
<StatusBar />
|
|
|
|
<List.Container testID='security-privacy-view-list'>
|
|
|
|
<List.Section>
|
|
|
|
<List.Separator />
|
2023-05-09 22:21:02 +00:00
|
|
|
<ListPicker
|
|
|
|
onChangeValue={setImagesPreference}
|
|
|
|
value={imagesPreference}
|
|
|
|
title='Images'
|
|
|
|
testID='media-auto-download-view-images'
|
|
|
|
/>
|
|
|
|
<ListPicker
|
|
|
|
onChangeValue={setVideoPreference}
|
|
|
|
value={videoPreference}
|
|
|
|
title='Video'
|
|
|
|
testID='media-auto-download-view-video'
|
|
|
|
/>
|
|
|
|
<ListPicker
|
|
|
|
onChangeValue={setAudioPreference}
|
|
|
|
value={audioPreference}
|
|
|
|
title='Audio'
|
|
|
|
testID='media-auto-download-view-audio'
|
2023-05-09 14:49:13 +00:00
|
|
|
/>
|
|
|
|
</List.Section>
|
|
|
|
</List.Container>
|
|
|
|
</SafeAreaView>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default MediaAutoDownload;
|