Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MBS-12740: Convert Delete attribute page to React
I opted to make this as standard as possible using ConfirmLayout, since it's basically already in the question/confirm pattern. Doing it like this also adds a cancel button, which cannot hurt - IMO it's quite nice to have a way back as a button anyway. Wasn't sure what's a good place for AttributeT so I dumped it into misc for now.
- Loading branch information
1 parent
1fd73c3
commit 87e9da9
Showing
6 changed files
with
71 additions
and
39 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* @flow strict | ||
* Copyright (C) 2022 MetaBrainz Foundation | ||
* | ||
* This file is part of MusicBrainz, the open internet music database, | ||
* and is licensed under the GPL version 2, or (at your option) any | ||
* later version: http://www.gnu.org/licenses/gpl-2.0.txt | ||
*/ | ||
|
||
import * as React from 'react'; | ||
|
||
import ConfirmLayout from '../../components/ConfirmLayout.js'; | ||
|
||
type Props = { | ||
+attribute: AttributeT, | ||
+form: SecureConfirmFormT, | ||
}; | ||
|
||
const DeleteAttribute = ({ | ||
attribute, | ||
form, | ||
}: Props): React.Element<typeof ConfirmLayout> => ( | ||
<ConfirmLayout | ||
form={form} | ||
question={exp.l( | ||
`Are you sure you wish to remove the | ||
<strong>{name}</strong> attribute?`, | ||
{name: attribute.name}, | ||
)} | ||
title={l('Remove Attribute')} | ||
/> | ||
); | ||
|
||
export default DeleteAttribute; |
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