Skip to content

Commit

Permalink
Rename to ModalCloseButton
Browse files Browse the repository at this point in the history
  • Loading branch information
joel-jeremy committed Apr 11, 2024
1 parent 27d07b5 commit b211e0f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
8 changes: 4 additions & 4 deletions packages/desktop-client/src/components/common/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export type ModalProps = {
padding?: CSSProperties['padding'];
showHeader?: boolean;
leftHeaderContent?: ReactNode;
CloseButton?: ComponentType<ComponentPropsWithRef<typeof CloseButton>>;
CloseButton?: ComponentType<ComponentPropsWithRef<typeof ModalCloseButton>>;
showTitle?: boolean;
editableTitle?: boolean;
showOverlay?: boolean;
Expand All @@ -60,7 +60,7 @@ export const Modal = ({
padding = 20,
showHeader = true,
leftHeaderContent,
CloseButton: CloseButtonComponent = CloseButton,
CloseButton: CloseButtonComponent = ModalCloseButton,
showTitle = true,
editableTitle = false,
showOverlay = true,
Expand Down Expand Up @@ -422,12 +422,12 @@ export const ModalButtons = ({
);
};

type CloseButtonProps = {
type ModalCloseButtonProps = {
onClick: ComponentProps<typeof Button>['onClick'];
style?: CSSProperties;
};

export function CloseButton({ onClick, style }: CloseButtonProps) {
export function ModalCloseButton({ onClick, style }: ModalCloseButtonProps) {
return (
<Button
type="bare"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { type ComponentPropsWithoutRef } from 'react';
import { useResponsive } from '../../ResponsiveProvider';
import { theme } from '../../style';
import { AccountAutocomplete } from '../autocomplete/AccountAutocomplete';
import { CloseButton, Modal } from '../common/Modal';
import { ModalCloseButton, Modal } from '../common/Modal';
import { View } from '../common/View';
import { SectionLabel } from '../forms';
import { type CommonModalProps } from '../Modals';
Expand Down Expand Up @@ -49,7 +49,10 @@ export function AccountAutocompleteModal({
backgroundColor: theme.menuAutoCompleteBackground,
}}
CloseButton={props => (
<CloseButton {...props} style={{ color: theme.menuAutoCompleteText }} />
<ModalCloseButton
{...props}
style={{ color: theme.menuAutoCompleteText }}
/>
)}
>
{() => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { type ComponentPropsWithoutRef } from 'react';
import { useResponsive } from '../../ResponsiveProvider';
import { theme } from '../../style';
import { CategoryAutocomplete } from '../autocomplete/CategoryAutocomplete';
import { CloseButton, Modal } from '../common/Modal';
import { ModalCloseButton, Modal } from '../common/Modal';
import { View } from '../common/View';
import { SectionLabel } from '../forms';
import { type CommonModalProps } from '../Modals';
Expand Down Expand Up @@ -50,7 +50,10 @@ export function CategoryAutocompleteModal({
backgroundColor: theme.menuAutoCompleteBackground,
}}
CloseButton={props => (
<CloseButton {...props} style={{ color: theme.menuAutoCompleteText }} />
<ModalCloseButton
{...props}
style={{ color: theme.menuAutoCompleteText }}
/>
)}
>
{() => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { usePayees } from '../../hooks/usePayees';
import { useResponsive } from '../../ResponsiveProvider';
import { theme } from '../../style';
import { PayeeAutocomplete } from '../autocomplete/PayeeAutocomplete';
import { CloseButton, Modal } from '../common/Modal';
import { ModalCloseButton, Modal } from '../common/Modal';
import { type CommonModalProps } from '../Modals';

type PayeeAutocompleteModalProps = {
Expand Down Expand Up @@ -52,7 +52,10 @@ export function PayeeAutocompleteModal({
backgroundColor: theme.menuAutoCompleteBackground,
}}
CloseButton={props => (
<CloseButton {...props} style={{ color: theme.menuAutoCompleteText }} />
<ModalCloseButton
{...props}
style={{ color: theme.menuAutoCompleteText }}
/>
)}
>
{() => (
Expand Down

0 comments on commit b211e0f

Please sign in to comment.