Page MenuHomePhabricator

D10611.id35554.diff
No OneTemporary

D10611.id35554.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,33 @@
+// @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,
+ });
+
+ return (
+ <div className={className} onClick={onClick}>
+ {name}
+ </div>
+ );
+}
+
+export default UserSettingsListItem;

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 5, 3:23 AM (14 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2615728
Default Alt Text
D10611.id35554.diff (1 KB)

Event Timeline