({
sort,
children,
}: {
sort: ForYouSort;
children: ReactElement;
})
| 114 | * date under it. `children` is the tab, rendered as the menu's trigger. |
| 115 | */ |
| 116 | export const ForYouSortMenu = ({ |
| 117 | sort, |
| 118 | children, |
| 119 | }: { |
| 120 | sort: ForYouSort; |
| 121 | children: ReactElement; |
| 122 | }): ReactElement => ( |
| 123 | <DropdownMenu> |
| 124 | <DropdownMenuTrigger asChild>{children}</DropdownMenuTrigger> |
| 125 | <DropdownMenuContent align="start" className="!min-w-52"> |
| 126 | <span className="flex px-2.5 pb-1 pt-1.5 font-bold text-text-tertiary typo-caption1"> |
| 127 | Sort |
| 128 | </span> |
| 129 | {algorithms.map(({ text }, index) => ( |
| 130 | <DropdownMenuItem |
| 131 | key={text} |
| 132 | role="menuitemradio" |
| 133 | aria-checked={sort.selected === index} |
| 134 | onClick={() => sort.onSelect(index)} |
| 135 | > |
| 136 | <span className="inline-flex flex-1 items-center gap-2 typo-footnote"> |
| 137 | {text} |
| 138 | {sort.selected === index && ( |
| 139 | <VIcon size={IconSize.Size16} className="ml-auto" secondary /> |
| 140 | )} |
| 141 | </span> |
| 142 | </DropdownMenuItem> |
| 143 | ))} |
| 144 | </DropdownMenuContent> |
| 145 | </DropdownMenu> |
| 146 | ); |
| 147 | |
| 148 | /** |
| 149 | * The phone's For you sheet, after the Explore sort sheet: the sort, then |
nothing calls this directly
no outgoing calls
no test coverage detected