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

feat: Delegation portal part 2 #4048

Merged
merged 115 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
f67d4fd
Add votes and proposals count
samuveth Jul 6, 2023
0206f39
Merge branch 'develop' into samuv/delegation-2
ChaituVR Jul 6, 2023
e63a9df
Merge branch 'develop' into samuv/delegation-2
samuveth Jul 18, 2023
d621e6a
Fixes
samuveth Jul 18, 2023
acd02b6
Remove demo variable
samuveth Jul 18, 2023
a8c3c41
Merge branch 'develop' into samuv/delegation-2
samuveth Aug 8, 2023
789de41
Merge branch 'develop' into samuv/delegation-2
samuveth Aug 10, 2023
6d539de
Add button type
samuveth Aug 10, 2023
82b1776
Add three dot button and fix spacing
samuveth Aug 10, 2023
399c770
Fix delegate modal
samuveth Aug 11, 2023
74bca2c
Fixes
samuveth Aug 11, 2023
1dac9a8
Fix loaded delegates loading again
samuveth Aug 11, 2023
a5cce51
Fix flash notification multi line
samuveth Aug 11, 2023
7804b4e
Fix width
samuveth Aug 11, 2023
2d240d6
Fixes
samuveth Aug 11, 2023
38d08d9
Fixes
samuveth Aug 11, 2023
3c7c013
Fix align
samuveth Aug 11, 2023
53928b4
Fix align
samuveth Aug 11, 2023
a6a9a07
Merge branch 'develop' into samuv/delegation-2
samuveth Aug 11, 2023
cfc8581
Merge branch 'develop' into samuv/delegation-2
samuveth Aug 11, 2023
fc5636e
Add full screen modal
samuveth Aug 12, 2023
54e32a8
Fix min size on textarea
samuveth Aug 12, 2023
269fd67
Refactor statement
samuveth Aug 12, 2023
fef12e7
Fix styles
samuveth Aug 12, 2023
6d147a7
Merge branch 'develop' into samuv/delegation-2
samuveth Aug 12, 2023
73fb663
Merge branch 'develop' into samuv/delegation-2
samuveth Aug 12, 2023
5d36e32
Add delegate info and make fixes
samuveth Aug 12, 2023
dc9f037
Fix tune
samuveth Aug 12, 2023
2a60797
Fix full screen modal
samuveth Aug 12, 2023
c04bf0b
Fixes
samuveth Aug 12, 2023
afff2af
Add switch button
samuveth Aug 13, 2023
285b588
Fixes
samuveth Aug 13, 2023
22663c8
Remove max height
samuveth Aug 13, 2023
3b2218c
Fix gutter
samuveth Aug 13, 2023
d1360a1
Fix
samuveth Aug 13, 2023
aef5564
Add paths
samuveth Aug 13, 2023
e5a134d
Fixes
samuveth Aug 13, 2023
78b1b28
Fix
samuveth Aug 13, 2023
170c06a
Fix nav
samuveth Aug 13, 2023
b9c9875
Fix responsive
samuveth Aug 13, 2023
b9d7640
Add self delegate text
samuveth Aug 13, 2023
9d1074d
Fixes responsive
samuveth Aug 14, 2023
56db424
Fix
samuveth Aug 14, 2023
bb4153c
Merge branch 'develop' into samuv/delegation-2
samuveth Aug 14, 2023
d8c8248
Fix
samuveth Aug 14, 2023
4aa8bca
Fixes
samuveth Aug 14, 2023
105fc6e
Show error message
samuveth Aug 14, 2023
926c459
Remove route
samuveth Aug 14, 2023
1c7fce2
Add dropdown and fixes
samuveth Aug 14, 2023
064a766
Fix sticky
samuveth Aug 14, 2023
595a597
Fixes
samuveth Aug 15, 2023
eb00554
Merge branch 'develop' into samuv/delegation-2
samuveth Aug 16, 2023
c94b6fd
Fix cursor issue
samuveth Aug 16, 2023
570587f
Full width nav
samuveth Aug 16, 2023
be6bb2e
Convert modal to page and add breadcrumbs
samuveth Aug 17, 2023
99f4503
Cleanup
samuveth Aug 17, 2023
be17c09
Remove placeholder text
samuveth Aug 18, 2023
cc82e6c
Refactor and fixes
samuveth Aug 18, 2023
66ca7cd
Fixes loading balance
samuveth Aug 18, 2023
40f81c5
Fix skeleton
samuveth Aug 18, 2023
60d3f59
Fix onboarding
samuveth Aug 18, 2023
c9aed06
Fix align
samuveth Aug 18, 2023
9e3c9cb
Fix breadcrumb
samuveth Aug 18, 2023
896b135
Fix skeleton
samuveth Aug 18, 2023
a4805f5
Fix margin
samuveth Aug 18, 2023
6cea8bc
Fix align
samuveth Aug 18, 2023
b13a007
Load profiles async
samuveth Aug 18, 2023
b7cdb28
Merge branch 'develop' into samuv/delegation-2
samuveth Aug 18, 2023
14a2f2e
Fix search height
samuveth Aug 18, 2023
289dd07
Merge branch 'develop' into samuv/delegation-2
samuveth Aug 20, 2023
6f4973c
Fix delegate route
samuveth Aug 20, 2023
0ded242
Fix spacing
samuveth Aug 20, 2023
77a8bd8
Handle different accounts
samuveth Aug 20, 2023
b890501
Make card clickable
samuveth Aug 21, 2023
d3a7433
Merge branch 'develop' into samuv/delegation-2
samuveth Aug 23, 2023
a0e53ae
Add action bar mobile
samuveth Aug 24, 2023
ead517b
Fix heading text
samuveth Aug 24, 2023
2c6b054
Fix threedot
samuveth Aug 24, 2023
eccfab1
Refactor round button and make sidebar design fixes
samuveth Aug 24, 2023
50e519b
Fix sort button
samuveth Aug 24, 2023
77aef54
Fix delegates list
samuveth Aug 24, 2023
356b709
Fix action bar to bottom
samuveth Aug 24, 2023
09a34e1
Delete old component
samuveth Aug 24, 2023
7fd4f09
Fix delegate action button
samuveth Aug 24, 2023
abf9de5
Fix button switch to work with full width
samuveth Aug 24, 2023
16a48a7
Fix lg
samuveth Aug 24, 2023
694b704
Fix space heading lg
samuveth Aug 24, 2023
002c3a2
Fix spacing delegate
samuveth Aug 24, 2023
eed1053
Merge branch 'develop' into samuv/delegation-2
samuveth Aug 24, 2023
51cb32b
Remove spaces
samuveth Aug 24, 2023
8d85a50
Merge branch 'develop' into samuv/delegation-2
samuveth Aug 28, 2023
0782fab
Fix statement preview and edit
samuveth Aug 28, 2023
dcd73f5
Fix card and spacing
samuveth Aug 28, 2023
11f28c5
Fix delegate on delegate profile
samuveth Aug 29, 2023
13c6f39
Handle errors
samuveth Aug 29, 2023
456528f
Fix button
samuveth Aug 29, 2023
6e63deb
Add un-delegate
samuveth Aug 29, 2023
94cfac8
Fixes
samuveth Aug 29, 2023
9aed9c6
Fixes
samuveth Aug 30, 2023
51a836f
Merge branch 'develop' into samuv/delegation-2
samuveth Sep 4, 2023
960de37
Disable save button if not edited
samuveth Sep 4, 2023
b1b1ab5
Show unsaved warning
samuveth Sep 4, 2023
e6f2313
Fix settings with new modal
samuveth Sep 4, 2023
8db3722
Merge branch 'samuv/delegation-2' of github.com:snapshot-labs/snapsho…
samuveth Sep 4, 2023
643811e
Full width footer
samuveth Sep 4, 2023
8b615be
Fix save button remain active after save
samuveth Sep 4, 2023
26fb4d3
Fix errors
samuveth Sep 4, 2023
ed071fa
Handle login on delegate page
samuveth Sep 4, 2023
846d152
Fix un-delegate
samuveth Sep 4, 2023
50030b3
Merge branch 'develop' into samuv/delegation-2
samuveth Sep 5, 2023
0fceaba
Add raw number
samuveth Sep 5, 2023
54ad7f0
Remove history
samuveth Sep 5, 2023
7536df8
Go to profile instead of delegate profile
samuveth Sep 5, 2023
c9c12b7
Add copy
samuveth Sep 5, 2023
8f32e19
Reduce footer width back to before
samuveth Sep 5, 2023
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
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ onMounted(async () => {
<footer v-if="route.name === 'home'" class="mt-auto">
<TheFooter />
</footer>
<div id="action-bar" />
</div>
</div>

<TheFlashNotification />
<TheModalNotification />
</template>
14 changes: 14 additions & 0 deletions src/assets/icons/line-arrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/AvatarSpace.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const props = withDefaults(
previewFile?: File;
}>(),
{
size: '22',
size: '20',
previewFile: undefined
}
);
Expand Down
24 changes: 24 additions & 0 deletions src/components/BaseBreadcrumbs.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<script setup lang="ts">
defineProps<{
pages: { name: string; to: string; current: boolean }[];
}>();
</script>

<template>
<div class="flex items-center">
<div v-for="(page, i) in pages" :key="i" class="flex items-center">
<router-link v-if="!page.current" :to="page.to" class="flex items-center">
<span class="text-skin-link">{{ page.name }}</span>
</router-link>
<div v-else class="flex cursor-default items-center">
<span class="text-skin-link opacity-40">{{ page.name }}</span>
</div>
<div class="mx-1 flex h-[20px] w-[20px] items-center justify-center">
<i-ho-chevron-right
v-if="i < pages.length - 1"
class="shrink-0 text-xs text-skin-text"
/>
</div>
</div>
</div>
</template>
1 change: 1 addition & 0 deletions src/components/BaseButtonIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ defineProps<{

<template>
<button
type="button"
:disabled="isDisabled"
:class="{ '!cursor-not-allowed': isDisabled }"
class="flex items-center rounded-full p-[6px] text-md text-skin-text transition-colors duration-200 hover:text-skin-link"
Expand Down
16 changes: 12 additions & 4 deletions src/components/BaseButtonRound.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
<script setup lang="ts">
defineProps<{
isDisabled?: boolean;
}>();
withDefaults(
defineProps<{
isDisabled?: boolean;
size?: string;
}>(),
{
isDisabled: false,
size: '46px'
}
);
</script>

<template>
<button
:disabled="isDisabled"
:class="{ '!cursor-not-allowed': isDisabled }"
class="flex h-[44px] w-[44px] cursor-pointer select-none items-center justify-center rounded-full border hover:border-skin-text"
class="flex cursor-pointer select-none items-center justify-center rounded-full border hover:border-skin-text"
:style="`width: ${size}; height: ${size}`"
>
<slot />
</button>
Expand Down
2 changes: 1 addition & 1 deletion src/components/BaseCombobox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ watch(
as="div"
class="w-full"
>
<ComboboxLabel class="block">
<ComboboxLabel v-if="label" class="block">
<LabelInput :information="information">{{ label }}</LabelInput>
</ComboboxLabel>
<div class="relative">
Expand Down
2 changes: 1 addition & 1 deletion src/components/BaseComboboxMultiple.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ watch(

<template>
<Combobox v-model="selectedItems" multiple as="div" class="w-full">
<ComboboxLabel class="block">
<ComboboxLabel v-if="label" class="block">
<LabelInput :information="information">{{ label }}</LabelInput>
</ComboboxLabel>
<div class="relative">
Expand Down
2 changes: 1 addition & 1 deletion src/components/BaseListbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const selectedItem = computed({

<template>
<Listbox v-model="selectedItem" as="div" :disabled="disableInput">
<ListboxLabel>
<ListboxLabel v-if="label || definition?.title">
<LabelInput :information="information || definition?.description">
{{ label || definition?.title }}
</LabelInput>
Expand Down
2 changes: 1 addition & 1 deletion src/components/BaseListboxMultiple.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function isItemDisabled(item: string) {

<template>
<Listbox v-model="selectedItems" as="div" :disabled="isDisabled" multiple>
<ListboxLabel>
<ListboxLabel v-if="label || definition?.title">
<LabelInput :information="information || definition?.description">
{{ label || definition?.title }}
</LabelInput>
Expand Down
4 changes: 2 additions & 2 deletions src/components/BaseModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ onBeforeUnmount(() => {
</div>
<BaseButtonIcon
v-if="!hideClose"
class="absolute right-3 top-[20px]"
class="absolute right-[20px] top-[20px]"
@click="emit('close')"
>
<i-ho-x />
<i-ho-x class="text-[17px]" />
</BaseButtonIcon>
</div>
</div>
Expand Down
59 changes: 59 additions & 0 deletions src/components/BaseModalFullscreen.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<script setup lang="ts">
import {
Dialog,
DialogPanel,
TransitionChild,
TransitionRoot
} from '@headlessui/vue';

defineEmits(['close']);

defineProps<{
open: boolean;
title?: string;
}>();

onBeforeMount(() => {
document.documentElement.style.setProperty('scrollbar-gutter', 'auto');
});

onBeforeUnmount(() => {
document.documentElement.style.setProperty('scrollbar-gutter', 'stable');
});
</script>

<template>
<TransitionRoot appear :show="open" as="template">
<Dialog as="div" class="relative z-50" @close="$emit('close')">
<div class="fixed inset-0 overflow-y-auto">
<div class="flex min-h-full items-center justify-center">
<!-- enter from below -->
<TransitionChild as="template">
<DialogPanel
class="h-screen w-full transform overflow-y-auto bg-skin-bg p-0 align-middle transition-all"
style="scrollbar-gutter: stable"
>
<div
class="sticky top-0 z-10 h-[70px] w-full border-b border-skin-border bg-skin-bg"
>
<div class="absolute right-[18px] top-[18px]">
<span tabindex="0"></span>
<BaseButtonIcon @click="$emit('close')">
<span class="sr-only">Close</span>
<i-ho-x class="text-base" aria-hidden="true" />
</BaseButtonIcon>
</div>
</div>
<div
class="mt-4 pb-[40px] text-base"
:class="{ 'scrolling-enabled': open }"
>
<slot />
</div>
</DialogPanel>
</TransitionChild>
</div>
</div>
</Dialog>
</TransitionRoot>
</template>
4 changes: 2 additions & 2 deletions src/components/BaseSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ watch(

<template>
<div
class="flex h-[46px] items-center"
class="flex h-[44px] items-center"
:class="{ 'border-b bg-skin-bg py-3 pl-4': modal }"
>
<i-ho-search class="mr-2 flex-shrink-0 text-[19px] text-skin-link" />
Expand All @@ -53,7 +53,7 @@ watch(
/>
<i-ho-x-circle
v-if="modelValue"
class="mr-2 flex-shrink-0 cursor-pointer text-[16px] text-skin-link"
class="mr-[6px] flex-shrink-0 cursor-pointer text-[16px] text-skin-link"
@click="clearInput"
/>
<slot name="after" class="flex-shrink-0" />
Expand Down
2 changes: 1 addition & 1 deletion src/components/ButtonBack.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defineProps<{
</script>

<template>
<button>
<button type="button">
<div
class="inline-flex items-center gap-1 text-skin-text hover:text-skin-link"
>
Expand Down
43 changes: 43 additions & 0 deletions src/components/ButtonSwitch.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<script setup lang="ts">
interface State {
value: string | number | boolean;
name: string;
}

defineProps<{
modelValue: string | number | boolean;
state1: State;
state2: State;
}>();

defineEmits(['update:modelValue']);
</script>

<template>
<div class="inline-flex items-center rounded-full border p-1">
<div
:class="[
'w-full cursor-pointer px-3 py-1 text-center',
{
'rounded-full bg-skin-border text-skin-heading':
state1.value === modelValue
}
]"
@click="$emit('update:modelValue', state1.value)"
>
{{ state1.name }}
</div>
<div
:class="[
'w-full cursor-pointer px-3 py-1 text-center',
{
'rounded-full bg-skin-border text-skin-heading':
state2.value === modelValue
}
]"
@click="$emit('update:modelValue', state2.value)"
>
{{ state2.name }}
</div>
</div>
</template>
39 changes: 39 additions & 0 deletions src/components/ModalConfirmLeave.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<script setup lang="ts">
defineProps<{
open: boolean;
title?: string;
disabled?: boolean;
}>();

defineEmits(['close', 'save', 'leave']);
</script>

<template>
<BaseModal :open="open" @close="$emit('close')">
<template #header>
<div class="flex flex-row items-center justify-center">
<h3>{{ title ? title : 'Unsaved changes' }}</h3>
</div>
</template>

<BaseMessageBlock level="warning" class="m-4">
You have unsaved changes. Would you like to save them before leaving?
</BaseMessageBlock>

<template #footer>
<div class="flex gap-3">
<BaseButton class="w-full" @click="$emit('leave'), $emit('close')">
Leave
</BaseButton>
<BaseButton
class="w-full"
primary
:disabled="disabled"
@click="$emit('save'), $emit('close')"
>
Save
</BaseButton>
</div>
</template>
</BaseModal>
</template>
2 changes: 1 addition & 1 deletion src/components/NavbarExtras.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function clickNavigationItem(item: any) {
<template>
<BasePopover>
<template #button>
<BaseButtonRound class="relative !h-[46px] !w-[46px]">
<BaseButtonRound class="relative">
<i-ho-dots-horizontal class="text-skin-link" />
</BaseButtonRound>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/NavbarNotifications.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ onMounted(() => loadNotifications());
<template>
<BasePopover>
<template #button>
<BaseButtonRound class="relative !h-[46px] !w-[46px]">
<BaseButtonRound class="relative">
<i-ho-bell class="text-skin-link" />
<BaseIndicator
v-if="notificationsSortedByTime.some(n => n.seen === false)"
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProposalsItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ onMounted(() => setMessageVisibility(props.proposal.flagged));
<LabelProposalState :state="proposal.state" />
</div>

<router-link :to="to">
<router-link :to="to" class="cursor-pointer">
<ProposalsItemTitle :proposal="proposal" :voted="voted" />

<ProposalsItemBody v-if="body">
Expand Down
3 changes: 2 additions & 1 deletion src/components/SettingsSubSpacesBlock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,12 @@ const removeChild = (child: string) => {
<div>
<BaseButtonRound
:is-disabled="isViewOnly"
class="!h-[42px] !w-[42px] whitespace-nowrap text-skin-link"
class="whitespace-nowrap text-skin-link"
:class="{
'cursor-not-allowed !text-skin-text hover:border-skin-border':
!foundChild || lookingUpChild
}"
size="42px"
@click="addChild()"
>
<i-ho-plus class="text-sm" />
Expand Down
Loading