MCPcopy Create free account
hub / github.com/dailydotdev/apps / ForYouSortMenu

Function ForYouSortMenu

packages/shared/src/components/feeds/ForYouSort.tsx:116–146  ·  view source on GitHub ↗
({
  sort,
  children,
}: {
  sort: ForYouSort;
  children: ReactElement;
})

Source from the content-addressed store, hash-verified

114 * date under it. `children` is the tab, rendered as the menu's trigger.
115 */
116export 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected