Yarn formatting.

pull/1703/head
Warrick Corfe-Tan 4 years ago
parent 15afdbfa7d
commit f356c9b843

@ -53,7 +53,7 @@ export const SessionWrapperModal = (props: SessionWrapperModalType) => {
showExitIcon, showExitIcon,
headerIconButtons, headerIconButtons,
headerReverse, headerReverse,
additionalClassName additionalClassName,
} = props; } = props;
const theme = useTheme(); const theme = useTheme();
@ -75,7 +75,7 @@ export const SessionWrapperModal = (props: SessionWrapperModalType) => {
}; };
return ( return (
<div className={"loki-dialog modal " + additionalClassName}> <div className={'loki-dialog modal ' + additionalClassName}>
<div className="session-confirm-wrapper"> <div className="session-confirm-wrapper">
<div className="session-modal"> <div className="session-modal">
{showHeader ? ( {showHeader ? (

@ -215,16 +215,16 @@ export class SessionCompositionBox extends React.Component<Props, State> {
const { items } = e.clipboardData; const { items } = e.clipboardData;
let imgBlob = null; let imgBlob = null;
for (const item of items) { for (const item of items) {
const pasteType = item.type.split('/')[0] const pasteType = item.type.split('/')[0];
if (pasteType === 'image') { if (pasteType === 'image') {
imgBlob = item.getAsFile(); imgBlob = item.getAsFile();
} }
switch (pasteType) { switch (pasteType) {
case ('image'): case 'image':
imgBlob = item.getAsFile(); imgBlob = item.getAsFile();
break; break;
case ('text'): case 'text':
this.showLinkSharingConfirmationModalDialog(e); this.showLinkSharingConfirmationModalDialog(e);
} }
} }
@ -252,18 +252,19 @@ export class SessionCompositionBox extends React.Component<Props, State> {
okTheme: SessionButtonColor.Danger, okTheme: SessionButtonColor.Danger,
onClickOk: () => { onClickOk: () => {
window.setSettingValue('link-preview-setting', true); window.setSettingValue('link-preview-setting', true);
} },
}); });
} }
} }
/** /**
* *
* @param str String to evaluate * @param str String to evaluate
* @returns boolean if the string is true or false * @returns boolean if the string is true or false
*/ */
private isURL(str: string) { private isURL(str: string) {
var urlRegex = '^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$'; var urlRegex =
'^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$';
var url = new RegExp(urlRegex, 'i'); var url = new RegExp(urlRegex, 'i');
return str.length < 2083 && url.test(str); return str.length < 2083 && url.test(str);
} }
@ -389,12 +390,12 @@ export class SessionCompositionBox extends React.Component<Props, State> {
const messagePlaceHolder = isKickedFromGroup const messagePlaceHolder = isKickedFromGroup
? i18n('youGotKickedFromGroup') ? i18n('youGotKickedFromGroup')
: left : left
? i18n('youLeftTheGroup') ? i18n('youLeftTheGroup')
: isBlocked && isPrivate : isBlocked && isPrivate
? i18n('unblockToSend') ? i18n('unblockToSend')
: isBlocked && !isPrivate : isBlocked && !isPrivate
? i18n('unblockGroupToSend') ? i18n('unblockGroupToSend')
: i18n('sendMessage'); : i18n('sendMessage');
const typingEnabled = this.isTypingEnabled(); const typingEnabled = this.isTypingEnabled();
let index = 0; let index = 0;

@ -131,7 +131,7 @@ const SessionSvg = (props: {
viewBox: props.viewBox, viewBox: props.viewBox,
glowDuration: props.glowDuration, glowDuration: props.glowDuration,
glowStartDelay: props.glowStartDelay, glowStartDelay: props.glowStartDelay,
iconColor: props.iconColor iconColor: props.iconColor,
}; };
return ( return (

Loading…
Cancel
Save