|
| 1 | +import { type FC, type ReactNode } from 'react' |
| 2 | +import { SidebarMenuButton, useSidebar } from '@oasisprotocol/ui-library/src/components/ui/sidebar' |
| 3 | +import { MessageSquare, HelpCircle } from 'lucide-react' |
| 4 | +import { Button } from '@oasisprotocol/ui-library/src/components/ui/button' |
| 5 | + |
| 6 | +const MessageAnchor = ({ children, className }: { children: ReactNode; className?: string }) => ( |
| 7 | + <a |
| 8 | + href="https://forms.gle/yewQDdMzNg81wKtw9" |
| 9 | + target="_blank" |
| 10 | + rel="noopener noreferrer" |
| 11 | + title="Provide feedback" |
| 12 | + className={className} |
| 13 | + > |
| 14 | + {children} |
| 15 | + </a> |
| 16 | +) |
| 17 | + |
| 18 | +const DiscordAnchor = ({ children, className }: { children: ReactNode; className?: string }) => ( |
| 19 | + <a |
| 20 | + href="https://oasis.io/discord" |
| 21 | + target="_blank" |
| 22 | + rel="noopener noreferrer" |
| 23 | + title="Get support" |
| 24 | + className={className} |
| 25 | + > |
| 26 | + {children} |
| 27 | + </a> |
| 28 | +) |
| 29 | + |
| 30 | +export const SidebarFooterContent: FC = () => { |
| 31 | + const { state } = useSidebar() |
| 32 | + const isCollapsed = state === 'collapsed' |
| 33 | + |
| 34 | + if (isCollapsed) { |
| 35 | + return ( |
| 36 | + <> |
| 37 | + <MessageAnchor> |
| 38 | + <SidebarMenuButton asChild> |
| 39 | + <Button variant="ghost" className="w-full justify-start p-2 h-8 rounded-md cursor-pointer"> |
| 40 | + <MessageSquare className="h-4 w-4 text-sidebar-foreground" /> |
| 41 | + </Button> |
| 42 | + </SidebarMenuButton> |
| 43 | + </MessageAnchor> |
| 44 | + <DiscordAnchor> |
| 45 | + <SidebarMenuButton asChild> |
| 46 | + <Button variant="ghost" className="w-full justify-start p-2 h-8 rounded-md cursor-pointer"> |
| 47 | + <HelpCircle className="h-4 w-4 text-sidebar-foreground" /> |
| 48 | + </Button> |
| 49 | + </SidebarMenuButton> |
| 50 | + </DiscordAnchor> |
| 51 | + </> |
| 52 | + ) |
| 53 | + } |
| 54 | + |
| 55 | + return ( |
| 56 | + <> |
| 57 | + <div className="bg-sidebar-accent p-4 rounded-md text-sm text-foreground"> |
| 58 | + <span className="font-bold">Running in Beta</span> |
| 59 | + <br /> |
| 60 | + <MessageAnchor className="underline">Provide feedback here</MessageAnchor> |
| 61 | + </div> |
| 62 | + <div className="bg-sidebar-accent p-4 rounded-md text-sm text-foreground"> |
| 63 | + <span className="font-bold">Need Support?</span> |
| 64 | + <br /> |
| 65 | + <DiscordAnchor className="underline">Speak to our devs</DiscordAnchor> |
| 66 | + </div> |
| 67 | + </> |
| 68 | + ) |
| 69 | +} |
0 commit comments