diff --git a/web/settings/account-settings.css b/web/settings/account-settings.css index a89624ece..95b90ec80 100644 --- a/web/settings/account-settings.css +++ b/web/settings/account-settings.css @@ -1,65 +1,76 @@ .container { padding: 40px; width: 456px; + overflow-y: auto; } .header { color: var(--fg); font-weight: var(--semi-bold); line-height: var(--line-height-display); padding-bottom: 55px; } .content { margin-top: 32px; } .content ul { list-style-type: none; } .content li { color: var(--account-settings-label); padding: 24px 16px 16px; display: flex; flex-direction: row; justify-content: space-between; } .content li:not(:last-child) { border-bottom: 1px solid var(--border-color); } .logoutContainer { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--fg); } .logoutLabel { color: var(--account-settings-label); } .username { color: var(--fg); } .buttonText { color: var(--account-button-color); line-height: var(--line-height-text); } .passwordContainer { display: flex; } .password { align-items: center; padding-right: 16px; } .editPasswordLink { color: var(--account-settings-label); cursor: pointer; } + +.preferencesContainer { + padding-top: 24px; +} + +.preferencesHeader { + color: var(--fg); + font-weight: var(--semi-bold); + line-height: var(--line-height-display); +} diff --git a/web/settings/account-settings.react.js b/web/settings/account-settings.react.js index 13e92c2c7..b694b1b7d 100644 --- a/web/settings/account-settings.react.js +++ b/web/settings/account-settings.react.js @@ -1,113 +1,140 @@ // @flow import * as React from 'react'; import { logOut, logOutActionTypes } from 'lib/actions/user-actions.js'; import { useModalContext } from 'lib/components/modal-provider.react.js'; import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; import { useStringForUser } from 'lib/hooks/ens-cache.js'; import { preRequestUserStateSelector } from 'lib/selectors/account-selectors.js'; import { accountHasPassword } from 'lib/shared/account-utils.js'; import { useDispatchActionPromise, useServerCall, } from 'lib/utils/action-utils.js'; import css from './account-settings.css'; import PasswordChangeModal from './password-change-modal.js'; import BlockListModal from './relationship/block-list-modal.react.js'; import FriendListModal from './relationship/friend-list-modal.react.js'; import EditUserAvatar from '../avatars/edit-user-avatar.react.js'; import Button from '../components/button.react.js'; import { useSelector } from '../redux/redux-utils.js'; +import { useStaffCanSee } from '../utils/staff-utils.js'; function AccountSettings(): React.Node { const sendLogoutRequest = useServerCall(logOut); const preRequestUserState = useSelector(preRequestUserStateSelector); const dispatchActionPromise = useDispatchActionPromise(); const logOutUser = React.useCallback( () => dispatchActionPromise( logOutActionTypes, sendLogoutRequest(preRequestUserState), ), [dispatchActionPromise, preRequestUserState, sendLogoutRequest], ); const { pushModal, popModal } = useModalContext(); const showPasswordChangeModal = React.useCallback( () => pushModal(), [pushModal], ); const openFriendList = React.useCallback( () => pushModal(), [popModal, pushModal], ); const openBlockList = React.useCallback( () => pushModal(), [popModal, pushModal], ); const isAccountWithPassword = useSelector(state => accountHasPassword(state.currentUserInfo), ); const currentUserInfo = useSelector(state => state.currentUserInfo); const stringForUser = useStringForUser(currentUserInfo); + const staffCanSee = useStaffCanSee(); + + const showAppearanceModal = React.useCallback(() => { + // TODO + }, []); + if (!currentUserInfo || currentUserInfo.anonymous) { return null; } let changePasswordSection; if (isAccountWithPassword) { changePasswordSection = (
  • Password ******
  • ); } + let preferences; + if (staffCanSee) { + preferences = ( +
    +

    Preferences

    +
    +
      +
    • + Appearance + + + +
    • +
    +
    +
    + ); + } + return (

    My Account

    • {'Logged in as '} {stringForUser}

    • {changePasswordSection}
    • Friend List
    • Block List
    + {preferences}
    ); } export default AccountSettings;