-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: rename Modal.Actions and DialogBox.Actions to Modal.Footer …
…and DialogBox.Footer respective affects: @medly-components/core BREAKING CHANGE: rename Modal.Actions and DialogBox.Actions to Modal.Footer and DialogBox.Footer respectively
- Loading branch information
Showing
26 changed files
with
166 additions
and
166 deletions.
There are no files selected for viewing
14 changes: 0 additions & 14 deletions
14
packages/core/src/components/DialogBox/Actions/Actions.tsx
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...onents/DialogBox/Actions/Actions.test.tsx → ...mponents/DialogBox/Footer/Footer.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import { render } from '@test-utils'; | ||
import { Actions } from './Actions'; | ||
import { DialogBoxActionUserProps } from './types'; | ||
import { Footer } from './Footer'; | ||
import { DialogBoxFooterProps } from './types'; | ||
|
||
describe('DialogBox action component', () => { | ||
const testData: [DialogBoxActionUserProps['alignItems'], string][] = [ | ||
const testData: [DialogBoxFooterProps['alignItems'], string][] = [ | ||
['left', 'flex-start'], | ||
['center', 'center'], | ||
['right', 'flex-end'] | ||
]; | ||
|
||
test.each(testData)('should align actions properly when align-items props is %s', (alignItems, flexValue) => { | ||
const { container } = render(<Actions alignItems={alignItems}>Demo Actions</Actions>); | ||
const { container } = render(<Footer alignItems={alignItems}>Demo Footer</Footer>); | ||
expect(container.querySelector('#default-id-actions')).toHaveStyle(`justify-content: ${flexValue}`); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { WithStyle } from '@medly-components/utils'; | ||
import type { FC } from 'react'; | ||
import { memo, useContext } from 'react'; | ||
import { DialogBoxContext } from '../DialogBox.context'; | ||
import * as Styled from './Footer.styled'; | ||
import { DialogBoxFooterProps } from './types'; | ||
|
||
const Component: FC<DialogBoxFooterProps> = memo(({ children, alignItems }) => { | ||
const { id } = useContext(DialogBoxContext); | ||
|
||
return <Styled.Footer {...{ alignItems, id: `${id}-actions` }}>{children}</Styled.Footer>; | ||
}); | ||
Component.displayName = 'Footer'; | ||
export const Footer: FC<DialogBoxFooterProps> & WithStyle = Object.assign(Component, { Style: Styled.Footer }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { Footer as default } from './Footer'; |
2 changes: 1 addition & 1 deletion
2
...src/components/DialogBox/Actions/types.ts → .../src/components/DialogBox/Footer/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export type DialogBoxActionUserProps = { | ||
export type DialogBoxFooterProps = { | ||
/** Use this to align actions horizontally */ | ||
alignItems?: 'left' | 'center' | 'right'; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.