Cleanup unused Javascript (#3027)

* chore(js): be stricter about dead code warnings

* chore(js): remove dead code and unused exports

* rebase

* chore: remove unused files

* chore(deps): remove unused prop-types dep

* chore(js): remove unused function

* chore(deps): remove + check unused deps

* chore(js): remove unused exports. Closes #3036
This commit is contained in:
Gabe Kangas
2023-05-20 21:15:25 -07:00
committed by GitHub
parent 429289d508
commit e50b23d081
55 changed files with 1187 additions and 1071 deletions

View File

@@ -1,8 +1,5 @@
import { convertToText } from '../chat';
import { getDiffInDaysFromNow } from '../../../utils/helpers';
const convertToMarkup = (str = '') => convertToText(str).replace(/\n/g, '<p></p>');
export function formatTimestamp(sentAt: Date) {
const now = new Date(sentAt);
if (Number.isNaN(now)) return '';
@@ -18,14 +15,3 @@ export function formatTimestamp(sentAt: Date) {
return `${now.toLocaleTimeString()}`;
}
/*
You would call this when receiving a plain text
value back from an API, and before inserting the
text into the `contenteditable` area on a page.
*/
export function formatMessageText(message: string) {
const formattedText = convertToMarkup(message);
return formattedText;
}