From a17b76ac75f506f5da6fe8adf9c36632b60d4226 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 26 Sep 2020 14:56:02 +0200 Subject: refactor to use app-rooted js imports --- frontend/common/miscellaneous.component.js | 71 ------------------------------ 1 file changed, 71 deletions(-) delete mode 100644 frontend/common/miscellaneous.component.js (limited to 'frontend/common/miscellaneous.component.js') diff --git a/frontend/common/miscellaneous.component.js b/frontend/common/miscellaneous.component.js deleted file mode 100644 index cf12ef5..0000000 --- a/frontend/common/miscellaneous.component.js +++ /dev/null @@ -1,71 +0,0 @@ -import React, { Component } from 'react'; -import { Link } from 'react-router-dom' -import { clamp, percent } from '../util' - -export const Swatch = ({ color }) => ( -
-) - -export const Dot = ({ color }) => ( -
-) - -export const Columns = ({ count, margin, width, object, children, className }) => { - if (!object || !object.length) object = children - if (!object || !object.length) return null - margin = margin || 380 - width = width || 250 - count = count || Math.floor((window.innerWidth - margin) / width) - let columns = [] - let len = object.length - let j = 0 - for (let i = 0; i < count; i++) { - let column_len = len * (i + 1) / count - let column = [] - for (; j < column_len; j++) { - column.push(
{object[j]}
) - } - columns.push(
{column}
) - if (j >= len) break - } - return ( -
- {columns} -
- ) -} - -export const Statistic = ({ name, value, link }) => ( -
-
{link ? {name} : name}
-
{value}
-
-) - -export const Detections = ({ detections, labels }) => ( - (detections || []).map(({ label, rect }, i) => ( -
- {labels && {label.replace(/_/g, ' ')}} -
- ) -)) - -export const Progress = ({ current, total }) => ( -
-
-
-) -- cgit v1.2.3-70-g09d2