diff --git a/net/web/src/session/account/profile/Profile.jsx b/net/web/src/session/account/profile/Profile.jsx index 2bee88a2..d6936e2d 100644 --- a/net/web/src/session/account/profile/Profile.jsx +++ b/net/web/src/session/account/profile/Profile.jsx @@ -1,6 +1,6 @@ import { useRef, useCallback } from 'react'; import { Modal, Input, Button, Switch } from 'antd'; -import { LogoutContent, ProfileWrapper, ProfileDetailsWrapper, ProfileImageWrapper, EditFooter } from './Profile.styled'; +import { LogoutContent, ProfileWrapper, ProfileDetailsWrapper, ProfileImageWrapper } from './Profile.styled'; import { useProfile } from './useProfile.hook'; import { Logo } from 'logo/Logo'; import { AccountAccess } from './accountAccess/AccountAccess'; @@ -70,17 +70,6 @@ export function Profile({ closeProfile }) { }); } - const editImageFooter = ( - - selected(e)} style={{display: 'none'}}/> -
- -
- - -
- ); - const onCropComplete = useCallback((area, crop) => { actions.setEditImageCrop(crop.width, crop.height, crop.x, crop.y) // eslint-disable-next-line @@ -156,12 +145,23 @@ export function Profile({ closeProfile }) {
)} - + - +
Profile Image
+
+ +
+
+ selected(e)} style={{display: 'none'}}/> +
+ +
+ + +
diff --git a/net/web/src/session/account/profile/Profile.styled.js b/net/web/src/session/account/profile/Profile.styled.js index feabdd0b..45ea32af 100644 --- a/net/web/src/session/account/profile/Profile.styled.js +++ b/net/web/src/session/account/profile/Profile.styled.js @@ -229,15 +229,6 @@ export const LogoutContent = styled.div` } ` -export const EditFooter = styled.div` - width: 100%; - display: flex; - - .select { - display: flex; - flex-grow: 1; - } -` export const ProfileDetailsWrapper = styled.div` display: flex; flex-direction: column; @@ -287,11 +278,34 @@ export const ProfileDetailsWrapper = styled.div` `; export const ProfileImageWrapper = styled.div` - position: relative; - height: 256px; - width: 100%; display: flex; - align-items: center; + flex-direction: column; justify-content: center; + gap: 16px; + + .cropper { + position: relative; + height: 256px; + width: 100%; + display: flex; + align-items: center; + justify-content: center; + } + + .title { + font-size: 1.2rem; + display: flex; + justify-content: center; + } + + .controls { + display: flex; + justify-content: flex-end; + gap: 16px; + + .select { + flex-grow: 1; + } + } `; diff --git a/net/web/src/session/account/profile/accountAccess/AccountAccess.jsx b/net/web/src/session/account/profile/accountAccess/AccountAccess.jsx index 3a7732ee..20aa1fd3 100644 --- a/net/web/src/session/account/profile/accountAccess/AccountAccess.jsx +++ b/net/web/src/session/account/profile/accountAccess/AccountAccess.jsx @@ -52,22 +52,6 @@ export function AccountAccess() { } } - const editSealFooter = ( -
-
- - { state.sealMode === 'enabled' && ( - - )} - { state.sealMode === 'unlocking' && ( - - )} - { state.sealMode !== 'unlocking' && state.sealMode !== 'enabled' && ( - - )} -
- ); - return ( { modalContext } @@ -127,42 +111,55 @@ export function AccountAccess() { - + +
Topic Sealing Key
actions.enableSeal(enable)} />
Enable Sealed Topics
{ (state.sealMode === 'updating' || state.sealMode === 'enabling') && ( -
+
actions.setSealPassword(e.target.value)} autocomplete="new-password" prefix={} />
)} { (state.sealMode === 'updating' || state.sealMode === 'enabling') && ( -
+
actions.setSealConfirm(e.target.value)} autocomplete="new-password" prefix={} />
)} { state.sealMode === 'disabling' && ( -
+
actions.setSealDelete(e.target.value)} prefix={} />
)} { state.sealMode === 'enabled' && ( -
actions.updateSeal()}> +
actions.updateSeal()}> } />
)} { state.sealMode === 'unlocking' && ( -
+
actions.setSealUnlock(e.target.value)} prefix={} />
)} +
+ + { state.sealMode === 'enabled' && ( + + )} + { state.sealMode === 'unlocking' && ( + + )} + { state.sealMode !== 'unlocking' && state.sealMode !== 'enabled' && ( + + )} +
diff --git a/net/web/src/session/account/profile/accountAccess/AccountAccess.styled.js b/net/web/src/session/account/profile/accountAccess/AccountAccess.styled.js index d7e37715..51a3bb9c 100644 --- a/net/web/src/session/account/profile/accountAccess/AccountAccess.styled.js +++ b/net/web/src/session/account/profile/accountAccess/AccountAccess.styled.js @@ -91,16 +91,17 @@ export const AccountAccessWrapper = styled.div` export const SealModal = styled.div` display: flex; flex-direction: column; - padding-bottom: 8px; + gap: 16px; + + .title { + font-size: 1.2rem; + display: flex; + justify-content: center; + } .switch { display: flex; - flex-direction: row; align-items: center; - padding-bottom: 8px; - align-items: center; - justify-content: center; - padding-top: 8px; .switchLabel { color: ${props => props.theme.mainText}; @@ -109,19 +110,65 @@ export const SealModal = styled.div` } } - .sealPassword { - padding-top: 4px; - padding-bottom: 4px; - position: relative; + .controls { + width: 100%; + display: flex; + justify-content: flex-end; + gap: 16px; - .editPassword { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - cursor: pointer; + .saveDisabled { + background-color: ${props => props.theme.disabledArea}; + + button { + color: ${props => props.theme.idleText}; + } } + + .saveEnabled { + background-color: ${props => props.theme.enabledArea}; + + button { + color: ${props => props.theme.activeText}; + } + } + } + + .sealChange { + width: 100%; + background-color: ${props => props.theme.inputArea}; + color: ${props => props.theme.mainText}; + border-radius: 8px; + + .ant-input-affix-wrapper { + background-color: ${props => props.theme.inputArea}; + } + + .anticon { + color: ${props => props.theme.placeholderText}; + + &:hover { + color: ${props => props.theme.linkText}; + } + } + + input { + padding-left: 8px; + background-color: ${props => props.theme.inputArea}; + color: ${props => props.theme.mainText}; + } + + input::placeholder { + color: ${props => props.theme.placeholderText}; + } + } + + .editPassword { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + cursor: pointer; } `