Installed TS and updated linter

This commit is contained in:
Alejandro Celaya
2020-08-22 08:06:41 +02:00
parent 8be17cce8a
commit 343a93b984
7 changed files with 1983 additions and 338 deletions

View File

@@ -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])

View File

@@ -33,7 +33,7 @@ export default class ColorGenerator {
this.storage.set('colors', this.colors);
return color;
}
};
}
export const colorGeneratorType = PropTypes.shape({

View File

@@ -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),