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

chore: Cleanup helpers #4421

Merged
merged 2 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
20 changes: 9 additions & 11 deletions src/components/ExploreMenuCategories.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import categories from '@/helpers/categories.json';
import { SPACE_CATEGORIES } from '@/helpers/constants';

const props = defineProps<{
metrics: Record<string, number>;
Expand All @@ -25,16 +25,14 @@ const categoryItems = computed(() => {
selected: !selected.value
}
},
...categories
.map(c => ({
text: tc(`explore.categories.${c}`),
action: c,
extras: {
count: props.metrics?.[c] || 0,
selected: selected.value === c
}
}))
.sort((a, b) => b.extras.count - a.extras.count)
...SPACE_CATEGORIES.map(c => ({
text: tc(`explore.categories.${c}`),
action: c,
extras: {
count: props.metrics?.[c] || 0,
selected: selected.value === c
}
})).sort((a, b) => b.extras.count - a.extras.count)
];
});

Expand Down
4 changes: 2 additions & 2 deletions src/components/SettingsProfileBlock.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import schemas from '@snapshot-labs/snapshot.js/src/schemas';
import categories from '@/helpers/categories.json';
import { SPACE_CATEGORIES } from '@/helpers/constants';

const props = defineProps<{
context: 'setup' | 'settings';
Expand Down Expand Up @@ -86,7 +86,7 @@ const avatarNotReactive = ref(form.value.avatar);
:placeholder="$t('settings.categories.select')"
:label="$t(`settings.categories.label`)"
:items="
categories.map(category => ({
SPACE_CATEGORIES.map(category => ({
value: category,
name: $t(`explore.categories.${category}`)
}))
Expand Down
2 changes: 1 addition & 1 deletion src/components/SetupStrategyBasic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { getTokenPrices } from '@/helpers/covalent';
import { call, clone } from '@snapshot-labs/snapshot.js/src/utils';
import { JsonRpcProvider } from '@ethersproject/providers';
import { ERC20ABI } from '@/helpers/abi';
import { ERC20ABI } from '@/helpers/constants';
import { isAddress } from '@ethersproject/address';
import { shorten } from '@/helpers/utils';

Expand Down
5 changes: 0 additions & 5 deletions src/helpers/abi.ts

This file was deleted.

10 changes: 0 additions & 10 deletions src/helpers/categories.json

This file was deleted.

17 changes: 17 additions & 0 deletions src/helpers/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,20 @@ export const SNAPSHOT_BREAKPOINTS = {
};

export const KNOWN_HOSTS = ['app.safe.global', 'pilot.gnosisguild.org'];

export const SPACE_CATEGORIES = [
'protocol',
'social',
'investment',
'grant',
'service',
'media',
'creator',
'collector'
];

export const ERC20ABI = [
'function name() public view returns (string)',
'function decimals() view returns (uint32)',
'function symbol() view returns (string)'
];