Convert some instances (filter, find, pick) to native from lodash

This commit is contained in:
Qstick
2020-09-27 22:33:21 -04:00
parent 987ed357d5
commit d8a0aac9c3
21 changed files with 69 additions and 94 deletions

View File

@@ -1,4 +1,3 @@
import _ from 'lodash';
import PropTypes from 'prop-types';
import React from 'react';
import { kinds, sizes } from 'Helpers/Props';
@@ -10,7 +9,7 @@ function ImportListList({ lists, importListList }) {
<div className={styles.lists}>
{
lists.map((t) => {
const list = _.find(importListList, { id: t });
const list = importListList.find({ id: t });
if (!list) {
return null;

View File

@@ -1,4 +1,3 @@
import _ from 'lodash';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import createUISettingsSelector from 'Store/Selectors/createUISettingsSelector';
@@ -8,12 +7,12 @@ function createMapStateToProps() {
return createSelector(
createUISettingsSelector(),
(uiSettings) => {
return _.pick(uiSettings, [
'showRelativeDates',
'shortDateFormat',
'longDateFormat',
'timeFormat'
]);
return {
showRelativeDates: uiSettings.showRelativeDates,
shortDateFormat: uiSettings.shortDateFormat,
longDateFormat: uiSettings.longDateFormat,
timeFormat: uiSettings.timeFormat
};
}
);
}

View File

@@ -1,4 +1,3 @@
import _ from 'lodash';
import PropTypes from 'prop-types';
import React from 'react';
import { kinds } from 'Helpers/Props';
@@ -10,7 +9,7 @@ function TagList({ tags, tagList }) {
<div className={styles.tags}>
{
tags.map((t) => {
const tag = _.find(tagList, { id: t });
const tag = tagList.find({ id: t });
if (!tag) {
return null;