Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] updated modal and panel title types to react 18 #2334

Merged
merged 1 commit into from
Sep 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/components/src/common/modal.tsx
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 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
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 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