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( + () => ( +