AppSidebar.tsx 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import { DefaultSidebar, Sidebar, THEME } from "@excalidraw/excalidraw";
  2. import {
  3. messageCircleIcon,
  4. presentationIcon,
  5. } from "@excalidraw/excalidraw/components/icons";
  6. import { LinkButton } from "@excalidraw/excalidraw/components/LinkButton";
  7. import { useUIAppState } from "@excalidraw/excalidraw/context/ui-appState";
  8. import "./AppSidebar.scss";
  9. export const AppSidebar = () => {
  10. const { theme, openSidebar } = useUIAppState();
  11. return (
  12. <DefaultSidebar>
  13. <DefaultSidebar.TabTriggers>
  14. <Sidebar.TabTrigger
  15. tab="comments"
  16. style={{ opacity: openSidebar?.tab === "comments" ? 1 : 0.4 }}
  17. >
  18. {messageCircleIcon}
  19. </Sidebar.TabTrigger>
  20. <Sidebar.TabTrigger
  21. tab="presentation"
  22. style={{ opacity: openSidebar?.tab === "presentation" ? 1 : 0.4 }}
  23. >
  24. {presentationIcon}
  25. </Sidebar.TabTrigger>
  26. </DefaultSidebar.TabTriggers>
  27. <Sidebar.Tab tab="comments">
  28. <div className="app-sidebar-promo-container">
  29. <div
  30. className="app-sidebar-promo-image"
  31. style={{
  32. ["--image-source" as any]: `url(/oss_promo_comments_${
  33. theme === THEME.DARK ? "dark" : "light"
  34. }.jpg)`,
  35. opacity: 0.7,
  36. }}
  37. />
  38. <div className="app-sidebar-promo-text">
  39. Make comments with Excalidraw+
  40. </div>
  41. <LinkButton
  42. href={`${
  43. import.meta.env.VITE_APP_PLUS_LP
  44. }/plus?utm_source=excalidraw&utm_medium=app&utm_content=comments_promo#excalidraw-redirect`}
  45. >
  46. Sign up now
  47. </LinkButton>
  48. </div>
  49. </Sidebar.Tab>
  50. <Sidebar.Tab tab="presentation" className="px-3">
  51. <div className="app-sidebar-promo-container">
  52. <div
  53. className="app-sidebar-promo-image"
  54. style={{
  55. ["--image-source" as any]: `url(/oss_promo_presentations_${
  56. theme === THEME.DARK ? "dark" : "light"
  57. }.svg)`,
  58. backgroundSize: "60%",
  59. opacity: 0.4,
  60. }}
  61. />
  62. <div className="app-sidebar-promo-text">
  63. Create presentations with Excalidraw+
  64. </div>
  65. <LinkButton
  66. href={`${
  67. import.meta.env.VITE_APP_PLUS_LP
  68. }/plus?utm_source=excalidraw&utm_medium=app&utm_content=presentations_promo#excalidraw-redirect`}
  69. >
  70. Sign up now
  71. </LinkButton>
  72. </div>
  73. </Sidebar.Tab>
  74. </DefaultSidebar>
  75. );
  76. };