Skip to content

Commit

Permalink
add expanded view
Browse files Browse the repository at this point in the history
  • Loading branch information
capt-nemo429 committed Jan 25, 2022
1 parent b7130f1 commit 326487d
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 9 deletions.
59 changes: 57 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@download/blockies": "^1.0.3",
"@emurgo/cip4-js": "^1.0.6",
"@oruga-ui/oruga-next": "^0.5.2",
"@types/chrome": "^0.0.177",
"@vuelidate/core": "^2.0.0-alpha.33",
"@vuelidate/validators": "^2.0.0-alpha.26",
"axios": "^0.24.0",
Expand Down
3 changes: 2 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="flex flex-col h-600px max-h-600px w-365px gap-0">
<div class="app">
<wallet-header v-show="!$route.meta.fullPage" />
<nav-header v-if="!$route.meta.fullPage" />
<div class="flex-grow overflow-y-auto overflow-x-hidden">
Expand Down Expand Up @@ -51,6 +51,7 @@ export default defineComponent({
await this.init();
},
deactivated() {
alert("close");
clearInterval(this.getPriceTimerId);
clearInterval(this.syncTimerId);
},
Expand Down
8 changes: 6 additions & 2 deletions src/assets/styles/main.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
body {
@apply bg-light-50 text-base leading-normal tracking-wide text-dark-500 antialiased;
@apply bg-gray-200 text-base leading-normal tracking-wide text-dark-500 antialiased;
}

.app {
@apply bg-light-50 flex flex-col min-h-600px h-600px min-w-365px mx-auto gap-0 md:(max-w-5/12 shadow-lg h-screen max-h-screen);
}

a {
Expand Down Expand Up @@ -44,7 +48,7 @@ label {
}

.tabs {
@apply flex flex-row shadow px-10 mb-1 text-sm text-gray-500 justify-center;
@apply flex flex-row shadow px-10 mb-0.6 text-sm text-gray-500 justify-center;
}

.tabs .tab-item {
Expand Down
17 changes: 16 additions & 1 deletion src/components/WalletHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
<vue-feather type="plus-circle" size="16" class="align-middle pr-2" />
<span class="align-middle">Add new wallet</span></router-link
>
<a @click="expandView()" class="group-item narrow">
<vue-feather type="maximize-2" size="16" class="align-middle pr-2" />
<span class="align-middle">Expand view</span></a
>
<router-link :to="{ name: 'about-nautilus' }" class="group-item narrow">
<vue-feather type="info" size="16" class="align-middle pr-2" />
<span class="align-middle">About</span></router-link
Expand Down Expand Up @@ -56,7 +60,18 @@ export default defineComponent({
};
},
methods: {
...mapActions({ setCurrentWallet: ACTIONS.SET_CURRENT_WALLET })
...mapActions({ setCurrentWallet: ACTIONS.SET_CURRENT_WALLET }),
async expandView() {
if (!chrome.tabs) {
return;
}
chrome.tabs.create({
url: chrome.extension.getURL("index.html"),
active: true
});
window.close();
}
},
computed: {
...mapState({
Expand Down
4 changes: 2 additions & 2 deletions src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,8 @@ export default createStore({
await walletsDbService.getMnemonic(command.walletId, command.password)
);
const changeAddress =
find(addresses, a => a.state === AddressState.Unused)?.script ||
bip32.deriveAddress(0).script;
find(addresses, a => a.state === AddressState.Unused && a.script !== command.recipient)
?.script || bip32.deriveAddress(0).script;

const boxes = await explorerService.getUnspentBoxes(selectedAddresses.map(a => a.script));
const blockHeaders = await explorerService.getLastTenBlockHeaders();
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"baseUrl": ".",
"types": ["webpack-env", "jest"],
"types": ["webpack-env", "jest", "chrome"],
"paths": {
"@/*": ["src/*"]
},
Expand Down

0 comments on commit 326487d

Please sign in to comment.