Page MenuHomePhabricator

D10611.diff
No OneTemporary

D10611.diff

diff --git a/web/settings/user-settings-list-item.css b/web/settings/user-settings-list-item.css
new file mode 100644
--- /dev/null
+++ b/web/settings/user-settings-list-item.css
@@ -0,0 +1,17 @@
+.container {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ column-gap: 8px;
+ color: var(--text-background-tertiary-default);
+ font-size: var(--s-font-14);
+}
+
+.container:hover {
+ cursor: pointer;
+}
+
+.container:hover,
+.selected {
+ color: var(--text-background-primary-default);
+}
diff --git a/web/settings/user-settings-list-item.react.js b/web/settings/user-settings-list-item.react.js
new file mode 100644
--- /dev/null
+++ b/web/settings/user-settings-list-item.react.js
@@ -0,0 +1,38 @@
+// @flow
+
+import classNames from 'classnames';
+import * as React from 'react';
+
+import css from './user-settings-list-item.css';
+import { useSelector } from '../redux/redux-utils.js';
+import { navSettingsSectionSelector } from '../selectors/nav-selectors.js';
+import type { NavigationSettingsSection } from '../types/nav-types.js';
+
+type Props = {
+ +id: NavigationSettingsSection,
+ +name: string,
+ +onClick: () => mixed,
+};
+
+function UserSettingsListItem(props: Props): React.Node {
+ const { id, name, onClick } = props;
+
+ const currentSelectedSettings = useSelector(navSettingsSectionSelector);
+
+ const className = classNames(css.container, {
+ [css.selected]: currentSelectedSettings === id,
+ });
+
+ const userSettingsListItem = React.useMemo(
+ () => (
+ <div className={className} onClick={onClick}>
+ {name}
+ </div>
+ ),
+ [className, name, onClick],
+ );
+
+ return userSettingsListItem;
+}
+
+export default UserSettingsListItem;

File Metadata

Mime Type
text/plain
Expires
Wed, Dec 4, 1:34 PM (10 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2614381
Default Alt Text
D10611.diff (1 KB)

Event Timeline