+
+ {renderOptionalInput('customSlug', 'Custom slug')}
-
-
-
- {renderOptionalInput('customSlug', 'Custom slug')}
-
-
- {renderOptionalInput('domain', 'Domain', 'text', {
- disabled: disableDomain,
- ...disableDomain && { title: 'Shlink 1.19.0 or higher is required to be able to provide the domain' },
- })}
-
+
+ {renderOptionalInput('domain', 'Domain', 'text', {
+ disabled: disableDomain,
+ ...disableDomain && { title: 'Shlink 1.19.0 or higher is required to be able to provide the domain' },
+ })}
-
-
-
- {renderOptionalInput('maxVisits', 'Maximum number of visits allowed', 'number', { min: 1 })}
-
-
- {renderDateInput('validSince', 'Enabled since...', { maxDate: this.state.validUntil })}
-
-
- {renderDateInput('validUntil', 'Enabled until...', { minDate: this.state.validSince })}
-
-
-
-
-
- this.setState({ findIfExists })}
- >
- Use existing URL if found
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ {renderOptionalInput('maxVisits', 'Maximum number of visits allowed', 'number', { min: 1 })}
+
+
+ {renderDateInput('validSince', 'Enabled since...', { maxDate: this.state.validUntil })}
+
+
+ {renderDateInput('validUntil', 'Enabled until...', { minDate: this.state.validSince })}
+
+
+
+
+
+ this.setState({ findIfExists })}
+ >
+ Use existing URL if found
+
+
+
+
+
+
+
+
+
+
+
+
+
);
}
};
diff --git a/src/short-urls/ShortUrls.js b/src/short-urls/ShortUrls.js
index 3bfeec46..3efe9868 100644
--- a/src/short-urls/ShortUrls.js
+++ b/src/short-urls/ShortUrls.js
@@ -19,11 +19,11 @@ const ShortUrls = (SearchBar, ShortUrlsList) => {
const urlsListKey = `${serverId}_${page}`;
return (
-
+
);
};
diff --git a/src/tags/TagsList.js b/src/tags/TagsList.js
index e9964c22..9cee6953 100644
--- a/src/tags/TagsList.js
+++ b/src/tags/TagsList.js
@@ -69,14 +69,14 @@ const TagsList = (TagCard) => class TagsList extends React.Component {
const { filterTags } = this.props;
return (
-
+
{!this.props.tagsList.loading &&
}
{this.renderContent()}
-
+
);
}
};
diff --git a/src/utils/utils.js b/src/utils/utils.js
index 48af3f55..da40702d 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -2,7 +2,7 @@ import L from 'leaflet';
import marker2x from 'leaflet/dist/images/marker-icon-2x.png';
import marker from 'leaflet/dist/images/marker-icon.png';
import markerShadow from 'leaflet/dist/images/marker-shadow.png';
-import { range } from 'ramda';
+import { identity, memoizeWith, range } from 'ramda';
import { useState } from 'react';
import { compare } from 'compare-versions';
@@ -59,13 +59,13 @@ export const compareVersions = (firstVersion, operator, secondVersion) => compar
operator
);
-export const versionIsValidSemVer = (version) => {
+export const versionIsValidSemVer = memoizeWith(identity, (version) => {
try {
return compareVersions(version, '=', version);
} catch (e) {
return false;
}
-};
+});
export const formatDate = (format = 'YYYY-MM-DD') => (date) => date && date.format ? date.format(format) : date;
diff --git a/src/visits/ShortUrlVisits.js b/src/visits/ShortUrlVisits.js
index e235ffef..a0875b0b 100644
--- a/src/visits/ShortUrlVisits.js
+++ b/src/visits/ShortUrlVisits.js
@@ -133,7 +133,7 @@ const ShortUrlVisits = (
const setDate = (dateField) => (date) => this.setState({ [dateField]: date }, this.loadVisits);
return (
-
+
@@ -148,7 +148,7 @@ const ShortUrlVisits = (
-
+
);
}
};