mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-02-27 12:16:36 +00:00
Installed TS and updated linter
This commit is contained in:
@@ -10,7 +10,7 @@ const propTypes = {
|
||||
|
||||
// FIXME Replace with typescript: (ServersImporter)
|
||||
const ImportServersBtn = ({ importServersFromFile }) => {
|
||||
const ImportServersBtnComp = ({ createServers, fileRef, onImport = () => {} }) => {
|
||||
const ImportServersBtnComp = ({ createServers, fileRef, onImport = () => '' }) => {
|
||||
const ref = fileRef || useRef();
|
||||
const onChange = ({ target }) =>
|
||||
importServersFromFile(target.files[0])
|
||||
|
||||
@@ -33,7 +33,7 @@ export default class ColorGenerator {
|
||||
this.storage.set('colors', this.colors);
|
||||
|
||||
return color;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export const colorGeneratorType = PropTypes.shape({
|
||||
|
||||
@@ -106,14 +106,14 @@ const generateDataset = (stats, label, color) => ({
|
||||
|
||||
const LineChartCard = ({ title, visits, highlightedVisits, highlightedLabel = 'Selected' }) => {
|
||||
const [ step, setStep ] = useState(
|
||||
visits.length > 0 ? determineInitialStep(visits[visits.length - 1].date) : 'monthly'
|
||||
visits.length > 0 ? determineInitialStep(visits[visits.length - 1].date) : 'monthly',
|
||||
);
|
||||
const [ skipNoVisits, toggleSkipNoVisits ] = useToggle(true);
|
||||
|
||||
const groupedVisitsWithGaps = useMemo(() => groupVisitsByStep(step, reverse(visits)), [ step, visits ]);
|
||||
const [ labels, groupedVisits ] = useMemo(
|
||||
() => generateLabelsAndGroupedVisits(visits, groupedVisitsWithGaps, step, skipNoVisits),
|
||||
[ visits, step, skipNoVisits ]
|
||||
[ visits, step, skipNoVisits ],
|
||||
);
|
||||
const groupedHighlighted = useMemo(
|
||||
() => fillTheGaps(groupVisitsByStep(step, reverse(highlightedVisits)), labels),
|
||||
|
||||
Reference in New Issue
Block a user