-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
301 additions
and
222 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
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
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
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
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,69 @@ | ||
import { Button as BaseButton } from '@kobalte/core/button'; | ||
import { DropdownMenu, type DropdownMenuTriggerProps } from '@kobalte/core/dropdown-menu'; | ||
import { | ||
HiSolidArrowDownTray, | ||
HiSolidArrowRightOnRectangle, | ||
HiSolidChevronDown, | ||
HiSolidCog6Tooth, | ||
HiSolidPlus, | ||
} from 'solid-icons/hi'; | ||
import { TiCog } from 'solid-icons/ti'; | ||
import { type Component, createSignal, mergeProps } from 'solid-js'; | ||
import { Dynamic } from 'solid-js/web'; | ||
import { LogoSquare } from '../../constants/ui/logo'; | ||
import { CreateFeedModal } from '../modals/create-feed-modal'; | ||
import { Menu, type MenuProps } from './menu'; | ||
|
||
export const AppMenu: Component<MenuProps> = props => { | ||
const [createFeedModalOpen, setCreateFeedModalOpen] = createSignal(false); | ||
|
||
const local = mergeProps( | ||
{ | ||
triggerClass: 'size-6 rounded-md', | ||
triggerIconClass: 'size-5', | ||
triggerIcon: TiCog, | ||
} as MenuProps, | ||
props, | ||
); | ||
|
||
const handleAddFeed = () => { | ||
setCreateFeedModalOpen(true); | ||
}; | ||
|
||
return ( | ||
<> | ||
<Menu | ||
{...local} | ||
shift={4} | ||
trigger={() => ( | ||
<DropdownMenu.Trigger | ||
as={(polyProps: DropdownMenuTriggerProps) => ( | ||
<BaseButton | ||
{...polyProps} | ||
class="-m-1 inline-flex items-center gap-2 self-start rounded-lg p-1 pr-2 transition dark:hover:bg-gray-700 hover:bg-gray-200 focus:outline-none dark:focus:ring-gray-600 focus:ring-2 focus:ring-gray-500 focus:ring-opacity-30" | ||
> | ||
<LogoSquare iconOnly class="inline-flex size-6" /> | ||
<Dynamic component={HiSolidChevronDown} class="size-4 text-gray-500 dark:text-gray-400" /> | ||
</BaseButton> | ||
)} | ||
/> | ||
)} | ||
> | ||
<Menu.Item onSelect={handleAddFeed} icon={HiSolidPlus}> | ||
Add feed | ||
</Menu.Item> | ||
<Menu.Item disabled icon={HiSolidArrowDownTray}> | ||
Import/export | ||
</Menu.Item> | ||
<Menu.Item disabled icon={HiSolidCog6Tooth}> | ||
Settings | ||
</Menu.Item> | ||
<Menu.Item disabled icon={HiSolidArrowRightOnRectangle}> | ||
Sign out | ||
</Menu.Item> | ||
</Menu> | ||
|
||
<CreateFeedModal open={createFeedModalOpen()} setOpen={setCreateFeedModalOpen} /> | ||
</> | ||
); | ||
}; |
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,28 @@ | ||
import { HiSolidPencilSquare, HiSolidTrash } from 'solid-icons/hi'; | ||
import { type Component, mergeProps } from 'solid-js'; | ||
import { Menu, type MenuProps } from './menu'; | ||
|
||
type FeedMenuProps = MenuProps & { | ||
uuid: string; | ||
}; | ||
|
||
export const FeedMenu: Component<FeedMenuProps> = props => { | ||
const local = mergeProps( | ||
{ | ||
triggerClass: 'size-5 rounded', | ||
triggerIconClass: 'size-4', | ||
} as MenuProps, | ||
props, | ||
); | ||
|
||
return ( | ||
<Menu {...local} size="sm"> | ||
<Menu.Item disabled icon={HiSolidPencilSquare}> | ||
Rename | ||
</Menu.Item> | ||
<Menu.Item disabled icon={HiSolidTrash}> | ||
Delete | ||
</Menu.Item> | ||
</Menu> | ||
); | ||
}; |
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.