created logout ui on sidebar

This commit is contained in:
u-e 2018-12-13 18:01:52 +03:00
parent f77bea5d29
commit 927dcd62aa
6 changed files with 20 additions and 5 deletions

View File

@ -88,7 +88,8 @@
"schedules": "Schedules", "schedules": "Schedules",
"gallery": "Gallery", "gallery": "Gallery",
"settings": "Settings", "settings": "Settings",
"add_account": "Add Account" "add_account": "Add Account",
"logout": "Logout"
}, },
"header": { "header": {
"title": "Login to customize your feed", "title": "Login to customize your feed",

View File

@ -88,7 +88,8 @@
"schedules": "Yapılacaklar", "schedules": "Yapılacaklar",
"gallery": "Galeri", "gallery": "Galeri",
"settings": "Ayarlar", "settings": "Ayarlar",
"add_account": "Hesap Ekle" "add_account": "Hesap Ekle",
"logout": "Cıkış"
}, },
"header": { "header": {
"title": "Giriş yap ve akışını özelleştir.", "title": "Giriş yap ve akışını özelleştir.",

View File

@ -1,6 +1,7 @@
const SCREEN_SUFFIX = 'Screen'; const SCREEN_SUFFIX = 'Screen';
const DRAWER_SUFFIX = 'Drawer'; const DRAWER_SUFFIX = 'Drawer';
const TABBAR_SUFFIX = 'Tabbar'; const TABBAR_SUFFIX = 'Tabbar';
const MODAL_SUFFIX = 'Modal';
export default { export default {
SCREENS: { SCREENS: {
@ -25,4 +26,7 @@ export default {
MESSAGES: `Messages${TABBAR_SUFFIX}`, MESSAGES: `Messages${TABBAR_SUFFIX}`,
PROFILE: `Profile${TABBAR_SUFFIX}`, PROFILE: `Profile${TABBAR_SUFFIX}`,
}, },
MODAL: {
LOGOUT: `Logout${MODAL_SUFFIX}`,
},
}; };

View File

@ -43,6 +43,12 @@ const authMenuItems = [
icon: 'gear', icon: 'gear',
id: 'settings', id: 'settings',
}, },
{
name: 'Logout',
route: ROUTES.MODAL.LOGOUT,
icon: 'sign-out',
id: 'logout',
},
]; ];
const noAuthMenuItems = [ const noAuthMenuItems = [

View File

@ -110,7 +110,7 @@ class ApplicationContainer extends Component {
dispatch(login()); dispatch(login());
const realmObject = realmData.filter(data => data.username === currentUsername); const realmObject = realmData.filter(data => data.username === currentUsername);
accountData.local = realmObject; accountData.local = realmObject[0];
dispatch(updateCurrentAccount(accountData)); dispatch(updateCurrentAccount(accountData));
// If in dev mode pin code does not show // If in dev mode pin code does not show

View File

@ -8,7 +8,10 @@ import { setUserDataWithPinCode, verifyPinCode } from '../../../providers/steem/
// Actions & Services // Actions & Services
import { closePinCodeModal } from '../../../redux/actions/applicationActions'; import { closePinCodeModal } from '../../../redux/actions/applicationActions';
import { import {
getExistUser, setExistUser, getUserData, getUserDataWithUsername, getExistUser,
setExistUser,
getUserData,
getUserDataWithUsername,
} from '../../../realm/realm'; } from '../../../realm/realm';
import { updateCurrentAccount } from '../../../redux/actions/accountAction'; import { updateCurrentAccount } from '../../../redux/actions/accountAction';
import { formatAccount } from '../../../utils/user'; import { formatAccount } from '../../../utils/user';
@ -113,7 +116,7 @@ class PinCodeContainer extends Component {
}; };
setUserDataWithPinCode(pinData).then((response) => { setUserDataWithPinCode(pinData).then((response) => {
const _currentAccount = currentAccount; const _currentAccount = currentAccount;
_currentAccount.local = response; _currentAccount.local = response[0];
dispatch(updateCurrentAccount({ ..._currentAccount })); dispatch(updateCurrentAccount({ ..._currentAccount }));