Skip to content

Commit

Permalink
feat: add sticky prop to Label (#428)
Browse files Browse the repository at this point in the history
* feat: add sticky prop to Label

* Update src/components/Label.vue

Co-authored-by: Fabien <bonustrack@users.noreply.github.com>

---------

Co-authored-by: Fabien <bonustrack@users.noreply.github.com>
  • Loading branch information
j0hnfl0w and bonustrack committed Feb 13, 2023
1 parent 03a9812 commit ecea212
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ watch(route, () => {
<template>
<div
:class="skin"
class="overflow-hidden font-serif text-base min-h-screen bg-skin-bg text-skin-text antialiased"
class="font-serif text-base min-h-screen bg-skin-bg text-skin-text antialiased"
>
<UiLoading v-if="app.loading || !app.init" class="overlay big" />
<div v-else class="pb-6 flex">
Expand Down
13 changes: 11 additions & 2 deletions src/components/Label.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
<script setup>
defineProps({ label: String });
defineProps({
label: String,
sticky: Boolean
});
</script>

<template>
<h4 class="eyebrow border-b py-2 px-4 text-skin-text" v-text="label" />
<h4
class="eyebrow border-b py-2 px-4 text-skin-text"
:class="{
'sticky top-[72px] bg-skin-bg': sticky
}"
v-text="label"
/>
</template>
2 changes: 1 addition & 1 deletion src/components/ProposalsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const currentLimit = computed(() => {

<template>
<div>
<Label :label="title" />
<Label :label="title" sticky />
<UiLoading v-if="loading" class="block px-4 py-3" />
<div v-else>
<BlockInfiniteScroller :loading-more="loadingMore" @end-reached="emit('endReached')">
Expand Down
10 changes: 5 additions & 5 deletions src/views/Space/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const network = computed(() => getNetwork(props.space.network));
<template>
<div class="space-y-3">
<div>
<Label :label="'Voting'" />
<Label :label="'Voting'" sticky />
<div class="mx-4 pt-3">
<div class="mb-3">
<div class="s-label !mb-0">Voting delay</div>
Expand All @@ -38,7 +38,7 @@ const network = computed(() => getNetwork(props.space.network));
</div>

<div>
<Label :label="'Controller'" />
<Label :label="'Controller'" sticky />
<div class="py-3 mx-4">
<a :href="network.helpers.getExplorerUrl(space.controller, 'contract')" target="_blank">
<Stamp :id="space.controller" type="avatar" :size="18" class="mr-2 rounded-sm" />
Expand All @@ -49,7 +49,7 @@ const network = computed(() => getNetwork(props.space.network));
</div>

<div>
<Label :label="'Auth(s)'" />
<Label :label="'Auth(s)'" sticky />
<div v-for="(auth, i) in space.authenticators" :key="i" class="mx-4 py-3 border-b">
<a :href="network.helpers.getExplorerUrl(auth, 'contract')" target="_blank" class="flex">
<h4 class="flex-auto" v-text="network.constants.AUTHS[auth]" />
Expand All @@ -62,7 +62,7 @@ const network = computed(() => getNetwork(props.space.network));
</div>

<div>
<Label :label="'Strategie(s)'" />
<Label :label="'Strategie(s)'" sticky />
<div v-for="(strategy, i) in space.strategies" :key="i" class="mx-4 py-3 border-b">
<a
:href="network.helpers.getExplorerUrl(strategy, 'contract')"
Expand All @@ -79,7 +79,7 @@ const network = computed(() => getNetwork(props.space.network));
</div>

<div>
<Label :label="'Execution(s)'" />
<Label :label="'Execution(s)'" sticky />
<div v-for="(executor, i) in space.executors" :key="i" class="mx-4 py-3 border-b">
<a
:href="network.helpers.getExplorerUrl(executor, 'contract')"
Expand Down
2 changes: 1 addition & 1 deletion src/views/Space/Treasury.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ onMounted(() => {
</div>
<div class="space-y-3">
<div>
<Label label="Treasury" />
<Label label="Treasury" sticky />
<a
:href="explorerUrl('1', spaceData.wallet)"
target="_blank"
Expand Down

0 comments on commit ecea212

Please sign in to comment.