migrate ui-components from flow to typescript

This commit is contained in:
Sebastian Sdorra
2019-10-20 16:59:02 +02:00
parent c41efbdc4f
commit f49e17a3a7
151 changed files with 2039 additions and 25265 deletions

View File

@@ -1,4 +1,4 @@
import React from 'react';
import React from "react";
type Props = {
bytes: number;
@@ -7,10 +7,10 @@ type Props = {
class FileSize extends React.Component<Props> {
static format(bytes: number) {
if (!bytes) {
return '0 B';
return "0 B";
}
const units = ['B', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
const units = ["B", "K", "M", "G", "T", "P", "E", "Z", "Y"];
const i = Math.floor(Math.log(bytes) / Math.log(1000));
const size = i === 0 ? bytes : (bytes / 1000 ** i).toFixed(2);