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

fix(APP-3649): Featured DAO tab with custom URL overrides #1418

Merged
merged 1 commit into from
Nov 12, 2024
Merged
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
125 changes: 65 additions & 60 deletions src/containers/daoExplorer/daoExplorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ export const DaoExplorer = () => {
});
};

const showSortFilter = filters.quickFilter === 'allDaos';
const showFilter = ['allDaos', 'memberOf', 'following'].includes(
filters.quickFilter
);
const showSort = ['allDaos', 'memberOf'].includes(filters.quickFilter);

const filterGroupClassName = classNames('flex justify-between w-full', {
'flex flex-col gap-y-3 md:flex-row md:justify-between': isConnected,
Expand Down Expand Up @@ -208,7 +211,7 @@ export const DaoExplorer = () => {
))}
</ToggleGroup>
<div className={buttonGroupContainerClassName}>
{showSortFilter && (
{showFilter && (
<div className="flex gap-x-1">
<Button
variant={filtersCount !== '' ? 'secondary' : 'tertiary'}
Expand All @@ -220,66 +223,68 @@ export const DaoExplorer = () => {
{filtersCount}
</Button>

<Dropdown.Container
align="end"
open={activeDropdown}
onOpenChange={e => {
setActiveDropdown(e);
}}
customTrigger={
<Button
variant={activeDropdown ? 'secondary' : 'tertiary'}
size="md"
iconLeft={IconType.SORT_DESC}
/>
}
>
<Dropdown.Item
icon={
filters.order === 'tvl' ? IconType.CHECKMARK : undefined
}
selected={filters.order === 'tvl'}
onClick={() => toggleOrderby('tvl')}
>
{t('explore.sortBy.largestTreasury')}
</Dropdown.Item>
<Dropdown.Item
icon={
filters.order === 'proposals'
? IconType.CHECKMARK
: undefined
}
iconPosition="right"
selected={filters.order === 'proposals'}
onClick={() => toggleOrderby('proposals')}
>
{t('explore.sortBy.mostProposals')}
</Dropdown.Item>
<Dropdown.Item
icon={
filters.order === 'members'
? IconType.CHECKMARK
: undefined
}
iconPosition="right"
selected={filters.order === 'members'}
onClick={() => toggleOrderby('members')}
>
{t('explore.sortBy.largestCommunity')}
</Dropdown.Item>
<Dropdown.Item
icon={
filters.order === 'createdAt'
? IconType.CHECKMARK
: undefined
{showSort && (
<Dropdown.Container
align="end"
open={activeDropdown}
onOpenChange={e => {
setActiveDropdown(e);
}}
customTrigger={
<Button
variant={activeDropdown ? 'secondary' : 'tertiary'}
size="md"
iconLeft={IconType.SORT_DESC}
/>
}
iconPosition="right"
selected={filters.order === 'createdAt'}
onClick={() => toggleOrderby('createdAt')}
>
{t('explore.sortBy.recentlyCreated')}
</Dropdown.Item>
</Dropdown.Container>
<Dropdown.Item
icon={
filters.order === 'tvl' ? IconType.CHECKMARK : undefined
}
selected={filters.order === 'tvl'}
onClick={() => toggleOrderby('tvl')}
>
{t('explore.sortBy.largestTreasury')}
</Dropdown.Item>
<Dropdown.Item
icon={
filters.order === 'proposals'
? IconType.CHECKMARK
: undefined
}
iconPosition="right"
selected={filters.order === 'proposals'}
onClick={() => toggleOrderby('proposals')}
>
{t('explore.sortBy.mostProposals')}
</Dropdown.Item>
<Dropdown.Item
icon={
filters.order === 'members'
? IconType.CHECKMARK
: undefined
}
iconPosition="right"
selected={filters.order === 'members'}
onClick={() => toggleOrderby('members')}
>
{t('explore.sortBy.largestCommunity')}
</Dropdown.Item>
<Dropdown.Item
icon={
filters.order === 'createdAt'
? IconType.CHECKMARK
: undefined
}
iconPosition="right"
selected={filters.order === 'createdAt'}
onClick={() => toggleOrderby('createdAt')}
>
{t('explore.sortBy.recentlyCreated')}
</Dropdown.Item>
</Dropdown.Container>
)}
</div>
)}
{isMobile && !isConnected && filters.quickFilter === 'allDaos' ? (
Expand Down
Loading