-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(FOROME-1100): extract same component
- Loading branch information
1 parent
3c9b173
commit b46e32b
Showing
10 changed files
with
114 additions
and
97 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
src/components/solution-control/solution-change-dialog/index.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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from './solution-change-dialog' | ||
export * from './solution-modify-dialog' | ||
export * from './solution-delete-dialog' |
18 changes: 18 additions & 0 deletions
18
src/components/solution-control/solution-change-dialog/solution-change-dialog.interfaces.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export interface ISolutionChangeDialogProps { | ||
isOpen?: boolean | ||
onClose: () => void | ||
onApply: () => void | ||
message: string | ||
title: string | ||
cancelText: string | ||
applyText: string | ||
} | ||
|
||
export interface ISolutionChangeModalProps | ||
extends Omit< | ||
ISolutionChangeDialogProps, | ||
'message' | 'title' | 'cancelText' | 'applyText' | ||
> { | ||
solutionName?: string | ||
controlName: string | ||
} |
27 changes: 27 additions & 0 deletions
27
src/components/solution-control/solution-change-dialog/solution-change-dialog.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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { FC } from 'react' | ||
|
||
import { Dialog } from '@ui/dialog' | ||
import { ISolutionChangeDialogProps } from './solution-change-dialog.interfaces' | ||
|
||
export const SolutionChangeDialog: FC<ISolutionChangeDialogProps> = ({ | ||
isOpen, | ||
onClose, | ||
onApply, | ||
applyText, | ||
cancelText, | ||
message, | ||
title, | ||
}) => { | ||
return ( | ||
<Dialog | ||
isOpen={isOpen} | ||
onClose={onClose} | ||
onApply={onApply} | ||
title={title} | ||
cancelText={cancelText} | ||
applyText={applyText} | ||
> | ||
<p>{message}</p> | ||
</Dialog> | ||
) | ||
} |
22 changes: 22 additions & 0 deletions
22
src/components/solution-control/solution-change-dialog/solution-delete-dialog.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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { FC } from 'react' | ||
|
||
import { t } from '@i18n' | ||
import { SolutionChangeDialog } from '@components/solution-control/solution-change-dialog/solution-change-dialog' | ||
import { ISolutionChangeModalProps } from '@components/solution-control/solution-change-dialog/solution-change-dialog.interfaces' | ||
|
||
export const SolutionDeleteDialog: FC<ISolutionChangeModalProps> = ({ | ||
solutionName, | ||
controlName, | ||
...rest | ||
}) => ( | ||
<SolutionChangeDialog | ||
message={t('solutionControl.deleteDialog.message', { | ||
controlName, | ||
solutionName, | ||
})} | ||
title={t('solutionControl.deleteDialog.title', { controlName })} | ||
cancelText={t('solutionControl.deleteDialog.cancel', { controlName })} | ||
applyText={t('solutionControl.deleteDialog.confirm', { controlName })} | ||
{...rest} | ||
/> | ||
) |
22 changes: 22 additions & 0 deletions
22
src/components/solution-control/solution-change-dialog/solution-modify-dialog.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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { FC } from 'react' | ||
|
||
import { t } from '@i18n' | ||
import { SolutionChangeDialog } from '@components/solution-control/solution-change-dialog/solution-change-dialog' | ||
import { ISolutionChangeModalProps } from '@components/solution-control/solution-change-dialog/solution-change-dialog.interfaces' | ||
|
||
export const SolutionModifyDialog: FC<ISolutionChangeModalProps> = ({ | ||
solutionName, | ||
controlName, | ||
...rest | ||
}) => ( | ||
<SolutionChangeDialog | ||
message={t('solutionControl.modifyDialog.message', { | ||
controlName, | ||
solutionName, | ||
})} | ||
title={t('solutionControl.modifyDialog.title', { controlName })} | ||
cancelText={t('solutionControl.modifyDialog.cancel', { controlName })} | ||
applyText={t('solutionControl.modifyDialog.confirm', { controlName })} | ||
{...rest} | ||
/> | ||
) |
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
1 change: 0 additions & 1 deletion
1
src/components/solution-control/solution-delete-dialog/index.ts
This file was deleted.
Oops, something went wrong.
38 changes: 0 additions & 38 deletions
38
src/components/solution-control/solution-delete-dialog/solution-delete-dialog.tsx
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
src/components/solution-control/solution-modify-dialog/index.ts
This file was deleted.
Oops, something went wrong.
38 changes: 0 additions & 38 deletions
38
src/components/solution-control/solution-modify-dialog/solution-modify-dialog.tsx
This file was deleted.
Oops, something went wrong.