-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add builders filtering by predefined list, mainnet only wip
- Loading branch information
Showing
6 changed files
with
301 additions
and
237 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
207 changes: 0 additions & 207 deletions
207
src/pages/Builders/pages/BuildersList/components/BuildersTable.vue
This file was deleted.
Oops, something went wrong.
62 changes: 62 additions & 0 deletions
62
...ges/Builders/pages/BuildersList/components/BuildersTable/components/SortingIconButton.vue
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,62 @@ | ||
<script setup lang="ts"> | ||
import { BuildersProject_OrderBy, OrderDirection } from '@/types/graphql' | ||
import { AppIcon } from '@/common' | ||
import { cn } from '@/theme/utils' | ||
const orderByModel = defineModel<BuildersProject_OrderBy>('orderByModel') | ||
const orderDirectionModel = defineModel<OrderDirection>('orderDirectionModel') | ||
const props = withDefaults( | ||
defineProps<{ | ||
label: string | ||
orderBy: BuildersProject_OrderBy | ||
}>(), | ||
{}, | ||
) | ||
const handleClick = () => { | ||
orderByModel.value = props.orderBy | ||
if (orderDirectionModel.value === OrderDirection.Asc) { | ||
orderDirectionModel.value = OrderDirection.Desc | ||
return | ||
} | ||
orderDirectionModel.value = OrderDirection.Asc | ||
} | ||
</script> | ||
|
||
<template> | ||
<button class="flex items-center gap-2" @click="handleClick"> | ||
<span class="line-clamp-1 text-[16px] leading-[24px] text-textTertiaryMain"> | ||
{{ label }} | ||
</span> | ||
<div class="flex flex-col"> | ||
<app-icon | ||
class="size-[10px]" | ||
:class=" | ||
cn( | ||
orderByModel === orderBy && | ||
orderDirectionModel === OrderDirection.Asc && | ||
'text-primaryMain', | ||
) | ||
" | ||
:name="$icons.triangleTop" | ||
/> | ||
<app-icon | ||
class="size-[10px] rotate-180" | ||
:class=" | ||
cn( | ||
orderByModel === orderBy && | ||
orderDirectionModel === OrderDirection.Desc && | ||
'text-primaryMain', | ||
) | ||
" | ||
:name="$icons.triangleTop" | ||
/> | ||
</div> | ||
</button> | ||
</template> | ||
|
||
<style scoped lang="scss"></style> |
78 changes: 78 additions & 0 deletions
78
src/pages/Builders/pages/BuildersList/components/BuildersTable/index.vue
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,78 @@ | ||
<template> | ||
<div class="flex w-full flex-col gap-2"> | ||
<div | ||
:class=" | ||
cn( | ||
'hidden', | ||
'grid-cols-[max(216px),max(160px),max(190px),1fr,1fr,max(100px)] items-center md:grid', | ||
'gap-2 px-8', | ||
) | ||
" | ||
> | ||
<div class="flex items-center gap-2"> | ||
<span | ||
class="line-clamp-1 text-[16px] leading-[24px] text-textTertiaryMain" | ||
> | ||
{{ $t('builders-table.name-th') }} | ||
</span> | ||
</div> | ||
<sorting-icon-button | ||
class="justify-self-end" | ||
:label="$t('builders-table.starts-time-th')" | ||
:order-by="BuildersProject_OrderBy.StartsAt" | ||
v-model:order-by-model="orderByModel" | ||
v-model:order-direction-model="orderDirectionModel" | ||
/> | ||
<sorting-icon-button | ||
class="justify-self-end" | ||
:label="$t('builders-table.min-deposit-th')" | ||
:order-by="BuildersProject_OrderBy.MinimalDeposit" | ||
v-model:order-by-model="orderByModel" | ||
v-model:order-direction-model="orderDirectionModel" | ||
/> | ||
<sorting-icon-button | ||
class="justify-self-end" | ||
:label="$t('builders-table.total-staked-th')" | ||
:order-by="BuildersProject_OrderBy.TotalStaked" | ||
v-model:order-by-model="orderByModel" | ||
v-model:order-direction-model="orderDirectionModel" | ||
/> | ||
<sorting-icon-button | ||
class="justify-self-end" | ||
:label="$t('builders-table.withdraw-lock-period-th')" | ||
:order-by="BuildersProject_OrderBy.WithdrawLockPeriodAfterDeposit" | ||
v-model:order-by-model="orderByModel" | ||
v-model:order-direction-model="orderDirectionModel" | ||
/> | ||
<div class=""></div> | ||
</div> | ||
<builders-table-item | ||
v-for="el in buildersProjects" | ||
:key="el.id" | ||
:builder-project="el" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import BuildersTableItem from '../BuildersTableItem.vue' | ||
import { | ||
BuilderProjectFragment, | ||
BuildersProject_OrderBy, | ||
OrderDirection, | ||
} from '@/types/graphql' | ||
import { cn } from '@/theme/utils' | ||
import SortingIconButton from '@/pages/Builders/pages/BuildersList/components/BuildersTable/components/SortingIconButton.vue' | ||
const orderByModel = defineModel<BuildersProject_OrderBy>('orderByModel') | ||
const orderDirectionModel = defineModel<OrderDirection>('orderDirectionModel') | ||
withDefaults( | ||
defineProps<{ | ||
buildersProjects: BuilderProjectFragment[] | ||
}>(), | ||
{}, | ||
) | ||
</script> | ||
|
||
<style scoped lang="scss"></style> |
Oops, something went wrong.