Page MenuHomePhorge

D4680.1765129180.diff
No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None

D4680.1765129180.diff

diff --git a/web/modals/threads/settings/thread-settings-relationship-tab.css b/web/modals/threads/settings/thread-settings-relationship-tab.css
new file mode 100644
--- /dev/null
+++ b/web/modals/threads/settings/thread-settings-relationship-tab.css
@@ -0,0 +1,5 @@
+div.container {
+ display: flex;
+ flex-direction: column;
+ row-gap: 10px;
+}
diff --git a/web/modals/threads/settings/thread-settings-relationship-tab.react.js b/web/modals/threads/settings/thread-settings-relationship-tab.react.js
new file mode 100644
--- /dev/null
+++ b/web/modals/threads/settings/thread-settings-relationship-tab.react.js
@@ -0,0 +1,44 @@
+// @flow
+
+import * as React from 'react';
+
+import { updateRelationshipsActionTypes } from 'lib/actions/relationship-actions';
+import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors';
+import { type SetState } from 'lib/types/hook-types';
+import { type RelationshipButton } from 'lib/types/relationship-types';
+import type { UserInfo } from 'lib/types/user-types';
+
+import { useSelector } from '../../../redux/redux-utils';
+import ThreadSettingsRelationshipButton from './thread-settings-relationship-button.react';
+import css from './thread-settings-relationship-tab.css';
+
+const loadingStatusSelector = createLoadingStatusSelector(
+ updateRelationshipsActionTypes,
+);
+
+type Props = {
+ +setErrorMessage: SetState<string>,
+ +relationshipButtons: $ReadOnlyArray<RelationshipButton>,
+ +otherUserInfo: UserInfo,
+};
+
+function ThreadSettingsRelationshipTab(props: Props): React.Node {
+ const { relationshipButtons, otherUserInfo, setErrorMessage } = props;
+ const inputDisabled = useSelector(loadingStatusSelector) === 'loading';
+ const buttons = React.useMemo(() => {
+ return relationshipButtons.map(action => {
+ return (
+ <ThreadSettingsRelationshipButton
+ key={action}
+ relationshipButton={action}
+ otherUserInfo={otherUserInfo}
+ setErrorMessage={setErrorMessage}
+ disabled={inputDisabled}
+ />
+ );
+ });
+ }, [inputDisabled, otherUserInfo, relationshipButtons, setErrorMessage]);
+ return <div className={css.container}>{buttons}</div>;
+}
+
+export default ThreadSettingsRelationshipTab;

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 7, 5:39 PM (8 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5845226
Default Alt Text
D4680.1765129180.diff (2 KB)

Event Timeline