From fdadfeb8e6a138469a11c2f1f2c5defc5939c386 Mon Sep 17 00:00:00 2001 From: Katarzyna Zadurska Date: Thu, 10 Mar 2022 15:41:55 +0100 Subject: [PATCH] Replace react SFC Functional components cannot be consideres stateless --- CONTRIBUTING.md | 2 +- package-lock.json | 14 +++++++------- package.json | 4 ++-- .../auto-refresh-menu/auto-refresh-menu.tsx | 2 +- .../components/bubble-title/bubble-title.tsx | 2 +- .../components/clearable-input/clearable-input.tsx | 2 +- .../components/color-legend/color-legend.tsx | 2 +- src/client/components/color-swabs/color-swabs.tsx | 2 +- src/client/components/debug-menu/debug-menu.tsx | 2 +- src/client/components/delta/delta.tsx | 2 +- .../dimension-actions-menu.tsx | 4 ++-- .../dimension-list-tile/dimension-item.tsx | 2 +- .../components/drag-indicator/drag-indicator.tsx | 2 +- src/client/components/filter-menu/filter-menu.tsx | 2 +- .../time-filter-menu/time-filter-menu.tsx | 2 +- .../time-filter-menu/time-shift-selector.tsx | 2 +- src/client/components/filter-tile/add-filter.tsx | 2 +- src/client/components/filter-tile/filter-tile.tsx | 2 +- src/client/components/filter-tile/filter-tiles.tsx | 2 +- .../components/filter-tile/partial-filter-tile.tsx | 2 +- src/client/components/grid-border/grid-border.tsx | 4 ++-- src/client/components/grid-lines/grid-lines.tsx | 2 +- src/client/components/header-bar/header-bar.tsx | 2 +- .../components/highlight-modal/highlight-modal.tsx | 2 +- .../highlight-string/highlight-string.tsx | 2 +- .../string-input-with-presets.tsx | 2 +- .../components/markdown-node/markdown-node.tsx | 2 +- .../add-arithmetic-operation.tsx | 2 +- .../measure-actions-menu/add-measure-series.tsx | 2 +- .../measure-actions-menu/add-percent-series.tsx | 2 +- .../measure-actions-menu/add-quantile-series.tsx | 2 +- .../measure-actions-menu/measure-actions-menu.tsx | 2 +- .../measure-bubble-content.tsx | 2 +- .../components/measures-tile/measure-item.tsx | 2 +- .../components/message-card/message-card.tsx | 2 +- .../components/message-panel/message-panel.tsx | 4 ++-- src/client/components/message/message.tsx | 2 +- src/client/components/nav-list/nav-list.tsx | 2 +- src/client/components/nav-logo/nav-logo.tsx | 2 +- .../components/no-data/data-cube-not-found.tsx | 2 +- .../pinboard-measure-tile.tsx | 2 +- .../components/pinboard-panel/pinboard-tiles.tsx | 2 +- src/client/components/pinboard-tile/data-rows.tsx | 4 ++-- .../components/pinboard-tile/pinboard-dataset.tsx | 2 +- .../components/pinboard-tile/selectable-row.tsx | 2 +- .../components/pinboard-tile/selectable-rows.tsx | 2 +- src/client/components/pinboard-tile/text-row.tsx | 2 +- src/client/components/pinboard-tile/text-rows.tsx | 2 +- .../preview-string-filter-menu/preview-list.tsx | 2 +- src/client/components/query-error/query-error.tsx | 2 +- .../components/segment-bubble/segment-bubble.tsx | 4 ++-- .../selectable-string-filter-menu/string-value.tsx | 2 +- .../string-values-list.tsx | 2 +- .../series-bubble-content.tsx | 2 +- .../series-menu/arithmetic-series-menu.tsx | 2 +- .../components/series-menu/format-picker.tsx | 2 +- .../components/series-menu/measure-series-menu.tsx | 2 +- .../components/series-menu/percent-series-menu.tsx | 2 +- .../components/series-menu/quantile-picker.tsx | 2 +- .../series-menu/quantile-series-menu.tsx | 2 +- src/client/components/series-tile/add-series.tsx | 2 +- .../components/series-tile/placeholder-series.tsx | 2 +- src/client/components/series-tile/series-tile.tsx | 2 +- src/client/components/series-tile/series-tiles.tsx | 2 +- .../components/split-menu/granularity-picker.tsx | 2 +- .../components/split-menu/limit-dropdown.tsx | 2 +- src/client/components/split-menu/sort-dropdown.tsx | 2 +- src/client/components/split-tile/add-split.tsx | 2 +- src/client/components/split-tile/split-tile.tsx | 4 ++-- .../components/split-tile/split-tiles-row.tsx | 2 +- src/client/components/split-tile/split-tiles.tsx | 2 +- .../components/tabular-scroller/corner/corner.tsx | 2 +- .../header/measures/measure-header-cell.tsx | 2 +- .../header/measures/measures-header.tsx | 2 +- .../header/splits/split-columns.tsx | 2 +- .../measures/measure-background.tsx | 2 +- .../tabular-scroller/measures/measure-cell.tsx | 2 +- .../tabular-scroller/measures/measure-row.tsx | 2 +- .../tabular-scroller/measures/measure-rows.tsx | 2 +- .../tabular-scroller/measures/measure-value.tsx | 2 +- .../tabular-scroller/sort-icon/sort-icon.tsx | 2 +- .../splits/flattened-split-columns.tsx | 2 +- .../tabular-scroller/splits/flattened-splits.tsx | 2 +- .../tabular-scroller/splits/split-value.tsx | 2 +- .../tabular-scroller/visible-rows/visible-rows.tsx | 2 +- .../tile-overflow-container.tsx | 4 ++-- .../components/timezone-menu/timezone-menu.tsx | 2 +- .../components/vertical-axis/vertical-axis.tsx | 2 +- .../vis-measure-label/vis-measure-label.tsx | 2 +- .../components/vis-selector/vis-selector-item.tsx | 2 +- .../modals/druid-query-modal/druid-query-modal.tsx | 2 +- .../url-shortener-modal/url-shortener-modal.tsx | 2 +- .../view-definition-modal.tsx | 2 +- src/client/oauth/oauth-message-view.tsx | 2 +- src/client/utils/teleporter/teleporter.tsx | 4 ++-- .../views/cube-view/center-panel/center-panel.tsx | 6 +++--- src/client/views/cube-view/cube-view.tsx | 2 +- src/client/views/error-view/general-error.tsx | 2 +- .../bar-chart/improved-bar-chart/bar-chart.tsx | 2 +- .../improved-bar-chart/bar-charts/bar-charts.tsx | 2 +- .../improved-bar-chart/bar/single-bar.tsx | 2 +- .../bar/single-time-shift-bar.tsx | 2 +- .../improved-bar-chart/bar/stacked-bar.tsx | 2 +- .../bar/stacked-time-shift-bar.tsx | 2 +- .../improved-bar-chart/bars/background.tsx | 2 +- .../bar-chart/improved-bar-chart/bars/bars.tsx | 4 ++-- .../improved-bar-chart/foreground/foreground.tsx | 2 +- .../foreground/highlight-modal.tsx | 2 +- .../foreground/highlight-overlay.tsx | 2 +- .../hover-tooltip/hover-tooltip.tsx | 2 +- .../hover-tooltip/tooltip-content.tsx | 2 +- .../bar-chart/improved-bar-chart/legend/Legend.tsx | 4 ++-- .../bar-chart/improved-bar-chart/spacer/spacer.tsx | 2 +- .../bar-chart/improved-bar-chart/x-axis/x-axis.tsx | 2 +- .../improved-bar-chart/y-axis/single-y-axis.tsx | 2 +- .../bar-chart/improved-bar-chart/y-axis/y-axis.tsx | 2 +- src/client/visualizations/grid/grid-split-menu.tsx | 2 +- src/client/visualizations/grid/grid-split-tile.tsx | 2 +- src/client/visualizations/grid/grid.tsx | 2 +- src/client/visualizations/grid/scrolled-grid.tsx | 2 +- src/client/visualizations/grid/split-labels.tsx | 2 +- .../visualizations/grid/visualization-controls.tsx | 2 +- .../visualizations/heat-map/heatmap-corner.tsx | 2 +- .../heat-map/heatmap-highlight-indicator.tsx | 6 +++--- .../heat-map/heatmap-highlight-modal.tsx | 2 +- .../heat-map/heatmap-hover-indicator.tsx | 2 +- .../heat-map/heatmap-hover-tooltip.tsx | 2 +- .../base-chart/background/background.tsx | 2 +- .../base-chart/foreground/foreground.tsx | 2 +- .../base-chart/foreground/highlight-modal.tsx | 2 +- .../base-chart/foreground/hover-guide.tsx | 2 +- .../base-chart/foreground/hover-tooltip.tsx | 2 +- .../base-chart/foreground/selection-overlay.tsx | 2 +- .../line-chart/chart-line/chart-line.tsx | 2 +- .../chart-line/colored-series-chart-line.tsx | 2 +- .../line-chart/chart-line/series-chart-line.tsx | 2 +- .../chart-line/singleton-series-chart-line.tsx | 2 +- .../charts/charts-per-series/charts-per-series.tsx | 2 +- .../charts/charts-per-series/series-chart.tsx | 2 +- .../charts-per-series/series-hover-content.tsx | 2 +- .../charts/charts-per-split/charts-per-split.tsx | 2 +- .../line-chart/charts/charts-per-split/label.tsx | 2 +- .../charts/charts-per-split/split-chart.tsx | 2 +- .../charts-per-split/split-hover-content.tsx | 4 ++-- .../visualizations/line-chart/charts/charts.tsx | 2 +- .../visualizations/line-chart/legend/legend.tsx | 4 ++-- .../line-chart/legend/series-legend.tsx | 2 +- .../line-chart/legend/split-legend.tsx | 2 +- .../visualizations/line-chart/x-axis/x-axis.tsx | 2 +- src/client/visualizations/scatterplot/heatmap.tsx | 4 ++-- src/client/visualizations/scatterplot/point.tsx | 2 +- src/client/visualizations/scatterplot/tooltip.tsx | 2 +- src/client/visualizations/scatterplot/x-axis.tsx | 2 +- src/client/visualizations/scatterplot/y-axis.tsx | 2 +- .../table/body/splits/nested-splits.tsx | 2 +- .../table/body/splits/split-rows.tsx | 2 +- .../table/header/splits/combined-splits-title.tsx | 2 +- .../table/header/splits/splits-header.tsx | 2 +- .../visualizations/table/highlight/highlight.tsx | 2 +- .../table/scrolled-table/scrolled-table.tsx | 2 +- src/client/visualizations/totals/total.tsx | 4 ++-- src/client/visualizations/totals/totals.tsx | 2 +- .../visualization-settings.ts | 2 +- 163 files changed, 188 insertions(+), 188 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 25ee4d29d..95bd4236e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,7 +45,7 @@ Create a new file [src/client/visualizations/](https://github.com/allegro/turnil Here you want to add the basis for your component with the visualization panel at the top: ``` -const : React.SFC = () => { +const : React.FunctionComponent = () => { return

New visualization will be here!

; diff --git a/package-lock.json b/package-lock.json index 226c114f4..7e988af48 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2843,9 +2843,9 @@ "dev": true }, "@types/react": { - "version": "16.14.23", - "resolved": "https://registry.npmjs.org/@types/react/-/react-16.14.23.tgz", - "integrity": "sha512-WngBZLuSkP4IAgPi0HOsGCHo6dn3CcuLQnCfC17VbA7YBgipZiZoTOhObwl/93DsFW0Y2a/ZXeonpW4DxirEJg==", + "version": "16.14.24", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.14.24.tgz", + "integrity": "sha512-e7U2WC8XQP/xfR7bwhOhNFZKPTfW1ph+MiqtudKb8tSV8RyCsovQx2sNVtKoOryjxFKpHPPC/yNiGfdeVM5Gyw==", "dev": true, "requires": { "@types/prop-types": "*", @@ -2863,12 +2863,12 @@ } }, "@types/react-dom": { - "version": "16.0.11", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.0.11.tgz", - "integrity": "sha512-x6zUx9/42B5Kl2Vl9HlopV8JF64wLpX3c+Pst9kc1HgzrsH+mkehe/zmHMQTplIrR48H2gpU7ZqurQolYu8XBA==", + "version": "16.9.14", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.9.14.tgz", + "integrity": "sha512-FIX2AVmPTGP30OUJ+0vadeIFJJ07Mh1m+U0rxfgyW34p3rTlXI+nlenvAxNn4BP36YyI9IJ/+UJ7Wu22N1pI7A==", "dev": true, "requires": { - "@types/react": "*" + "@types/react": "^16" } }, "@types/react-syntax-highlighter": { diff --git a/package.json b/package.json index 4be8fd222..5df0cae3a 100644 --- a/package.json +++ b/package.json @@ -136,9 +136,9 @@ "@types/node": "8.5.2", "@types/nopt": "3.0.29", "@types/randomstring": "1.1.6", - "@types/react": "16.14.23", + "@types/react": "16.14.24", "@types/react-copy-to-clipboard": "4.3.0", - "@types/react-dom": "16.0.11", + "@types/react-dom": "16.9.14", "@types/react-syntax-highlighter": "13.5.2", "@types/react-transition-group": "2.0.7", "@types/request-promise-native": "1.0.14", diff --git a/src/client/components/auto-refresh-menu/auto-refresh-menu.tsx b/src/client/components/auto-refresh-menu/auto-refresh-menu.tsx index af42d2eb6..464d9103d 100644 --- a/src/client/components/auto-refresh-menu/auto-refresh-menu.tsx +++ b/src/client/components/auto-refresh-menu/auto-refresh-menu.tsx @@ -84,7 +84,7 @@ function updatedText(dataCube: ClientDataCube, timekeeper: Timekeeper, timezone: } } -export const AutoRefreshMenu: React.SFC = ({ autoRefreshRate, setAutoRefreshRate, openOn, onClose, dataCube, refreshMaxTime, timekeeper, timezone }) => +export const AutoRefreshMenu: React.FunctionComponent = ({ autoRefreshRate, setAutoRefreshRate, openOn, onClose, dataCube, refreshMaxTime, timekeeper, timezone }) => = ({ title }) => { +export const BubbleTitle: React.FunctionComponent = ({ title }) => { const minWidth = clamp(title.length * PER_LETTER_PIXELS, MIN_TITLE_WIDTH, MAX_TITLE_WIDTH); return
{title}
; }; diff --git a/src/client/components/clearable-input/clearable-input.tsx b/src/client/components/clearable-input/clearable-input.tsx index 3ffaddcd1..56527f8bd 100644 --- a/src/client/components/clearable-input/clearable-input.tsx +++ b/src/client/components/clearable-input/clearable-input.tsx @@ -36,7 +36,7 @@ export interface ClearableInputProps { onBlur?: React.FocusEventHandler; } -export const ClearableInput: React.SFC = ({ className, placeholder, focusOnMount, onBlur, onChange, value = "", type = "text" }) => { +export const ClearableInput: React.FunctionComponent = ({ className, placeholder, focusOnMount, onBlur, onChange, value = "", type = "text" }) => { const change = (e: React.ChangeEvent) => onChange(e.target.value); const clear = () => onChange(""); diff --git a/src/client/components/color-legend/color-legend.tsx b/src/client/components/color-legend/color-legend.tsx index adcd36f4f..400f50082 100644 --- a/src/client/components/color-legend/color-legend.tsx +++ b/src/client/components/color-legend/color-legend.tsx @@ -37,7 +37,7 @@ const stripeWidth = 30; const stripeHeight = 200; const panelWidth = 100; -export const ColorLegend: React.SFC = ({ title, width = panelWidth, height = stripeHeight, formatter, colorScale }) => { +export const ColorLegend: React.FunctionComponent = ({ title, width = panelWidth, height = stripeHeight, formatter, colorScale }) => { const [min, max] = colorScale.domain(); if (isNaN(min) || isNaN(max)) return null; diff --git a/src/client/components/color-swabs/color-swabs.tsx b/src/client/components/color-swabs/color-swabs.tsx index 05dcdddc1..6790a70a8 100644 --- a/src/client/components/color-swabs/color-swabs.tsx +++ b/src/client/components/color-swabs/color-swabs.tsx @@ -22,7 +22,7 @@ interface ColorSwabsProps { colorEntries: ColorEntry[]; } -export const ColorSwabs: React.SFC = ({ colorEntries }) => { +export const ColorSwabs: React.FunctionComponent = ({ colorEntries }) => { const colorSwabs = colorEntries.map(({ color, name, value, previous, delta }: ColorEntry) => { const swabStyle = { background: color }; return diff --git a/src/client/components/debug-menu/debug-menu.tsx b/src/client/components/debug-menu/debug-menu.tsx index ae973b103..1faf08458 100644 --- a/src/client/components/debug-menu/debug-menu.tsx +++ b/src/client/components/debug-menu/debug-menu.tsx @@ -30,7 +30,7 @@ export interface DebugMenuProps { dataCube: ClientDataCube; } -export const DebugMenu: React.SFC = ({ dataCube, openOn, onClose, openDruidQueryModal, openRawDataModal, openViewDefinitionModal }) => { +export const DebugMenu: React.FunctionComponent = ({ dataCube, openOn, onClose, openDruidQueryModal, openRawDataModal, openViewDefinitionModal }) => { const isNativeCluster = dataCube.clusterName === "native"; diff --git a/src/client/components/delta/delta.tsx b/src/client/components/delta/delta.tsx index 00b4d592d..0f035eb6a 100644 --- a/src/client/components/delta/delta.tsx +++ b/src/client/components/delta/delta.tsx @@ -76,7 +76,7 @@ export interface DeltaProps { lowerIsBetter?: boolean; } -export const Delta: React.SFC = ({ lowerIsBetter, currentValue, previousValue, formatter }) => { +export const Delta: React.FunctionComponent = ({ lowerIsBetter, currentValue, previousValue, formatter }) => { const formattedDelta = formatDelta(currentValue, previousValue); if (formattedDelta === null) { return -; diff --git a/src/client/components/dimension-actions-menu/dimension-actions-menu.tsx b/src/client/components/dimension-actions-menu/dimension-actions-menu.tsx index 17e700a13..c97f70962 100644 --- a/src/client/components/dimension-actions-menu/dimension-actions-menu.tsx +++ b/src/client/components/dimension-actions-menu/dimension-actions-menu.tsx @@ -44,7 +44,7 @@ export interface DimensionActionsProps { addPartialFilter: (dimension: Dimension) => void; } -export const DimensionActionsMenu: React.SFC = +export const DimensionActionsMenu: React.FunctionComponent = (props: DimensionActionsMenuProps & DimensionActionsProps) => { const { addPartialFilter, clicker, essence, direction, containerStage, openOn, dimension, onClose } = props; return ; }; -export const DimensionActions: React.SFC = (props: DimensionActionsProps) => { +export const DimensionActions: React.FunctionComponent = (props: DimensionActionsProps) => { const { onClose, addPartialFilter, clicker, essence: { splits, filter }, dimension } = props; if (!dimension) return null; diff --git a/src/client/components/dimension-list-tile/dimension-item.tsx b/src/client/components/dimension-list-tile/dimension-item.tsx index 5bc23f09e..548ef857d 100644 --- a/src/client/components/dimension-list-tile/dimension-item.tsx +++ b/src/client/components/dimension-list-tile/dimension-item.tsx @@ -39,7 +39,7 @@ export interface DimensionItemProps { export type DimensionClickHandler = (dimensionName: string, e: MouseEvent) => void; export type DimensionDragStartHandler = (dimensionName: string, e: DragEvent) => void; -export const DimensionItem: React.SFC = ({ name, title, dimensionClick, dimensionDragStart, description, searchText, kind, selected }) => { +export const DimensionItem: React.FunctionComponent = ({ name, title, dimensionClick, dimensionDragStart, description, searchText, kind, selected }) => { const infoBubbleClassName = "info-icon"; const className = classNames(DIMENSION_CLASS_NAME, { selected }); diff --git a/src/client/components/drag-indicator/drag-indicator.tsx b/src/client/components/drag-indicator/drag-indicator.tsx index 24a8aba82..2ba4ae458 100644 --- a/src/client/components/drag-indicator/drag-indicator.tsx +++ b/src/client/components/drag-indicator/drag-indicator.tsx @@ -27,7 +27,7 @@ interface DragIndicatorProps { dragPosition?: DragPosition; } -export const DragIndicator: React.SFC = props => { +export const DragIndicator: React.FunctionComponent = props => { const { dragPosition, dragOver, drop, dragLeave } = props; if (!dragPosition) return null; return diff --git a/src/client/components/filter-menu/filter-menu.tsx b/src/client/components/filter-menu/filter-menu.tsx index eaa748414..75d04451e 100644 --- a/src/client/components/filter-menu/filter-menu.tsx +++ b/src/client/components/filter-menu/filter-menu.tsx @@ -43,7 +43,7 @@ export interface FilterMenuProps { onClose: Fn; } -export const FilterMenu: React.SFC = ({ dimension, ...props }: FilterMenuProps) => { +export const FilterMenu: React.FunctionComponent = ({ dimension, ...props }: FilterMenuProps) => { if (!dimension) return null; switch (dimension.kind) { case "time": diff --git a/src/client/components/filter-menu/time-filter-menu/time-filter-menu.tsx b/src/client/components/filter-menu/time-filter-menu/time-filter-menu.tsx index 7b16500c0..ed2c5e2a5 100644 --- a/src/client/components/filter-menu/time-filter-menu/time-filter-menu.tsx +++ b/src/client/components/filter-menu/time-filter-menu/time-filter-menu.tsx @@ -43,7 +43,7 @@ function tabTitle(tab: TimeFilterTab) { return tab === TimeFilterTab.RELATIVE ? STRINGS.relative : STRINGS.fixed; } -const TabSelector: React.SFC = props => { +const TabSelector: React.FunctionComponent = props => { const { selectedTab, onTabSelect } = props; const tabs = [TimeFilterTab.RELATIVE, TimeFilterTab.FIXED].map(tab => { return { diff --git a/src/client/components/filter-menu/time-filter-menu/time-shift-selector.tsx b/src/client/components/filter-menu/time-filter-menu/time-shift-selector.tsx index 20d31c2d8..c54020345 100644 --- a/src/client/components/filter-menu/time-filter-menu/time-shift-selector.tsx +++ b/src/client/components/filter-menu/time-filter-menu/time-shift-selector.tsx @@ -65,7 +65,7 @@ function presets(dimension: TimeDimension): Array> { ]; } -export const TimeShiftSelector: React.SFC = props => { +export const TimeShiftSelector: React.FunctionComponent = props => { const { onShiftChange, dimension, shift: selectedTimeShift } = props; const timeShiftPreview = timeShiftPreviewForRange(props); diff --git a/src/client/components/filter-tile/add-filter.tsx b/src/client/components/filter-tile/add-filter.tsx index c7b00a15d..10fbfe0ab 100644 --- a/src/client/components/filter-tile/add-filter.tsx +++ b/src/client/components/filter-tile/add-filter.tsx @@ -28,7 +28,7 @@ interface AddFilterProps { essence: Essence; } -export const AddFilter: React.SFC = props => { +export const AddFilter: React.FunctionComponent = props => { const { appendFilter, menuStage, essence: { filter, dataCube } } = props; const tiles = allDimensions(dataCube.dimensions) .filter(dimension => !filter.getClauseForDimension(dimension)) diff --git a/src/client/components/filter-tile/filter-tile.tsx b/src/client/components/filter-tile/filter-tile.tsx index e0103f355..c123c7dc6 100644 --- a/src/client/components/filter-tile/filter-tile.tsx +++ b/src/client/components/filter-tile/filter-tile.tsx @@ -80,7 +80,7 @@ interface FilterTileProps { export const FILTER_CLASS_NAME = "filter"; -export const FilterTile: React.SFC = props => { +export const FilterTile: React.FunctionComponent = props => { const { clause, open, diff --git a/src/client/components/filter-tile/filter-tiles.tsx b/src/client/components/filter-tile/filter-tiles.tsx index 13b96ee07..44e779eeb 100644 --- a/src/client/components/filter-tile/filter-tiles.tsx +++ b/src/client/components/filter-tile/filter-tiles.tsx @@ -54,7 +54,7 @@ interface FilterTilesProps { openOverflowMenu: Fn; } -export const FilterTiles: React.SFC = props => { +export const FilterTiles: React.FunctionComponent = props => { const { menuStage, maxItems, diff --git a/src/client/components/filter-tile/partial-filter-tile.tsx b/src/client/components/filter-tile/partial-filter-tile.tsx index 597846182..68041d15f 100644 --- a/src/client/components/filter-tile/partial-filter-tile.tsx +++ b/src/client/components/filter-tile/partial-filter-tile.tsx @@ -41,7 +41,7 @@ interface PartialFilterTileProps { closeItem: Fn; } -export const PartialFilterTile: React.SFC = props => { +export const PartialFilterTile: React.FunctionComponent = props => { const { closeItem, saveClause, essence, timekeeper, locale, clicker, stage, dimension, style } = props; return {({ ref: openOn, setRef }) =>
= ({ stage, tickLength }) => { +export const BottomBorder: React.FunctionComponent = ({ stage, tickLength }) => { return = ({ stage }) => { +export const RightBorder: React.FunctionComponent = ({ stage }) => { return = props => { +export const GridLines: React.FunctionComponent = props => { const { orientation, stage, ticks, scale } = props; return diff --git a/src/client/components/header-bar/header-bar.tsx b/src/client/components/header-bar/header-bar.tsx index b1ac189ae..c8776248b 100644 --- a/src/client/components/header-bar/header-bar.tsx +++ b/src/client/components/header-bar/header-bar.tsx @@ -24,7 +24,7 @@ export interface HeaderBarProps { title?: string; } -export const HeaderBar: React.SFC = props => { +export const HeaderBar: React.FunctionComponent = props => { const { customization, title } = props; const headerStyle: React.CSSProperties = customization && customization.headerBackground && { background: customization.headerBackground }; diff --git a/src/client/components/highlight-modal/highlight-modal.tsx b/src/client/components/highlight-modal/highlight-modal.tsx index f410d94fc..83842fc12 100644 --- a/src/client/components/highlight-modal/highlight-modal.tsx +++ b/src/client/components/highlight-modal/highlight-modal.tsx @@ -30,7 +30,7 @@ interface HighlightModalProps { acceptHighlight: Fn; } -export const HighlightModal: React.SFC = ({ title, children, left, top, acceptHighlight, dropHighlight }) => +export const HighlightModal: React.FunctionComponent = ({ title, children, left, top, acceptHighlight, dropHighlight }) =>
{children}
diff --git a/src/client/components/highlight-string/highlight-string.tsx b/src/client/components/highlight-string/highlight-string.tsx index bc82db54b..6ae93f276 100644 --- a/src/client/components/highlight-string/highlight-string.tsx +++ b/src/client/components/highlight-string/highlight-string.tsx @@ -48,6 +48,6 @@ function highlightBy(text: string, highlight: string | RegExp): string | JSX.Ele return highlightByIndex(text, startIndex, startIndex + match[0].length); } -export const HighlightString: React.SFC = ({ className, text, highlight }) => { +export const HighlightString: React.FunctionComponent = ({ className, text, highlight }) => { return {highlightBy(text, highlight)}; }; diff --git a/src/client/components/input-with-presets/string-input-with-presets.tsx b/src/client/components/input-with-presets/string-input-with-presets.tsx index a258a6ba5..471bf84ce 100644 --- a/src/client/components/input-with-presets/string-input-with-presets.tsx +++ b/src/client/components/input-with-presets/string-input-with-presets.tsx @@ -20,5 +20,5 @@ import { InputWithPresets, InputWithPresetsProps } from "./input-with-presets"; type StringInputWithPresetsProps = Omit, "parseCustomValue" | "formatCustomValue">; -export const StringInputWithPresets: React.SFC = props => +export const StringInputWithPresets: React.FunctionComponent = props => {...props} parseCustomValue={identity} formatCustomValue={identity} />; diff --git a/src/client/components/markdown-node/markdown-node.tsx b/src/client/components/markdown-node/markdown-node.tsx index 4e6b9ac4f..9717aa499 100644 --- a/src/client/components/markdown-node/markdown-node.tsx +++ b/src/client/components/markdown-node/markdown-node.tsx @@ -26,7 +26,7 @@ function innerMarkdown(input: string): { __html: string } { return { __html: snarkdown(input) }; } -export const MarkdownNode: React.SFC = ({ markdown }) => { +export const MarkdownNode: React.FunctionComponent = ({ markdown }) => { return
; diff --git a/src/client/components/measure-actions-menu/add-arithmetic-operation.tsx b/src/client/components/measure-actions-menu/add-arithmetic-operation.tsx index cc3ed2029..36cc11b16 100644 --- a/src/client/components/measure-actions-menu/add-arithmetic-operation.tsx +++ b/src/client/components/measure-actions-menu/add-arithmetic-operation.tsx @@ -31,7 +31,7 @@ interface AddPercentSeriesButtonProps { onClose: Fn; } -export const AddArithmeticOperationButton: React.SFC = props => { +export const AddArithmeticOperationButton: React.FunctionComponent = props => { const { measure, addPartialSeries, onClose } = props; function onNewOperation() { diff --git a/src/client/components/measure-actions-menu/add-measure-series.tsx b/src/client/components/measure-actions-menu/add-measure-series.tsx index b3f497719..1bc677f99 100644 --- a/src/client/components/measure-actions-menu/add-measure-series.tsx +++ b/src/client/components/measure-actions-menu/add-measure-series.tsx @@ -32,7 +32,7 @@ interface AddMeasureSeriesButtonProps { onClose: Fn; } -export const AddMeasureSeriesButton: React.SFC = props => { +export const AddMeasureSeriesButton: React.FunctionComponent = props => { const { series, measure, onClose, addSeries } = props; const measureDisabled = series.hasMeasure(measure); diff --git a/src/client/components/measure-actions-menu/add-percent-series.tsx b/src/client/components/measure-actions-menu/add-percent-series.tsx index 3e26b3310..b9b7f48d8 100644 --- a/src/client/components/measure-actions-menu/add-percent-series.tsx +++ b/src/client/components/measure-actions-menu/add-percent-series.tsx @@ -39,7 +39,7 @@ interface AddPercentSeriesButtonProps { onClose: Fn; } -export const AddPercentSeriesButton: React.SFC = props => { +export const AddPercentSeriesButton: React.FunctionComponent = props => { const { series, measure, addSeries, onClose } = props; const percentSeries: Set = series diff --git a/src/client/components/measure-actions-menu/add-quantile-series.tsx b/src/client/components/measure-actions-menu/add-quantile-series.tsx index 62424b788..3ca3d2a07 100644 --- a/src/client/components/measure-actions-menu/add-quantile-series.tsx +++ b/src/client/components/measure-actions-menu/add-quantile-series.tsx @@ -33,7 +33,7 @@ interface AddQuantileSeriesButtonProps { onClose: Fn; } -export const AddQuantileSeriesButton: React.SFC = props => { +export const AddQuantileSeriesButton: React.FunctionComponent = props => { const { series, measure, addPartialSeries, addSeries, onClose } = props; function onNewQuantileSeries() { diff --git a/src/client/components/measure-actions-menu/measure-actions-menu.tsx b/src/client/components/measure-actions-menu/measure-actions-menu.tsx index 69b6374b8..6324f4fb1 100644 --- a/src/client/components/measure-actions-menu/measure-actions-menu.tsx +++ b/src/client/components/measure-actions-menu/measure-actions-menu.tsx @@ -47,7 +47,7 @@ export interface MeasureActionsProps { onClose: Fn; } -export const MeasureActionsMenu: React.SFC = props => { +export const MeasureActionsMenu: React.FunctionComponent = props => { const { direction, containerStage, openOn, measure, onClose } = props; if (!measure) return null; diff --git a/src/client/components/measure-bubble-content/measure-bubble-content.tsx b/src/client/components/measure-bubble-content/measure-bubble-content.tsx index 9bf562657..d015b3259 100644 --- a/src/client/components/measure-bubble-content/measure-bubble-content.tsx +++ b/src/client/components/measure-bubble-content/measure-bubble-content.tsx @@ -26,7 +26,7 @@ export interface MeasureBubbleContentProps { lowerIsBetter?: boolean; } -export const MeasureBubbleContent: React.SFC = ({ lowerIsBetter, formatter, current, previous }) => { +export const MeasureBubbleContent: React.FunctionComponent = ({ lowerIsBetter, formatter, current, previous }) => { const currentValue = formatter(current); const previousValue = formatter(previous); return diff --git a/src/client/components/measures-tile/measure-item.tsx b/src/client/components/measures-tile/measure-item.tsx index 90e01101a..66a05b91f 100644 --- a/src/client/components/measures-tile/measure-item.tsx +++ b/src/client/components/measures-tile/measure-item.tsx @@ -36,7 +36,7 @@ export interface MeasureItemProps { searchText: string; } -export const MeasureItem: React.SFC = ({ title, name, measureDragStart, measureClick, description, searchText, approximate, selected }) => { +export const MeasureItem: React.FunctionComponent = ({ title, name, measureDragStart, measureClick, description, searchText, approximate, selected }) => { const infoBubbleClassName = "measure-info-icon"; const handleClick = (e: MouseEvent) => { diff --git a/src/client/components/message-card/message-card.tsx b/src/client/components/message-card/message-card.tsx index 10b5bdf70..36919924f 100644 --- a/src/client/components/message-card/message-card.tsx +++ b/src/client/components/message-card/message-card.tsx @@ -21,7 +21,7 @@ interface MessageCardProps { title: string; } -export const MessageCard: React.SFC = props => { +export const MessageCard: React.FunctionComponent = props => { const { title, children } = props; return
{title}
diff --git a/src/client/components/message-panel/message-panel.tsx b/src/client/components/message-panel/message-panel.tsx index 0b870487e..b3085042b 100644 --- a/src/client/components/message-panel/message-panel.tsx +++ b/src/client/components/message-panel/message-panel.tsx @@ -24,7 +24,7 @@ interface ErrorViewActionProps { label: string; } -export const MessagePanelAction: React.SFC = ({ action, label }) => +export const MessagePanelAction: React.FunctionComponent = ({ action, label }) =>