Skip to content

Commit 6a250ea

Browse files
authored
add no entry message (#729)
* add no entry message * update wording
1 parent 033d0e1 commit 6a250ea

File tree

4 files changed

+38
-3
lines changed

4 files changed

+38
-3
lines changed

_locales/en/messages.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,5 +431,8 @@
431431
},
432432
"learn_more": {
433433
"message": "Learn more"
434+
},
435+
"no_entires": {
436+
"message": "No accounts to display. Add your first account now."
434437
}
435438
}

sass/popup.scss

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ svg {
229229
.issuer,
230230
.showqr,
231231
.showqr.hidden,
232-
.pin {
232+
.pin,
233+
.no-entry {
233234
display: none;
234235
}
235236

@@ -278,6 +279,21 @@ svg {
278279
animation: twinkling 1s infinite ease-in-out;
279280
}
280281
}
282+
283+
.no-entry {
284+
@include themify($themes) {
285+
color: themed("grey-1");
286+
}
287+
288+
margin: 20px;
289+
text-align: center;
290+
291+
svg {
292+
width: 48px;
293+
height: 48px;
294+
margin: 20px;
295+
}
296+
}
281297
}
282298

283299
.entry {

src/components/Popup/MainBody.vue

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@
3939
v-bind:entry="entry"
4040
v-bind:tabindex="getTabindex(entry)"
4141
/>
42+
<div class="no-entry" v-if="entries.length === 0">
43+
<IconKey />
44+
<p>
45+
{{ i18n.no_entires }}
46+
<a href="#" v-on:click="openLink('https://otp.ee/quickstart')">{{
47+
i18n.learn_more
48+
}}</a>
49+
</p>
50+
</div>
4251
</div>
4352
</div>
4453
</template>
@@ -50,7 +59,8 @@ import { EntryStorage } from "../../models/storage";
5059
5160
import EntryComponent from "./EntryComponent.vue";
5261
53-
import IconPlus from "../../../svg/plus.svg";
62+
// import IconPlus from "../../../svg/plus.svg";
63+
import IconKey from "../../../svg/key-solid.svg";
5464
5565
const computed: {
5666
filter: () => boolean;
@@ -70,6 +80,10 @@ export default Vue.extend({
7080
},
7181
computed,
7282
methods: {
83+
openLink(url: string) {
84+
window.open(url, "_blank");
85+
return;
86+
},
7387
isMatchedEntry(entry: OTPEntry) {
7488
for (const hash of this.$store.getters["accounts/matchedEntries"]) {
7589
if (entry.hash === hash) {
@@ -184,7 +198,8 @@ export default Vue.extend({
184198
},
185199
components: {
186200
EntryComponent,
187-
IconPlus,
201+
// IconPlus,
202+
IconKey,
188203
},
189204
});
190205
</script>

svg/key-solid.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)