Skip to content

Commit

Permalink
feat: add borrower/trustee state and small fix in balance
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Bedon committed Nov 14, 2023
1 parent c98852b commit c7bb125
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 2 deletions.
15 changes: 15 additions & 0 deletions @kiva/kv-components/vue/KvWwwHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
ref="menuComponentInstance"
:logged-in="loggedIn"
:login-url="loginUrl"
:balance="balance"
:is-borrower="isBorrower"
:is-trustee="isTrustee"
@load-lend-menu-data="emitLendMenuEvent"
/>
</div>
Expand Down Expand Up @@ -144,6 +147,18 @@ export default {
type: String,
default: '/ui-login',
},
balance: {
type: Number,
default: 0,
},
isBorrower: {
type: Boolean,
default: false,
},
isTrustee: {
type: Boolean,
default: false,
},
},
emits: [
'load-lend-menu-data',
Expand Down
22 changes: 21 additions & 1 deletion @kiva/kv-components/vue/KvWwwHeader/KvHeaderMyKivaMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
>
<span>Portfolio</span>
<span class="tw-text-secondary">|</span>
<span class="tw-text-eco-green-3">{{ balance }}</span>
<span class="tw-text-eco-green-3">${{ balance }}</span>
</kv-header-menu-link>
<kv-header-menu-link
href="/teams/my-teams"
Expand All @@ -23,6 +23,18 @@
>
Settings
</kv-header-menu-link>
<kv-header-menu-link
v-if="isBorrower"
to="/my/borrower"
>
Borrower Dashboard
</kv-header-menu-link>
<kv-header-menu-link
v-if="isTrustee"
to="/my/trustee"
>
Trustee Dashboard
</kv-header-menu-link>
<kv-header-menu-link
href="/ui-logout"
>
Expand All @@ -43,6 +55,14 @@ export default {
type: Number,
default: 0,
},
isBorrower: {
type: Boolean,
default: false,
},
isTrustee: {
type: Boolean,
default: false,
},
},
};
</script>
17 changes: 16 additions & 1 deletion @kiva/kv-components/vue/stories/KvWwwHeader.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@ export default {
type: 'text',
},
},
balance: {
control: {
type: 'number',
},
},
isTrustee: {
control: {
type: 'boolean',
},
},
isBorrower: {
control: {
type: 'boolean',
},
},
},
};

Expand All @@ -32,7 +47,7 @@ const story = (args) => {
components: { KvWwwHeader, KvPageContainer },
template: `
<div class="tw-relative">
<kv-www-header :logged-in="loggedIn" :basket-count="basketCount" :login-url="loginUrl" />
<kv-www-header :logged-in="loggedIn" :basket-count="basketCount" :login-url="loginUrl" :balance="balance" :is-trustee="isTrustee" :is-borrower="isBorrower" />
<kv-page-container>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam molestie tellus quis auctor luctus. Fusce consequat sit amet tortor sit amet euismod. Proin finibus blandit tortor scelerisque facilisis. Duis in euismod justo. Nam efficitur eu metus quis cursus. Duis a ligula nisi. Duis ligula eros, pharetra interdum malesuada vitae, feugiat quis ligula. Fusce non vestibulum elit, sed vehicula augue. Sed tellus dui, vestibulum in gravida eget, gravida a arcu. Duis sed sapien cursus velit bibendum auctor non a eros. Donec libero odio, fermentum faucibus justo vel, efficitur malesuada velit. Morbi odio ligula, congue id odio in, ornare bibendum turpis. Nunc consectetur imperdiet rutrum. Ut posuere turpis ac lacinia finibus. Proin velit arcu, ultrices vitae lacinia quis, tincidunt at justo.</p>
<p>Morbi volutpat eget enim eu tristique. Suspendisse potenti. Vivamus mollis purus magna, nec suscipit purus tempor id. Nulla porta ipsum sit amet sollicitudin accumsan. Cras pulvinar fringilla ullamcorper. Praesent sit amet sapien metus. Morbi volutpat tortor sed eros mattis ultricies. Duis convallis finibus lacus, a tempus felis pretium in. Ut eu est sem. Ut auctor ullamcorper dignissim. Praesent quis ullamcorper dui, ac sodales mi. Nullam volutpat augue vulputate congue suscipit. Praesent consectetur sem libero, id pharetra urna porttitor nec. Praesent vitae orci neque. Nam a diam orci.</p>
Expand Down

0 comments on commit c7bb125

Please sign in to comment.