Skip to content

Commit

Permalink
[@dhealthdapps/frontend] fix(screens): update styles for stats compon…
Browse files Browse the repository at this point in the history
…ent, update icons for dropdown, change fit to activ names
  • Loading branch information
kravchenkodhealth authored and evias committed Jan 12, 2023
1 parent 5c920c0 commit 4e314c7
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 15 deletions.
1 change: 1 addition & 0 deletions runtime/dapp-frontend-vue/resources/i18n/en/Common.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"disconnect_wallet": "Disconnect wallet",
"activities": "Activities",
"amount_earned": "$ACTIV earned",
"currency_name": "$ACTIV",
"no_activities": "You don't have any activities currently."
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions runtime/dapp-frontend-vue/src/components/AppHeader/AppHeader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ export default class AppHeader extends MetaView {
*/
get dropDownItems() {
return [
{
text: this.$t("common.dropdown_refer_earn"),
action: () => this.$router.push({ name: "app.dashboard" }),
icon: "icons/refer-earn.svg",
},
{
text: this.$t("common.activities"),
action: () => this.$router.push({ name: "app.activities" }),
icon: "icons/Activity-icon-header.svg",
},
{
text: this.$t("common.dropdown_refer_earn"),
action: () => this.$router.push({ name: "app.dashboard" }),
icon: "icons/refer-earn.svg",
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

&__actions {
position: absolute;
right: 50%;
right: 0;
transform: translateX(64%);
top: 50px;
background-color: $white;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
border-radius: 8px;
top: 35px;
display: none;
z-index: 3;

&.left {
left: -19px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<TopActivities :items="data.activities" />
</div>
<div class="dapp-leaderboard-item__amount text-right">
<span v-html="`$${formatAmount(data.amount, 2)} FIT`" />
<span v-html="`$${formatAmount(data.amount, 2)} $ACTIV`" />
</div>
</div>
<div v-else class="dapp-leaderboard-item__custom">
Expand Down
2 changes: 1 addition & 1 deletion runtime/dapp-frontend-vue/src/components/Stats/Stats.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
font-family: "Dotrice";
font-size: 72px;
line-height: 100%;
text-align: left;

@include devices(laptop) {
font-size: 54px;
Expand All @@ -50,7 +51,6 @@
align-items: center;
justify-content: space-between;
width: 100%;
max-width: 263px;
margin: 8px auto 0 auto;

span {
Expand Down
2 changes: 1 addition & 1 deletion runtime/dapp-frontend-vue/src/components/Stats/Stats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
/>
</div>
<div class="activities-list text-right">
<TopActivities :items="topActivities" />
<TopActivities :items="topActivities" :sticked="true" />
<span
class="dapp-stats__other__label"
v-html="$t('dashboard.stats_top_activities')"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
display: inline-block;
margin-inline-end: 12px;

&.sticked {
position: relative;
margin-inline-end: 0;
}

@include devices(tablet) {
margin-inline-end: 4px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ export default class TopActivities extends MetaView {
@Prop({ default: () => [] })
public items!: string[];

/**
* Defines positioning of icons
*
* @access public
* @readonly
* @var {boolean}
*/
@Prop({ default: false })
public readonly sticked?: boolean;

/**
* This property contains the user statistics and maps to a store
* getter named `statistics/getUserStatistics`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@

<template>
<ul v-if="items && items.length" class="dapp-activities">
<li v-for="(activity, index) in fetchedItems" :key="activity + index">
<li
:class="{ sticked: sticked }"
:style="{
'z-index': sticked && index > 0 ? index : 0,
right: `${6 * index}px`,
}"
v-for="(activity, index) in fetchedItems"
:key="activity + index"
>
<inline-svg
:src="getImageUrl(`activities-icons/${activity}.svg`)"
:alt="activity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
:width="16"
class="dapp-logo__image"
/>
{{ userBalance }} $ACTIV
{{ userBalance }} {{ $t("common.currency_name") }}
</div>
</template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ describe("LeaderBoardRow -->", () => {
// );
// });

it("should display correctly formatted amount of $FIT", () => {
it("should display correctly formatted amount of $ACTIV", () => {
expect(
widget.find(".dapp-leaderboard-item__amount span").text()
).to.be.equal(
`$${widget.vm.formatAmount(widget.props("data").amount, 2)} FIT`
`$${widget.vm.formatAmount(widget.props("data").amount, 2)} ACTIV`
);
});
});
4 changes: 2 additions & 2 deletions runtime/dapp-frontend-vue/tests/unit/components/Tabs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const componentOptions = {
direction: "up",
},
{
title: "$FIT earned",
title: "$ACTIV earned",
amount: 560,
direction: "down",
},
Expand Down Expand Up @@ -70,7 +70,7 @@ const componentOptions = {
direction: "down",
},
{
title: "$FIT earned",
title: "$ACTIV earned",
amount: 350,
direction: "down",
},
Expand Down

0 comments on commit 4e314c7

Please sign in to comment.