-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Governance links section * Add Governance link to the sidebar * Rename hook variables * Add link to mobile nav * Dark theme support * Limit link text to 3 lines * Total rewards claimed
- Loading branch information
Showing
11 changed files
with
385 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<template> | ||
<div class="link-wrapper"> | ||
<a :href="url" target="_blank" rel="noopener noreferrer">{{ title }}</a> | ||
<div><astar-icon-arrow-right /></div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from 'vue'; | ||
export default defineComponent({ | ||
props: { | ||
index: { | ||
type: Number, | ||
required: true, | ||
}, | ||
title: { | ||
type: String, | ||
required: true, | ||
}, | ||
url: { | ||
type: String, | ||
required: true, | ||
}, | ||
}, | ||
}); | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
@import 'src/css/quasar.variables.scss'; | ||
.link-wrapper { | ||
display: flex; | ||
color: $astar-blue; | ||
align-items: center; | ||
gap: 8px; | ||
max-height: 80px; | ||
} | ||
a { | ||
color: $astar-blue; | ||
display: -webkit-box; | ||
-webkit-box-orient: vertical; | ||
-webkit-line-clamp: 3; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
max-height: 4.5em; | ||
line-height: 1.5em; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<template> | ||
<div v-if="isGovernanceEnabled" class="governance-links-container governance-container"> | ||
<div class="header"><astar-icon-governance />{{ $t('governance.newProposals') }}</div> | ||
<hr class="separator" /> | ||
<div class="governance-container"> | ||
<div v-for="proposal in proposals" :key="proposal.index"> | ||
<governance-link :index="proposal.index" :title="proposal.title" :url="proposal.url" /> | ||
</div> | ||
</div> | ||
<div v-if="ongoingReferenda" class="governance-container"> | ||
<div class="header"><astar-icon-governance />{{ $t('governance.ongoingReferenda') }}</div> | ||
<hr class="separator" /> | ||
<governance-link | ||
:index="ongoingReferenda.index" | ||
:title="ongoingReferenda.title" | ||
:url="ongoingReferenda.url" | ||
/> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from 'vue'; | ||
import { useGovernance } from 'src/hooks'; | ||
import GovernanceLink from './GovernanceLink.vue'; | ||
export default defineComponent({ | ||
components: { GovernanceLink }, | ||
setup() { | ||
const { isGovernanceEnabled, proposals, ongoingReferenda } = useGovernance(); | ||
return { isGovernanceEnabled, proposals, ongoingReferenda }; | ||
}, | ||
}); | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
@import 'src/css/quasar.variables.scss'; | ||
.governance-links-container { | ||
background-color: $white; | ||
border: 1px solid $gray-2; | ||
border-radius: 16px; | ||
padding: 16px 24px; | ||
font-size: 15px; | ||
font-weight: 500; | ||
line-height: 18px; | ||
color: $navy-1; | ||
} | ||
.governance-container { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 16px; | ||
} | ||
.separator { | ||
border-top: 1px solid $gray-2; | ||
} | ||
.header { | ||
display: flex; | ||
align-items: center; | ||
gap: 8px; | ||
padding: 4px 0 0 4px; | ||
} | ||
.body--dark { | ||
.governance-links-container { | ||
border-color: $navy-3; | ||
background-color: $navy-1; | ||
color: $white; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.