functinal app settings
@@ -25,11 +25,10 @@ const styles = (theme: Theme) =>
interface Props extends WithNamespaceProps, WithStyles<typeof styles> {}
-class ApplicationSettingsRaw extends React.PureComponent<Props> {
- private confirmDelete = async () => {
- const { dispatch, activeNamespaceName } = this.props;
+const ApplicationSettingsRaw: React.FC<Props> = (props) => {
+ const confirmDelete = async () => {
+ const { dispatch, activeNamespaceName } = props;
try {
- console.log(activeNamespaceName);
await dispatch(deleteApplicationAction(activeNamespaceName));
await dispatch(setSuccessNotificationAction("Successfully delete an application"));
dispatch(push(`/`));
@@ -38,8 +37,7 @@ class ApplicationSettingsRaw extends React.PureComponent<Props> {
}
};
- public render() {
- const { activeNamespaceName } = this.props;
+ const { activeNamespaceName } = props;
const options = [
{
title: (
@@ -58,12 +56,13 @@ class ApplicationSettingsRaw extends React.PureComponent<Props> {
targetText={activeNamespaceName}
text={"delete application"}
useText={true}
- confirmedAction={() => this.confirmDelete()}
+ confirmedAction={() => confirmDelete()}
/>
),
content: "",
},
];
+
return (
<BasePage
secondHeaderLeft={<Namespaces />}
@@ -75,8 +74,7 @@ class ApplicationSettingsRaw extends React.PureComponent<Props> {
</Box>
</BasePage>
);
- }
-}
+};
export const ApplicationSettingsPage = withStyles(styles)(
withNamespace(connect(mapStateToProps)(ApplicationSettingsRaw)),
