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

fix: Connect wallet and active styles for account #263

Merged
merged 2 commits into from
Mar 22, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
#247: Add background on hover and active for account name
mihailmarcu committed Mar 18, 2022
commit 1555da923f1453fdf041ea26f645dc48718a0505
36 changes: 27 additions & 9 deletions packages/vue/src/components/SpAcc/SpAcc.vue
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
<div
v-if="wallet"
class="sp-nav-link selected account-dropdown-button"
:class="[state.accountDropdown ? 'active' : '']"
style="display: flex; align-items: center"
@click="state.accountDropdown = !state.accountDropdown"
>
@@ -12,16 +13,7 @@
{{ getAccName() }}
</span>
</div>
<SpChevronDownIcon />
</div>
<!-- <div-->
<!-- v-else-->
<!-- class="sp-nav-link"-->
<!-- style="display: flex; align-items: center"-->
<!-- @click="state.connectWalletModal = true"-->
<!-- >-->
<!-- Connect wallet-->
<!-- </div>-->
<SpButton
v-else
aria-label="Connect wallet"
@@ -262,6 +254,32 @@ export default defineComponent({
</script>

<style scoped lang="scss">
.account-dropdown-button {
position: relative;

> * {
position: relative;
z-index: 24;
}

&:after {
content: '';
display: none;
background: rgba(0, 0, 0, 0.03);
border-radius: 8px;
width: calc(100% + 5px);
height: 56px;
position: absolute;
z-index: 23;
left: -7px;
}

&:hover, &.active {
&:after {
display: block;
}
}
}
.navbar-wrapper {
display: flex;
justify-content: space-between;