-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Merge 4.49.0 into master (#5684)
- Loading branch information
Showing
42 changed files
with
292 additions
and
430 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
__tests__/containers/message/__snapshots__/Message.stories.storyshot
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react'; | ||
|
||
import { CustomIcon } from '../../../CustomIcon'; | ||
import styles from '../../styles'; | ||
|
||
const Pinned = ({ pinned, testID }: { pinned?: boolean; testID?: string }): React.ReactElement | null => { | ||
if (pinned) return <CustomIcon testID={testID} name='pin' size={16} style={styles.rightIcons} />; | ||
return null; | ||
}; | ||
|
||
export default Pinned; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import * as FileSystem from 'expo-file-system'; | ||
import FileViewer from 'react-native-file-viewer'; | ||
|
||
import { LISTENER } from '../../../containers/Toast'; | ||
import { IAttachment } from '../../../definitions'; | ||
import i18n from '../../../i18n'; | ||
import EventEmitter from './events'; | ||
|
||
export const getLocalFilePathFromFile = (localPath: string, attachment: IAttachment): string => `${localPath}${attachment.title}`; | ||
|
||
export const fileDownload = async (url: string, attachment?: IAttachment, fileName?: string): Promise<string> => { | ||
let path = `${FileSystem.documentDirectory}`; | ||
if (fileName) { | ||
path = `${path}${fileName}`; | ||
} | ||
if (attachment) { | ||
path = `${path}${attachment.title}`; | ||
} | ||
const file = await FileSystem.downloadAsync(url, path); | ||
return file.uri; | ||
}; | ||
|
||
export const fileDownloadAndPreview = async (url: string, attachment: IAttachment): Promise<void> => { | ||
try { | ||
const file = await fileDownload(url, attachment); | ||
FileViewer.open(file, { | ||
showOpenWithDialog: true, | ||
showAppsSuggestions: true | ||
}); | ||
} catch (e) { | ||
EventEmitter.emit(LISTENER, { message: i18n.t('Error_Download_file') }); | ||
} | ||
}; |
Oops, something went wrong.