Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup page #26

Merged
merged 12 commits into from
Feb 20, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
root = true

[*]
indent_style = space
indent_style = tab
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Что это за файл? Конфиг еслинта или?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

извини,но ответ на это вопрос можно получить из названия файла..
я менял это потому что не очень ясно работает саблайм, webpack, eslinter и editor config вместе создавая дополнительных ошибки.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ок, я просто не понял, что это за эдитор такой...

indent_size = 2
end_of_line = lf
charset = utf-8
Expand Down
25 changes: 19 additions & 6 deletions client/components/header/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
v-if="isProfilePage"
@click='backAction')
icon-component(name="trusty_options")
.header_title(v-if="!isProfilePage") {{ getTitle }}

.header_title(v-if="!isProfilePage") {{ appHeaderTitle }}


</div>
Expand All @@ -27,6 +27,7 @@

<script>
import iconComponent from '@/components/icon';
import { mapGetters, mapActions } from 'vuex';

export default {
components: {
Expand All @@ -39,21 +40,33 @@ export default {
login: 'login',
deposit: 'deposit details',
withdraw: 'withdraw',
manage: 'manage fund'
manage: 'manage fund',
backup: 'compulsory backup',
'backup-phrase': 'backup phrase',
'backup-verify': 'verify backup',
'backup-done': 'almost done! let\'s review'
}
};
},
mounted() {
this.setHeaderTitle(this.titles[this.$route.name]);
},
methods: {
...mapActions('app', ['setHeaderTitle']),
backAction() {
this.$router.push({ name: 'home' });
},
},

watch: {
$route(val) {
this.setHeaderTitle(this.titles[val.name]);
}
},
computed: {
...mapGetters('app', ['appHeaderTitle']),
isProfilePage() {
return this.$route.path.indexOf('home') !== -1 || this.$route.name === 'home';
},
getTitle() {
return this.titles[this.$route.name];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вот этот вариант был лучше.

}
}
};
Expand Down
11 changes: 7 additions & 4 deletions client/components/icon.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template lang="pug">
<template lang="pug">

span.trusty_icon(v-html="icons[name]", :class="classes")

</template>


Expand All @@ -23,6 +23,9 @@ const names = [
'full_plus',
'full_minus',
'trusty_fund_logo',
'nophoto_backup',
'save_backup',
'tick_backup'
];

const icons = {};
Expand Down Expand Up @@ -63,10 +66,10 @@ export default {

.trusty_icon {
display: inline-block;

svg {
width: 100% !important;
height: auto;
}
}
</style>
</style>
2 changes: 1 addition & 1 deletion client/root.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default {
},
render() {
// eslint-disable-next-line
let app = (this.connected) ? (<router-view></router-view>) : (<h4>Connecting</h4>);
let app = (this.connected) || true ? (<router-view></router-view>) : (<h4>Connecting</h4>);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я понимаю, что ты это ставишь, чтобы верстать удобнее было, не дожидаясь загрузки, но это изменение ломает другие компоненты, не забывай плз перед сабмитом PR убирать его.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

у меня был коммит с более удобным управлением этим условием но он куда-то пропал в мержах

return (
<div id="app">
<Header />
Expand Down
23 changes: 22 additions & 1 deletion client/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import User from '@/views/User/User.vue';
import Signup from '@/views/Auth/signup.vue';
import Auth from '@/views/Auth/Auth.vue';
import ManagePortfolio from '@/views/Portfolio/ManagePortfolio.vue';

import Backup from '@/views/Backup';

Vue.use(Router);

Expand Down Expand Up @@ -52,6 +52,27 @@ export default new Router({
name: 'manage',
path: '/manage',
component: ManagePortfolio
},
{
name: 'backup',
path: '/backup',
component: Backup
},
{
name: 'backup-phrase',
path: '/backup/phrase',
component: Backup
},

{
name: 'backup-verify',
path: '/backup/verify',
component: Backup
},
{
name: 'backup-done',
path: '/backup/done',
component: Backup
}
]
});
Expand Down
39 changes: 39 additions & 0 deletions client/store/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
const APP_SET_HEADER_TITLE = 'APP_SET_HEADER_TITLE';
const APP_SET_MODAL = 'APP_SET_MODAL';

const actions = {
setModal({ commit }, val) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Что это за действие?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это действие дает возможность использовать v-if для показа модального окна в зависимости от его названия.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ок. Только давай будем использовать более понятные имена переменных. Если val - это название модального окна, то стоит обозначить его modalName.

commit(APP_SET_MODAL, val);
},
setHeaderTitle({ commit }, val) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это не обязательно в стор выносить. Тебе ведь это нужно только в компоненте хедера? Можно обойтись простым computed там.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

там была идея вначале менять в компоненте, потом в итоге вышло, что особо и нужно было. Но с другой стороны ничего плохого нет, что через стор хедер работает.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Да, работает, но совершаются лишние манипуляции, которые вообще без надобности (действия со стором и вотч), прошлый вариант с computed был проще и всё полностью выполнял. Верни, пожалуйста, к нему.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вполне вероятна ситуация появления в нем надобности. Я же его и затеял, чтобы менять хедер в любом месте приложения при случае. Но отказался от реализации в текущем компоненте.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А зачем менять хедер в каком-то месте, если он отражает текущее местоположение по роуту? Если возникнет необходимость показать там какие-то еще данные, то для этого лучше будет использовать отдельный параметр, который отдельными экшенами можно будет устанавливать, который не будет меняться на вотч роута.

commit(APP_SET_HEADER_TITLE, val);
}
};

const getters = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переименуй плз в getModalName, геттер - это функция, т.е. глагол и начинаем с get.

appModal: state => state.modalName,
appHeaderTitle: state => state.headerTitle,
};

const mutations = {
[APP_SET_MODAL](state, val) {
state.modalName = val;
},
[APP_SET_HEADER_TITLE](state, val) {
state.headerTitle = val;
}
};


const state = {
modalName: '',
headerTitle: ''
};

export default {
namespaced: true,
state,
getters,
actions,
mutations,
};
4 changes: 3 additions & 1 deletion client/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ import Vuex from 'vuex';
// eslint-disable-next-line
import vuexBitshares from 'lib/src';
import transfer from './transfer';
import app from './app';

Vue.use(Vuex);

const store = new Vuex.Store({
modules: {
transfer
transfer,
app
}
});
vuexBitshares(store);
Expand Down
20 changes: 17 additions & 3 deletions client/style/framework.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
@include trusty_main_padding;
}


.main_centered_container {
@media screen and (min-width: 769px){
margin: 0 auto;
Expand All @@ -21,8 +20,23 @@
}



p.trusty_big_font {
text-align: center;
margin: .2vw;
font-family: Gotham_Pro;
font-size: 7vw;
}

._bottom_fixed {
position: fixed;
bottom:0;
left: 0;
right: 0;
}

.trusty_buttons {

text-align: center;

button {
Expand Down Expand Up @@ -104,7 +118,7 @@ br.desk {

@media screen and (min-width: 769px) {
br.mob {
display: none;
display: none;
}
br.desk {
display: inline-block;
Expand Down
1 change: 1 addition & 0 deletions client/style/icons/nophoto_backup.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions client/style/icons/save_backup.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions client/style/icons/tick_backup.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions client/style/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@



* {
* {
-webkit-backface-visibility: hidden;
-webkit-tap-highlight-color: transparent;
}
Expand All @@ -27,7 +27,7 @@ body {
background: #1e2225;
}

body, .app {
html, body, #app {
height: 100%;
}

Expand Down Expand Up @@ -72,7 +72,7 @@ iframe {
margin: 0 auto;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
overflow: scroll !important;
}

Expand All @@ -87,7 +87,7 @@ iframe {
}

.trusty_owl_loader {
width: 60vw;
width: 60vw;
opacity: .6;
margin: 0 auto;
position: fixed;
Expand Down
15 changes: 14 additions & 1 deletion client/style/pixel-glass.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,20 @@ HTML {
/* Планшет */
@media ( max-width: 768px ) {
HTML {
background-image: url("./screens/manage_portfolio_manual.png");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pixel-glass - это для пиксель-перфект верстки ты используешь?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pixel glass да.. вещь)


background-image: url("./screens/account_backup_6_popup.png");
//background-image: url("./screens/account_backup_5.png");

//background-image: url("./screens/account_backup_5_popup.png");

//background-image: url("./screens/account_backup_4.png");

//background-image: url("./screens/account_backup_3.png");
//background-image: url("./screens/account_backup_1_popup.png");

//background-image: url("./screens/account_backup_1_popup.png");
//background-image: url("./screens/account_backup_1.png");
//background-image: url("./screens/manage_portfolio_manual.png");
//background-image: url("./screens/payment_method_user_profile_perfect.png");
//background-image: url("./screens/login.png")
//background-image: url("./screens/signup.png")
Expand Down
Binary file added client/style/screens/account_backup_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/style/screens/account_backup_1_popup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/style/screens/account_backup_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/style/screens/account_backup_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/style/screens/account_backup_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/style/screens/account_backup_5_popup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/style/screens/account_backup_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/style/screens/account_backup_6_popup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions client/views/Backup/done.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<template lang="pug">

#done
.tick_container(v-for="text in infos")
._tick: icon(name="tick_backup")
._info
p.trusty_help_text(v-html="text")

.trusty_inline_buttons._one_button
button copy password

._bottom_fixed.main_padding
.tick_container
._tick: icon(name="tick_backup")
._info
p.trusty_help_text
| I have read, understood, and#[br]gree
span._yellow The terms of use

.trusty_inline_buttons._one_button
button finish backup

</template>

<script>

import icon from '@/components/icon';
/*eslint-disable*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Убирай пожалуйста все выключения еслинта перед сабмитом PR

const infos = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А зачем это в отдельную переменную? В целом можно, но тогда стоит хранить просто в дате (а лучше - в $options, если это реактивные данные). А вообще хтмл код должен быть только в темплейте.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

намного удобнее выносить списки текстов в переменные, нежели писать эти строки в html.

`
I understand that my funds are<br/>
help securely on this device, not<br/>
by a compony, and nobody can<br/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Опечатка в company

recover my backup phrase and password
`,
`
I understand that if I open Trusty,<br/>
on a new device or clear browser<br/>
cash, my funds can only be<br/>
accessed with the backed pharse

`,
`
I undersatand that I need to<br/>
confirm every transaction with<br/>
the password
`
];

/*eslint-disable*/

export default {
components: {icon},
data() {
return {
infos
};
}
};

</script>
Loading