[MM-56294] Convert ./components/admin_console/group_settings/group_details/group_profile.tsx from Class Component to Function Component (#25766)
* [MM-56294] Convert `./components/admin_console/group_settings/group_details/group_profile.tsx` from Class Component to Function Component * refactor: update snapshots
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
ec4fdba04e
Коммит
11ae867ce3
@@ -9,7 +9,7 @@ exports[`components/admin_console/group_settings/group_details/GroupProfileAndSe
|
|||||||
titleDefault="Group Profile"
|
titleDefault="Group Profile"
|
||||||
titleId="admin.group_settings.group_detail.groupProfileTitle"
|
titleId="admin.group_settings.group_detail.groupProfileTitle"
|
||||||
>
|
>
|
||||||
<GroupProfile
|
<Memo(GroupProfile)
|
||||||
customID="groupDisplayName"
|
customID="groupDisplayName"
|
||||||
isDisabled={true}
|
isDisabled={true}
|
||||||
name="GroupProfileAndSettings"
|
name="GroupProfileAndSettings"
|
||||||
@@ -49,7 +49,7 @@ exports[`components/admin_console/group_settings/group_details/GroupProfileAndSe
|
|||||||
titleDefault="Group Profile"
|
titleDefault="Group Profile"
|
||||||
titleId="admin.group_settings.group_detail.groupProfileTitle"
|
titleId="admin.group_settings.group_detail.groupProfileTitle"
|
||||||
>
|
>
|
||||||
<GroupProfile
|
<Memo(GroupProfile)
|
||||||
customID="groupDisplayName"
|
customID="groupDisplayName"
|
||||||
isDisabled={true}
|
isDisabled={true}
|
||||||
name="GroupProfileAndSettings"
|
name="GroupProfileAndSettings"
|
||||||
@@ -77,7 +77,7 @@ exports[`components/admin_console/group_settings/group_details/GroupProfileAndSe
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<GroupProfile
|
<Memo(GroupProfile)
|
||||||
customID="groupMention"
|
customID="groupMention"
|
||||||
name="GroupProfileAndSettings"
|
name="GroupProfileAndSettings"
|
||||||
onChange={[MockFunction]}
|
onChange={[MockFunction]}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||||
// See LICENSE.txt for license information.
|
// See LICENSE.txt for license information.
|
||||||
|
|
||||||
import React from 'react';
|
import React, {memo} from 'react';
|
||||||
import {FormattedMessage} from 'react-intl';
|
import {FormattedMessage} from 'react-intl';
|
||||||
|
|
||||||
import MentionsIcon from 'components/widgets/icons/mentions_icon';
|
import MentionsIcon from 'components/widgets/icons/mentions_icon';
|
||||||
@@ -16,9 +16,7 @@ type Props = {
|
|||||||
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class GroupProfile extends React.PureComponent<Props> {
|
const GroupProfile = ({
|
||||||
render = () => {
|
|
||||||
const {
|
|
||||||
name,
|
name,
|
||||||
title,
|
title,
|
||||||
titleDefault,
|
titleDefault,
|
||||||
@@ -26,9 +24,7 @@ export default class GroupProfile extends React.PureComponent<Props> {
|
|||||||
isDisabled,
|
isDisabled,
|
||||||
showAtMention,
|
showAtMention,
|
||||||
onChange,
|
onChange,
|
||||||
} = this.props;
|
}: Props) => (
|
||||||
|
|
||||||
return (
|
|
||||||
<div
|
<div
|
||||||
className='group-profile form-horizontal'
|
className='group-profile form-horizontal'
|
||||||
id={customID}
|
id={customID}
|
||||||
@@ -59,6 +55,6 @@ export default class GroupProfile extends React.PureComponent<Props> {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
|
||||||
}
|
export default memo(GroupProfile);
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user