Skip to content

Commit

Permalink
[chore] updated modal and panel title types to react 18 (#2334)
Browse files Browse the repository at this point in the history
  • Loading branch information
igorDykhta committed Sep 24, 2023
1 parent a0e5db7 commit 7012811
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
9 changes: 7 additions & 2 deletions src/components/src/common/modal.tsx
Expand Up @@ -18,7 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

import React, {Component, ReactNode} from 'react';
import React, {Component, ReactNode, PropsWithChildren} from 'react';
import {FormattedMessage} from '@kepler.gl/localization';

import styled, {FlattenSimpleInterpolation} from 'styled-components';
Expand Down Expand Up @@ -65,7 +65,12 @@ const ModalContent = styled.div`
z-index: ${props => props.theme.modalContentZ};
`;

export const ModalTitle = styled.div`
type ModalTitleProps = PropsWithChildren<{
style?: React.CSSProperties;
className?: string;
}>;

export const ModalTitle = styled.div<ModalTitleProps>`
font-size: ${props => props.theme.modalTitleFontSize};
color: ${props => props.theme.modalTitleColor};
margin-bottom: 10px;
Expand Down
7 changes: 3 additions & 4 deletions src/components/src/side-panel/panel-title.tsx
Expand Up @@ -18,7 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

import React from 'react';
import React, {PropsWithChildren} from 'react';
import styled from 'styled-components';
import classnames from 'classnames';

Expand All @@ -42,11 +42,10 @@ const PanelHeaderRow = styled.div.attrs({
margin-bottom: 32px;
`;

export type PanelTitleProps = {
export type PanelTitleProps = PropsWithChildren<{
title: string;
className?: string;
children?: React.ReactNode;
};
}>;

const PanelTitleFactory = () => {
const PanelTitle: React.FC<PanelTitleProps> = ({title, className, children}) => (
Expand Down

0 comments on commit 7012811

Please sign in to comment.