Skip to content

Commit

Permalink
refactor: remove redundant propTypes in ColumnElement (#18144)
Browse files Browse the repository at this point in the history
* Remove redundant propTypes

* Refactoring

* Refactoring
  • Loading branch information
EugeneTorap committed Feb 7, 2022
1 parent cebff83 commit 85c8d01
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions superset-frontend/src/SqlLab/components/ColumnElement/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,10 @@
* under the License.
*/
import React from 'react';
import PropTypes from 'prop-types';
import { ClassNames } from '@emotion/react';
import { styled, useTheme } from '@superset-ui/core';

import { Tooltip } from 'src/components/Tooltip';

const propTypes = {
column: PropTypes.object.isRequired,
};

const StyledTooltip = (props: any) => {
const theme = useTheme();
return (
Expand Down Expand Up @@ -64,6 +58,7 @@ const iconMap = {
fk: 'fa-link',
index: 'fa-bookmark',
};

const tooltipTitleMap = {
pk: 'Primary key',
fk: 'Foreign key',
Expand All @@ -80,7 +75,7 @@ interface ColumnElementProps {
};
}

export default function ColumnElement({ column }: ColumnElementProps) {
const ColumnElement = ({ column }: ColumnElementProps) => {
let columnName: React.ReactNode = column.name;
let icons;
if (column.keys && column.keys.length > 0) {
Expand Down Expand Up @@ -115,5 +110,6 @@ export default function ColumnElement({ column }: ColumnElementProps) {
</div>
</div>
);
}
ColumnElement.propTypes = propTypes;
};

export default ColumnElement;

0 comments on commit 85c8d01

Please sign in to comment.