Skip to content

Commit

Permalink
Review corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
dariaterekhova-actionengine committed Sep 6, 2022
1 parent 255893c commit eccb928
Show file tree
Hide file tree
Showing 17 changed files with 68 additions and 45 deletions.
1 change: 1 addition & 0 deletions src/cloud-providers/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
export {default as Provider, FILE_CONFLICT_MSG} from './provider';
// eslint-disable-next-line prettier/prettier
export type {MapListItem, Millisecond, Thumbnail, ProviderProps, IconProps} from './provider';
export {default as Upload} from './upload';
2 changes: 1 addition & 1 deletion src/cloud-providers/src/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

import {Upload} from '@kepler.gl/constants';
import Upload from './upload';
import {MapData, ExportFileOptions} from '@kepler.gl/types';
import {ComponentType} from 'react';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// THE SOFTWARE.

import React, {Component} from 'react';
import Base, {BaseProps} from './base';
import {Base, BaseProps} from '@kepler.gl/constants';

export default class Upload extends Component<Partial<BaseProps>> {
static defaultProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import styled from 'styled-components';
import classnames from 'classnames';
import {Minus} from '../icons';
import {DEFAULT_TIME_FORMAT} from '@kepler.gl/constants';
import {CenterFlexbox} from '@kepler.gl/constants';
import {CenterFlexbox} from '../../common/styled-components';
import {datetimeFormatter} from '@kepler.gl/utils';

const StyledTimeDisplayWrapper = styled.div.attrs({
Expand Down
3 changes: 1 addition & 2 deletions src/components/src/common/dataset-label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@

import React from 'react';
import styled from 'styled-components';
import {CenterFlexbox} from '@kepler.gl/constants';
import {DatasetSquare} from './styled-components';
import {CenterFlexbox, DatasetSquare} from './styled-components';
import {RGBColor} from '@kepler.gl/types';

const DatasetName = styled.div.attrs({
Expand Down
26 changes: 26 additions & 0 deletions src/components/src/common/styled-components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ export const IconRoundSmall = styled.div`
}
`;

export const CenterFlexbox = styled.div`
display: flex;
align-items: center;
`;

export const CenterVerticalFlexbox = styled.div`
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -416,6 +421,27 @@ export const SelectionButton = styled.div<SelectionButtonProps>`
}
`;

export const StyledTable = styled.table`
width: 100%;
border-spacing: 0;
thead {
tr th {
background: ${props => props.theme.panelBackgroundLT};
color: ${props => props.theme.titleColorLT};
padding: 18px 12px;
text-align: start;
}
}
tbody {
tr td {
border-bottom: ${props => props.theme.panelBorderLT};
padding: 12px;
}
}
`;

export const StyledModalContent = styled.div`
background: ${props => props.theme.panelBackgroundLT};
color: ${props => props.theme.textColorLT};
Expand Down
3 changes: 1 addition & 2 deletions src/components/src/filters/time-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@

import React, {useCallback, useMemo} from 'react';
import styled from 'styled-components';
import {CenterFlexbox} from '@kepler.gl/constants';
import {SelectTextBold, IconRoundSmall, BottomWidgetInner} from '../common/styled-components';
import {CenterFlexbox, SelectTextBold, IconRoundSmall, BottomWidgetInner} from '../common/styled-components';
import {Close, Clock, LineChart} from '../common/icons';
import TimeRangeSliderFactory from '../common/time-range-slider';
import FieldSelectorFactory from '../common/field-selector';
Expand Down
2 changes: 1 addition & 1 deletion src/components/src/map/layer-hover-info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import React, {useMemo} from 'react';
import styled from 'styled-components';
import {TooltipField} from '@kepler.gl/types';
import {CenterFlexbox} from '@kepler.gl/constants';
import {CenterFlexbox} from '../common/styled-components';
import {Layers} from '../common/icons';
import PropTypes from 'prop-types';
import {notNullorUndefined} from '@kepler.gl/utils';
Expand Down
4 changes: 2 additions & 2 deletions src/components/src/side-panel/common/dataset-title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import React, {createRef, MouseEvent, PureComponent} from 'react';
import styled from 'styled-components';
import {FormattedMessage} from '@kepler.gl/localization';

import {CenterFlexbox, Table} from '@kepler.gl/constants';
import {Tooltip} from '../../common/styled-components';
import {Table} from '@kepler.gl/layers';
import {CenterFlexbox, Tooltip} from '../../common/styled-components';
import {ArrowRight, Trash} from '../../common/icons';
import DatasetTagFactory from './dataset-tag';
import CustomPicker from '../layer-panel/custom-picker';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import styled from 'styled-components';
import PanelHeaderActionFactory from '../panel-header-action';
import {EyeSeen, EyeUnseen} from '../../common/icons';

import {CenterFlexbox} from '@kepler.gl/constants';
import {
CenterFlexbox,
PanelLabel,
PanelContent,
PanelLabelBold,
Expand All @@ -33,7 +33,8 @@ import {
import {FormattedMessage} from '@kepler.gl/localization';
import {camelize} from '@kepler.gl/utils';
import {VisibleLayerGroups} from '@kepler.gl/types';
import {BaseProps, Upload} from '@kepler.gl/constants';
import {BaseProps} from '@kepler.gl/constants';
import {Upload} from '@kepler.gl/cloud-providers';

const StyledInteractionPanel = styled.div`
padding-bottom: 12px;
Expand Down
27 changes: 0 additions & 27 deletions src/constants/src/base-styled-components.tsx

This file was deleted.

2 changes: 0 additions & 2 deletions src/constants/src/icons/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
export {default as Base} from './base';
// eslint-disable-next-line prettier/prettier
export type {BaseProps} from './base';
export {default as Upload} from './upload';
export {default as Table} from './table';
export {default as Messages} from './messages';
export {default as Crosshairs} from './crosshairs';
export {default as CursorClick} from './cursor-click';
Expand Down
1 change: 0 additions & 1 deletion src/constants/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,3 @@ export * from './tooltip';
export * from './user-feedbacks';
export * from './user-guides';
export * from './icons';
export {CenterFlexbox, StyledTable} from './base-styled-components';
7 changes: 6 additions & 1 deletion src/layers/src/icon-layer/icon-info-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ import React from 'react';
import styled from 'styled-components';
import {line} from 'd3-shape';
import {FormattedMessage} from '@kepler.gl/localization';
import {CenterFlexbox, Table} from '@kepler.gl/constants';
import Table from '../table';

const CenterFlexbox = styled.div`
display: flex;
align-items: center;
`;

const lineFunction = line()
.x(d => d[0] * 10)
Expand Down
1 change: 1 addition & 0 deletions src/layers/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,4 @@ export type OVERLAY_TYPE = {[key: string]: string};
export * from './mapbox-utils';
export * from './types';
export * from './h3-hexagon-layer';
export {default as Table} from './table';
23 changes: 22 additions & 1 deletion src/layers/src/scenegraph-layer/scenegraph-info-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,28 @@

import React from 'react';
import styled from 'styled-components';
import {StyledTable as Table} from '@kepler.gl/constants';

export const Table = styled.table`
width: 100%;
border-spacing: 0;
thead {
tr th {
background: ${props => props.theme.panelBackgroundLT};
color: ${props => props.theme.titleColorLT};
padding: 18px 12px;
text-align: start;
}
}
tbody {
tr td {
border-bottom: ${props => props.theme.panelBorderLT};
padding: 12px;
}
}
`;


const StyledTitle = styled.div`
font-size: 20px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// THE SOFTWARE.

import React, {Component} from 'react';
import Base, {BaseProps} from './base';
import {Base, BaseProps} from '@kepler.gl/constants';

export default class Table extends Component<Partial<BaseProps>> {
static defaultProps = {
Expand Down

0 comments on commit eccb928

Please sign in to comment.