mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +00:00
styling logout modal
This commit is contained in:
parent
ff66e8457d
commit
a24272db84
@ -1,6 +1,6 @@
|
|||||||
import { useRef, useCallback } from 'react';
|
import { useRef, useCallback } from 'react';
|
||||||
import { Modal, Input, Button } from 'antd';
|
import { Modal, Input, Button, Switch } from 'antd';
|
||||||
import { ProfileWrapper, ProfileDetailsWrapper, ProfileImageWrapper, EditFooter } from './Profile.styled';
|
import { LogoutContent, ProfileWrapper, ProfileDetailsWrapper, ProfileImageWrapper, EditFooter } from './Profile.styled';
|
||||||
import { useProfile } from './useProfile.hook';
|
import { useProfile } from './useProfile.hook';
|
||||||
import { Logo } from 'logo/Logo';
|
import { Logo } from 'logo/Logo';
|
||||||
import { AccountAccess } from './accountAccess/AccountAccess';
|
import { AccountAccess } from './accountAccess/AccountAccess';
|
||||||
@ -12,6 +12,7 @@ export function Profile({ closeProfile }) {
|
|||||||
const [ modal, modalContext ] = Modal.useModal();
|
const [ modal, modalContext ] = Modal.useModal();
|
||||||
const { state, actions } = useProfile();
|
const { state, actions } = useProfile();
|
||||||
const imageFile = useRef(null);
|
const imageFile = useRef(null);
|
||||||
|
const all = useRef(false);
|
||||||
|
|
||||||
const selected = (e) => {
|
const selected = (e) => {
|
||||||
var reader = new FileReader();
|
var reader = new FileReader();
|
||||||
@ -53,12 +54,18 @@ export function Profile({ closeProfile }) {
|
|||||||
|
|
||||||
const logout = () => {
|
const logout = () => {
|
||||||
modal.confirm({
|
modal.confirm({
|
||||||
title: 'Are you sure you want to logout?',
|
title: <span style={state.menuStyle}>{state.strings.confirmLogout}</span>,
|
||||||
icon: <LogoutOutlined />,
|
icon: <LogoutOutlined />,
|
||||||
bodyStyle: { padding: 16 },
|
content: <LogoutContent onClick={(e) => e.stopPropagation()}>
|
||||||
|
<span className="logoutMode">{ state.strings.allDevices }</span>
|
||||||
|
<Switch onChange={(e) => all.current = e} size="small" />
|
||||||
|
</LogoutContent>,
|
||||||
|
bodyStyle: { padding: 16, ...state.menuStyle },
|
||||||
|
okText: state.strings.ok,
|
||||||
onOk() {
|
onOk() {
|
||||||
actions.logout();
|
actions.logout(all.current);
|
||||||
},
|
},
|
||||||
|
cancelText: state.strings.cancel,
|
||||||
onCancel() {},
|
onCancel() {},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -217,6 +217,19 @@ export const ProfileWrapper = styled.div`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
|
export const LogoutContent = styled.div`
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 8px;
|
||||||
|
|
||||||
|
.logoutMode {
|
||||||
|
padding-right: 8px;
|
||||||
|
color: ${props => props.theme.mainText};
|
||||||
|
}
|
||||||
|
`
|
||||||
|
|
||||||
export const EditFooter = styled.div`
|
export const EditFooter = styled.div`
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -25,6 +25,8 @@ export function useProfile() {
|
|||||||
crop: { x: 0, y: 0},
|
crop: { x: 0, y: 0},
|
||||||
zoom: 1,
|
zoom: 1,
|
||||||
busy: false,
|
busy: false,
|
||||||
|
strings: {},
|
||||||
|
menuStyle: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
const IMAGE_DIM = 192;
|
const IMAGE_DIM = 192;
|
||||||
@ -45,7 +47,8 @@ export function useProfile() {
|
|||||||
}, [profile.state]);
|
}, [profile.state]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
updateState({ displaySet: true, display: settings.state.display });
|
const { display, strings, menuStyle } = settings.state;
|
||||||
|
updateState({ displaySet: true, display, strings, menuStyle });
|
||||||
}, [settings.state]);
|
}, [settings.state]);
|
||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
|
13
todo
13
todo
@ -1,13 +1,10 @@
|
|||||||
profile:
|
profile:
|
||||||
- details layout
|
- add translations
|
||||||
- detail edit icon style
|
|
||||||
- image edit icon layout
|
|
||||||
- style modals
|
- style modals
|
||||||
- add app settings
|
- image edit
|
||||||
- hour format
|
- details edit
|
||||||
- date format
|
- sealed topics
|
||||||
- color theme
|
- change login
|
||||||
- language
|
|
||||||
|
|
||||||
contact:
|
contact:
|
||||||
- dark style
|
- dark style
|
||||||
|
Loading…
Reference in New Issue
Block a user