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: Boost #4437

Merged
merged 448 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from 76 commits
Commits
Show all changes
448 commits
Select commit Hold shift + click to select a range
c5cfbc7
Fix close network modal
samuveth Jan 23, 2024
9f094ce
Reduce decimals
samuveth Jan 23, 2024
d49e4af
Use full length for time left and reduce text length
samuveth Jan 23, 2024
179c010
Remove scroll
samuveth Jan 23, 2024
a49742a
Add boosted indicator to proposals item
samuveth Jan 23, 2024
95cc7a0
Fix
samuveth Jan 23, 2024
b9ab3f9
Add reload after burn
samuveth Jan 23, 2024
ec4da3d
Add claim modal and refactor
samuveth Jan 23, 2024
2bf8c20
Fix
samuveth Jan 23, 2024
9d94099
Refactor
samuveth Jan 24, 2024
7c8c35e
Fix unconnected
samuveth Jan 24, 2024
4fb086d
Handle no user vote
samuveth Jan 24, 2024
bfafd3f
Add message that boost isn't available voting type
samuveth Jan 24, 2024
96f6a02
Fix max amount
samuveth Jan 24, 2024
986f82b
Fix type
samuveth Jan 24, 2024
cf109b3
Fix type
samuveth Jan 24, 2024
0d3d98c
Fix owner design
samuveth Jan 24, 2024
da84442
Merge branch 'master' into samuv/boost
samuveth Jan 24, 2024
288c040
Merge branch 'master' into samuv/boost
samuveth Jan 24, 2024
6a7f992
Fix time left
samuveth Jan 24, 2024
cafd26c
Add nft format
samuveth Jan 26, 2024
6e11d78
Cleanup
samuveth Jan 26, 2024
faa4710
Fix uri url
samuveth Jan 26, 2024
88a602f
Fix type
samuveth Jan 26, 2024
fd6a5f4
Add space setting
samuveth Jan 26, 2024
eb2e28d
Fix strategy
samuveth Jan 26, 2024
a48cd0c
Fix claim all
samuveth Jan 26, 2024
f4eaba9
Fix string
samuveth Jan 26, 2024
2441e4e
Fix strategy
samuveth Jan 29, 2024
1bd6248
Updates
samuveth Jan 29, 2024
d3bee0f
Fix wrap
samuveth Jan 29, 2024
488cd9e
Fix loading
samuveth Jan 29, 2024
b32059b
Refactor
samuveth Jan 29, 2024
98bcce2
Change color
samuveth Jan 30, 2024
eb5afc9
Fixes
samuveth Jan 30, 2024
3d2e64c
Add claimed success modal
samuveth Jan 30, 2024
a6ae682
Fix
samuveth Jan 30, 2024
ce4c05b
Merge branch 'master' into samuv/boost
samuveth Jan 31, 2024
73e1ac9
Fix empty web3Address
samuveth Jan 31, 2024
83631ba
Fix background
samuveth Jan 31, 2024
34baa0b
Add claim tx
samuveth Jan 31, 2024
117cbb9
Merge branch 'master' into samuv/boost
samuveth Jan 31, 2024
801f0b5
Add lottery settings
samuveth Jan 31, 2024
6600a4f
Fix text
samuveth Feb 1, 2024
daf2e91
Add lottery conditions
samuveth Feb 1, 2024
696edd1
Fix modal spacing
samuveth Feb 1, 2024
867b854
Merge branch 'master' into samuv/boost
samuveth Feb 1, 2024
1434792
Fix winner amount
samuveth Feb 1, 2024
18575ae
Merge branch 'master' into samuv/boost
samuveth Feb 2, 2024
168f6fe
Fix sorting by reward amount
samuveth Feb 2, 2024
2132f7b
Fix
samuveth Feb 2, 2024
aa443dc
Add whitelist and check
samuveth Feb 6, 2024
ae07ccd
Merge branch 'master' into samuv/boost
samuveth Feb 12, 2024
54595e5
Add terms modal
samuveth Feb 13, 2024
13f3f44
Realtime countdown
samuveth Feb 13, 2024
911b339
Fix reload when claim ready
samuveth Feb 13, 2024
8b691a5
Merge branch 'master' into samuv/boost
samuveth Feb 13, 2024
7d48358
Merge branch 'master' into samuv/boost
samuveth Feb 14, 2024
279814c
Fix boost modal text
samuveth Feb 14, 2024
d3bdfb1
Fix load balances
samuveth Feb 14, 2024
ec8c2f0
Remove default values and add mainnet network
samuveth Feb 14, 2024
1a2e06b
Fix token balance
samuveth Feb 14, 2024
dd41616
Update boost contract mainnet
samuveth Feb 14, 2024
4853b2b
Update subgraph
samuveth Feb 14, 2024
a4742bb
Update subgraph
samuveth Feb 14, 2024
50dd4ed
Add production whitelist
samuveth Feb 14, 2024
f720714
Update subgraph
samuveth Feb 14, 2024
ab868d2
Update safe contract sepolia
samuveth Feb 14, 2024
4ac291f
Remove space from testnet whitelist
samuveth Feb 14, 2024
11bc797
whitelist fabien.eth space
bonustrack Feb 15, 2024
c660a19
Merge branch 'master' into samuv/boost
samuveth Feb 17, 2024
42f939b
fix: Demo is currently not supported
samuveth Feb 17, 2024
163fc45
Merge branch 'master' into samuv/boost
samuveth Feb 17, 2024
5b6d818
Add constants
samuveth Feb 18, 2024
3379f60
Add reward per winner footer
samuveth Feb 18, 2024
b068059
Add block footer component
samuveth Feb 18, 2024
1d01b25
Add fees footer
samuveth Feb 18, 2024
ea38760
Hide settings
samuveth Feb 18, 2024
73fea79
Change color
samuveth Feb 18, 2024
5821ed1
Increase to 3 visible boosts
samuveth Feb 18, 2024
18dd1a6
Lighten up boost color
samuveth Feb 19, 2024
a495560
Undo spinner changes
samuveth Feb 19, 2024
f246752
Don't show validation when loading
samuveth Feb 19, 2024
2740ecc
Revert "Lighten up boost color"
samuveth Feb 19, 2024
6b4d185
Revert "Change color"
samuveth Feb 19, 2024
adccd16
Update boost item design
samuveth Feb 19, 2024
35032d3
Fix token input design
samuveth Feb 19, 2024
1a919a7
Fix cancel button color
samuveth Feb 19, 2024
34f6b5f
Fix close icon position
samuveth Feb 19, 2024
d501b11
Fix
samuveth Feb 19, 2024
40ee5d2
Fix lottery text
samuveth Feb 19, 2024
3eab1b3
Fix lottery text
samuveth Feb 19, 2024
2e10934
Add api key
samuveth Feb 19, 2024
6280da8
Add hints and fix text
samuveth Feb 19, 2024
7817e65
Fix disabled listbox
samuveth Feb 19, 2024
ec17062
Fix reward per winner
samuveth Feb 19, 2024
64fc006
Refactor whitelist
samuveth Feb 19, 2024
c7e5fc4
Border color was way to dark on darkmode
samuveth Feb 19, 2024
4f8a3b0
Add message for disabled bribe
samuveth Feb 19, 2024
385f08b
Fixes
samuveth Feb 19, 2024
e9f1d83
Filter bribe boosts if disabled
samuveth Feb 19, 2024
26a639e
Add winners modal
samuveth Feb 19, 2024
36427a7
Update subgraph
samuveth Feb 19, 2024
350ebb0
Add chain id on query
samuveth Feb 19, 2024
8aa0e77
Fix claimed text
samuveth Feb 19, 2024
31bced4
Fixes
samuveth Feb 20, 2024
0b55fae
Fix terms
samuveth Feb 20, 2024
3eb628c
Set max to 1024
samuveth Feb 20, 2024
772361c
Revert "Set max to 1024"
samuveth Feb 20, 2024
e67717b
Merge branch 'master' into samuv/boost
samuveth Feb 21, 2024
3b936f2
Fix distribution selector
samuveth Feb 21, 2024
f105fbe
Fix no winner text
samuveth Feb 21, 2024
f2a8c4c
Fix loading when click vote
samuveth Feb 21, 2024
01de280
Fix await rewards loading
samuveth Feb 21, 2024
9c3b68d
Fix boost color
samuveth Feb 22, 2024
0752498
Fix lottery text length and add tooltip
samuveth Feb 22, 2024
c082ab0
Merge branch 'master' into samuv/boost
samuveth Feb 22, 2024
9cdd926
Rename
samuveth Feb 23, 2024
3756266
Fix item
samuveth Feb 23, 2024
78e4289
Fix winners modal
samuveth Feb 23, 2024
5a07f1b
Fix margin
samuveth Feb 23, 2024
463dba7
Get fees from contract
samuveth Feb 23, 2024
34dfa00
Fix boost items style
samuveth Feb 23, 2024
5611310
Fixes
samuveth Feb 23, 2024
2608669
Fixes
samuveth Feb 23, 2024
7779e21
Fixes
samuveth Feb 23, 2024
a150ab0
Fixes
samuveth Feb 23, 2024
5c3008b
Fixes
samuveth Feb 23, 2024
88b22e0
Fix winner profiles
samuveth Feb 23, 2024
b9e4553
Fix format
samuveth Feb 23, 2024
cdc92d5
Add team to whitelist
samuveth Feb 23, 2024
1b439c2
Fix lottery reward
samuveth Feb 23, 2024
3e761a5
Limit max winners
samuveth Feb 23, 2024
a432124
Fix number winners
samuveth Feb 23, 2024
1f410fc
Fix amount
samuveth Feb 24, 2024
b443bd3
Fix stars higher resolution
samuveth Feb 24, 2024
e598914
Back to orange
samuveth Feb 24, 2024
9ab94b5
Add view less
samuveth Feb 24, 2024
10b2bfc
Remove type
samuveth Feb 24, 2024
7cfde21
Fix terms text
samuveth Feb 25, 2024
403c497
Add fee to amount
samuveth Feb 25, 2024
f0d272d
Add docs link
samuveth Feb 25, 2024
55f7f46
Fix docs link
samuveth Feb 25, 2024
e6cd60c
Fix devider
samuveth Feb 25, 2024
62aa0fc
Add close button to success claim modal
samuveth Feb 25, 2024
4fba5cb
Change slot name
samuveth Feb 25, 2024
28816dc
Refactor block components to use TuneBlock
samuveth Feb 25, 2024
e2bf1ee
Fix padding
samuveth Feb 25, 2024
3df97af
Fix padding
samuveth Feb 25, 2024
22896c9
Fixes
samuveth Feb 25, 2024
d6247cb
Fix tooltip
samuveth Feb 25, 2024
75e236c
Remove core
samuveth Feb 25, 2024
d4d94f6
Fix explorer network
samuveth Feb 25, 2024
163e6e6
Merge branch 'master' into samuv/boost
samuveth Feb 25, 2024
babc637
Fix votes choice more to center and refactor
samuveth Feb 26, 2024
b2d48a3
Fix claim item
samuveth Feb 26, 2024
9cd9452
Use counter instead of tag
samuveth Feb 26, 2024
471a8b9
Remove boost from space settings
samuveth Feb 26, 2024
b8395b4
Merge branch 'master' into samuv/boost
samuveth Feb 26, 2024
dcc7b50
Merge branch 'master' into samuv/boost
samuveth Feb 29, 2024
ccf8678
Add lottery limit
samuveth Feb 29, 2024
8acfc17
Update sepolia boost contract
samuveth Feb 29, 2024
224e8cd
Fix lottery limit
samuveth Feb 29, 2024
af72417
Fix decimals
samuveth Feb 29, 2024
4b35ec5
Disable mainnet
samuveth Feb 29, 2024
adfdff2
Fix lottery and limits text
samuveth Feb 29, 2024
78ba619
Fix terms text
samuveth Feb 29, 2024
8a8d5cb
Fix boost filter
samuveth Feb 29, 2024
10e892d
Fix styling
samuveth Feb 29, 2024
2eb0ff7
Fix manage boost text
samuveth Feb 29, 2024
bd55139
Remove padding
samuveth Feb 29, 2024
75de64f
Move reason icon next to choice
samuveth Feb 29, 2024
52fa642
Fix
samuveth Feb 29, 2024
608ffdb
Fix
samuveth Feb 29, 2024
65c57c7
Fix delay
samuveth Feb 29, 2024
8f8f2f7
Fix tooltip in modal
samuveth Mar 1, 2024
e065e60
Fix padding
samuveth Mar 1, 2024
1c10c09
Fix loading
samuveth Mar 1, 2024
26ed5c0
Fix border colors
samuveth Mar 1, 2024
0b293ce
Don't show border if no eligible
samuveth Mar 1, 2024
3d2c901
Add text to shutter and invalid choice
samuveth Mar 1, 2024
2e29628
Fix votes modal loading spacing
samuveth Mar 1, 2024
88a145e
Fix boost item id text
samuveth Mar 1, 2024
0d26d97
Fix tooltip boost id
samuveth Mar 1, 2024
012972c
Fixes
samuveth Mar 4, 2024
d2947f1
Fix boost id
samuveth Mar 4, 2024
184f2d2
Fix validate negative numbers
samuveth Mar 4, 2024
1172920
Move block
samuveth Mar 5, 2024
f539dc8
Fix lottery wait for onchain epoch
samuveth Mar 5, 2024
89b5d27
Fix settings proposal page
samuveth Mar 5, 2024
da8e7d9
Fix naming
samuveth Mar 5, 2024
835a683
Fix spacing
samuveth Mar 5, 2024
3ab8ddc
Hide bg overflow
samuveth Mar 5, 2024
07373d7
Fix checkbox and radio colors
samuveth Mar 5, 2024
f9b52c0
Fix loading
samuveth Mar 5, 2024
8c98659
Fix proposal item boosts indicator
samuveth Mar 5, 2024
8d55525
Prepare for zero fees
samuveth Mar 5, 2024
49895b3
Fix token input overflow
samuveth Mar 5, 2024
11ecb91
Update guard URL
samuveth Mar 5, 2024
12442c2
Catch winners query
samuveth Mar 5, 2024
5d9b0b9
Fix formatting and math
samuveth Mar 6, 2024
4a1c6ec
Update guard address
samuveth Mar 6, 2024
1e33778
Add lottery condition
samuveth Mar 6, 2024
d1066af
Fix claiming
samuveth Mar 6, 2024
6595fe3
Fix responsive
samuveth Mar 6, 2024
b92fdda
Add Wan's space
samuveth Mar 6, 2024
5b1ac41
Fix stars color
samuveth Mar 6, 2024
45b7f98
Fix
samuveth Mar 6, 2024
1d6e0b6
Update settings
samuveth Mar 6, 2024
ecaf2a1
Fix loading
samuveth Mar 6, 2024
82d9a30
Fix tune button
samuveth Mar 6, 2024
f9f21eb
Fix lottery epoch
samuveth Mar 6, 2024
bbe51c8
Fix showing infinity for amount to win
samuveth Mar 6, 2024
4132261
Disable TOS
samuveth Mar 6, 2024
ba0b4fb
Remove calculation for displayed reward and add tooltip explanation
samuveth Mar 6, 2024
a7b4280
Remove redundant vif
samuveth Mar 6, 2024
231c3b3
Remove redundant vif
samuveth Mar 6, 2024
e3ace7f
Make sidebar sticky
samuveth Mar 6, 2024
b9b8777
Fix margin for action bar
samuveth Mar 6, 2024
0dc70b4
Hide input if not checked
samuveth Mar 6, 2024
34fc09c
Fixes to boost item management
samuveth Mar 7, 2024
e23676d
Add loading for withdraw
samuveth Mar 7, 2024
1b1eab1
Remove base token filter
samuveth Mar 7, 2024
3901e69
Refactor deposit block into component
samuveth Mar 7, 2024
d551096
Filter excluded tokens
samuveth Mar 7, 2024
2197a07
Refactor and check custom tokens
samuveth Mar 7, 2024
0e1334b
Remove TODO
samuveth Mar 7, 2024
4d98809
Disable boost with shutter and show message
samuveth Mar 7, 2024
5b088f9
Add warning when proposal is already closed
samuveth Mar 7, 2024
66470db
Update contract sepolia
samuveth Mar 7, 2024
3fd13ac
Fixes
samuveth Mar 7, 2024
0969939
Improve style of message
samuveth Mar 7, 2024
f93811e
Check proposal privacy not space
samuveth Mar 7, 2024
90c23ef
Fix loading on boost create
samuveth Mar 7, 2024
5d43e6c
Only show message for whitelisted spaces
samuveth Mar 7, 2024
585f4e6
Fix text
samuveth Mar 7, 2024
93f57d6
Cleanup
samuveth Mar 7, 2024
5191a61
Remove redundant title
samuveth Mar 7, 2024
845be85
Fix loading winners text display
samuveth Mar 7, 2024
5af0ba4
Fix input error condition
samuveth Mar 7, 2024
9b506e3
Enable mainnet
samuveth Mar 8, 2024
37a5200
Merge branch 'master' into samuv/boost
samuveth Mar 8, 2024
d0b6874
Fix WC and TuneModal
samuveth Mar 8, 2024
cbc975f
Cleanup
samuveth Mar 8, 2024
f8c249e
Show timer and refactor
samuveth Mar 8, 2024
db29c29
Fix and add TODOs
samuveth Mar 8, 2024
f0bd698
Fix align and add message to docs
samuveth Mar 8, 2024
bcf2e76
Add redirect
samuveth Mar 8, 2024
c9cc7b4
Fixes
samuveth Mar 8, 2024
27be088
Fix winners dropdown item
samuveth Mar 8, 2024
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
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ VITE_PUSHER_BEAMS_INSTANCE_ID=2e080021-d495-456d-b2cf-84f9fd718442
VITE_SHUTTER_EON_PUBKEY=0x0e6493bbb4ee8b19aa9b70367685049ff01dc9382c46aed83f8bc07d2a5ba3e6030bd83b942c1fd3dff5b79bef3b40bf6b666e51e7f0be14ed62daaffad47435265f5c9403b1a801921981f7d8659a9bd91fe92fb1cf9afdb16178a532adfaf51a237103874bb03afafe9cab2118dae1be5f08a0a28bf488c1581e9db4bc23ca
VITE_ENV=develop
VITE_MIXPANEL_TOKEN=2ec6cd1b19e790f45cc9a9bb83980c8d
VITE_ALCHEMY_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
4 changes: 3 additions & 1 deletion .eslintrc-auto-import.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
"useEmailSubscription": true,
"useEmailFetchClient": true,
"useStatement": true,
"useMixpanel": true
"useMixpanel": true,
"useBalances": true,
"useAccount": true
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@shutter-network/shutter-crypto": "1.0.1",
"@snapshot-labs/lock": "^0.2.2",
"@snapshot-labs/pineapple": "^1.1.0",
"@snapshot-labs/snapshot.js": "^0.9.7",
"@snapshot-labs/snapshot.js": "^0.9.8",
"@vue/apollo-composable": "4.0.0-beta.11",
"@vueuse/core": "^10.6.1",
"@vueuse/head": "^2.0.0",
Expand Down
24 changes: 12 additions & 12 deletions src/assets/css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
--header-bg: #1c1b20;
--block-bg: transparent;
--shadow-color: rgba(255, 255, 255, 0.036);
--border-color-soft: rgb(45, 45, 45, 0.6);
--border-color-subtle: rgb(45, 45, 45, 0.32);
--border-color-faint: rgb(45, 45, 45, 0.12);
}

[data-color-scheme='light'] {
Expand All @@ -32,6 +35,9 @@
--header-bg: white;
--block-bg: transparent;
--shadow-color: #0001;
--border-color-soft: rgb(224, 224, 224, 0.6);
--border-color-subtle: rgb(224, 224, 224, 0.32);
--border-color-faint: rgb(224, 224, 224, 0.12);
}

@layer base {
Expand All @@ -58,6 +64,12 @@
scrollbar-gutter: stable;
}

*,
::before,
::after {
@apply border-skin-border;
}

body {
overflow-x: hidden;
}
Expand Down Expand Up @@ -151,18 +163,6 @@ a,
opacity: 0.6 !important;
}

// TODO: Remove this and use border-skin-border in the templates. Tailwind has
// dozens of modifiers (md:, sm:, hover: etc.) which would all need to be listed here.
.border,
.border-md,
.border-lg,
.border-b,
.border-t,
.border-r,
.border-l {
@apply border-skin-border;
}

input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
-webkit-appearance: none;
Expand Down
28 changes: 16 additions & 12 deletions src/assets/css/tune.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
.tune-button {
@apply h-[46px] cursor-pointer text-skin-link rounded-full bg-transparent border border-skin-border px-[22px] hover:border-skin-text;

&.disabled {
@apply border-skin-border bg-skin-bg text-skin-border cursor-not-allowed;
}

&.primary {
@apply border-skin-primary bg-skin-primary text-white hover:brightness-95;

Expand All @@ -56,16 +60,20 @@
}
}

&.danger {
@apply text-red hover:border-red;
&.white-border {
@apply border-white/30 hover:border-white;

&:disabled {
@apply text-skin-border hover:border-skin-border;
@apply border-white text-white opacity-40;
}
}

&.disabled {
@apply border-skin-border bg-skin-bg text-skin-border cursor-not-allowed;
&.danger {
@apply text-red hover:border-red border-red/40;

&:disabled {
@apply text-skin-border hover:border-skin-border;
}
}
}

Expand Down Expand Up @@ -149,7 +157,7 @@
}

.tune-tag {
@apply rounded-md border border-skin-border bg-skin-border px-2 py-1 text-sm text-skin-text;
@apply rounded-lg border border-[--border-color-soft] bg-[--border-color-subtle] px-[6px] py-[3px] text-sm text-skin-text;
}

.tune-menu-list {
Expand All @@ -169,15 +177,11 @@
}

.tune-modal-panel {
@apply rounded-md border border-skin-border bg-skin-bg p-4 sm:w-[440px];
@apply rounded-[20px] bg-skin-bg;
}

.tune-modal-backdrop {
@apply bg-skin-border opacity-70;
}

.tune-modal-title {
@apply text-center text-lg font-medium text-skin-text;
@apply bg-black opacity-40;
}

.tune-input-checkbox {
Expand Down
12 changes: 12 additions & 0 deletions src/assets/icons/boost-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions src/assets/icons/boost-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/stars-big-horizontal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/stars-big.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/stars.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 0 additions & 59 deletions src/components/BaseModalFullscreen.vue

This file was deleted.

3 changes: 3 additions & 0 deletions src/components/BaseUser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const props = defineProps<{
hideAvatar?: boolean;
hideUsername?: boolean;
widthClass?: string;
textClass?: string;
}>();

const { getUsername } = useUsername();
Expand All @@ -31,6 +32,7 @@ const spaceMembers = computed(() => {
:profile="profile"
:proposal="proposal"
:space="space"
class="flex"
>
<BaseLink
:link="
Expand All @@ -47,6 +49,7 @@ const spaceMembers = computed(() => {
<span
v-if="!hideUsername"
class="w-full cursor-pointer truncate text-skin-link"
:class="textClass"
>
{{ getUsername(address, profile) }}
</span>
Expand Down
44 changes: 44 additions & 0 deletions src/components/ButtonSelectToken.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<script setup lang="ts">
import { Token } from '@/helpers/alchemy';

const props = defineProps<{

Check warning on line 4 in src/components/ButtonSelectToken.vue

View workflow job for this annotation

GitHub Actions / build (16.x)

'props' is assigned a value but never used
network: string;
tokens: Token[];
selectedToken?: Token;
}>();

defineEmits(['update:selectedToken', 'addCustomToken']);

const isTokenModalOpen = ref(false);
</script>

<template>
<TuneButtonSelect
label="Token"
class="truncate"
@select="isTokenModalOpen = true"
>
<div
v-if="selectedToken?.contractAddress"
class="flex flex-row space-x-2 pr-2"
>
<AvatarToken :address="selectedToken.contractAddress" />
<span v-if="selectedToken" class="truncate">{{
selectedToken.name
}}</span>
<span v-if="selectedToken"> ({{ selectedToken.symbol }}) </span>
</div>
<span v-else>Select token</span>
</TuneButtonSelect>
<teleport to="#modal">
<ModalTokens
:selected-token="selectedToken"
:tokens="tokens"
:open="isTokenModalOpen"
:network="network"
@update:selected-token="$emit('update:selectedToken', $event)"
@add-custom-token="$emit('addCustomToken', $event)"
@close="isTokenModalOpen = false"
/>
</teleport>
</template>
74 changes: 74 additions & 0 deletions src/components/InputComboboxToken.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<script setup lang="ts">
import { Token } from '@/helpers/alchemy';

defineProps<{
label: string;
network: string;
tokens: Token[];
amount: string;
selectedToken?: Token;
loading?: boolean;
}>();

defineEmits(['update:selectedToken', 'addCustomToken', 'update:amount']);

const { web3Account } = useWeb3();
const { modalAccountOpen } = useModal();

const isTokenModalOpen = ref(false);

function handleOpenTokenModal() {
if (!web3Account.value) return (modalAccountOpen.value = true);
isTokenModalOpen.value = true;
}
</script>

<template>
<TuneInput
:model-value="amount"
:label="label"
placeholder="0.0"
type="number"
@update:model-value="$emit('update:amount', $event)"
>
<template #after>
<button
type="button"
label="Token"
class="-mr-4 h-full bg-[--border-color-subtle] hover:bg-[--border-color-soft] rounded-r-full"
@click="handleOpenTokenModal"
>
<div
class="flex flex-row space-x-2 items-center pr-[12px] pl-3 max-w-[150px]"
>
<template v-if="loading">
<TuneLoadingSpinner />
</template>
<template v-else-if="selectedToken?.contractAddress">
<AvatarToken :address="selectedToken.contractAddress" size="20" />
<span v-if="selectedToken" class="text-skin-link truncate">{{
selectedToken.symbol
}}</span>
</template>
<template v-else>
<div>Select token</div>
</template>
<i-ho-chevron-down class="text-sm text-skin-link shrink-0" />
</div>
</button>
</template>
</TuneInput>

<teleport to="#modal">
<ModalTokens
:selected-token="selectedToken"
:tokens="tokens"
:open="isTokenModalOpen"
:network="network"
disable-base-tokens
@update:selected-token="$emit('update:selectedToken', $event)"
@add-custom-token="$emit('addCustomToken', $event)"
@close="isTokenModalOpen = false"
/>
</teleport>
</template>
Loading