16 changed files with 235 additions and 39 deletions
@ -0,0 +1,36 @@ |
|||||||
|
.excalidraw { |
||||||
|
.app-sidebar-promo-container { |
||||||
|
padding: 0.75rem; |
||||||
|
display: flex; |
||||||
|
flex-direction: column; |
||||||
|
text-align: center; |
||||||
|
gap: 1rem; |
||||||
|
flex: 1 1 auto; |
||||||
|
} |
||||||
|
|
||||||
|
.app-sidebar-promo-image { |
||||||
|
margin: 1rem 0; |
||||||
|
|
||||||
|
height: 16.25rem; |
||||||
|
background-size: contain; |
||||||
|
background-position: center; |
||||||
|
background-repeat: no-repeat; |
||||||
|
|
||||||
|
background-image: radial-gradient( |
||||||
|
circle, |
||||||
|
transparent 60%, |
||||||
|
var(--sidebar-bg-color) 100% |
||||||
|
), |
||||||
|
var(--image-source); |
||||||
|
|
||||||
|
display: flex; |
||||||
|
} |
||||||
|
|
||||||
|
.app-sidebar-promo-text { |
||||||
|
padding: 0 2rem; |
||||||
|
} |
||||||
|
|
||||||
|
.link-button { |
||||||
|
margin: 0 auto; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,79 @@ |
|||||||
|
import { DefaultSidebar, Sidebar, THEME } from "@excalidraw/excalidraw"; |
||||||
|
import { |
||||||
|
messageCircleIcon, |
||||||
|
presentationIcon, |
||||||
|
} from "@excalidraw/excalidraw/components/icons"; |
||||||
|
import { LinkButton } from "@excalidraw/excalidraw/components/LinkButton"; |
||||||
|
import { useUIAppState } from "@excalidraw/excalidraw/context/ui-appState"; |
||||||
|
|
||||||
|
import "./AppSidebar.scss"; |
||||||
|
|
||||||
|
export const AppSidebar = () => { |
||||||
|
const { theme, openSidebar } = useUIAppState(); |
||||||
|
|
||||||
|
return ( |
||||||
|
<DefaultSidebar> |
||||||
|
<DefaultSidebar.TabTriggers> |
||||||
|
<Sidebar.TabTrigger |
||||||
|
tab="comments" |
||||||
|
style={{ opacity: openSidebar?.tab === "comments" ? 1 : 0.4 }} |
||||||
|
> |
||||||
|
{messageCircleIcon} |
||||||
|
</Sidebar.TabTrigger> |
||||||
|
<Sidebar.TabTrigger |
||||||
|
tab="presentation" |
||||||
|
style={{ opacity: openSidebar?.tab === "presentation" ? 1 : 0.4 }} |
||||||
|
> |
||||||
|
{presentationIcon} |
||||||
|
</Sidebar.TabTrigger> |
||||||
|
</DefaultSidebar.TabTriggers> |
||||||
|
<Sidebar.Tab tab="comments"> |
||||||
|
<div className="app-sidebar-promo-container"> |
||||||
|
<div |
||||||
|
className="app-sidebar-promo-image" |
||||||
|
style={{ |
||||||
|
["--image-source" as any]: `url(/oss_promo_comments_${ |
||||||
|
theme === THEME.DARK ? "dark" : "light" |
||||||
|
}.jpg)`,
|
||||||
|
opacity: 0.7, |
||||||
|
}} |
||||||
|
/> |
||||||
|
<div className="app-sidebar-promo-text"> |
||||||
|
Make comments with Excalidraw+ |
||||||
|
</div> |
||||||
|
<LinkButton |
||||||
|
href={`${ |
||||||
|
import.meta.env.VITE_APP_PLUS_LP |
||||||
|
}/plus?utm_source=excalidraw&utm_medium=app&utm_content=comments_promo#excalidraw-redirect`}
|
||||||
|
> |
||||||
|
Sign up now |
||||||
|
</LinkButton> |
||||||
|
</div> |
||||||
|
</Sidebar.Tab> |
||||||
|
<Sidebar.Tab tab="presentation" className="px-3"> |
||||||
|
<div className="app-sidebar-promo-container"> |
||||||
|
<div |
||||||
|
className="app-sidebar-promo-image" |
||||||
|
style={{ |
||||||
|
["--image-source" as any]: `url(/oss_promo_presentations_${ |
||||||
|
theme === THEME.DARK ? "dark" : "light" |
||||||
|
}.svg)`,
|
||||||
|
backgroundSize: "60%", |
||||||
|
opacity: 0.4, |
||||||
|
}} |
||||||
|
/> |
||||||
|
<div className="app-sidebar-promo-text"> |
||||||
|
Create presentations with Excalidraw+ |
||||||
|
</div> |
||||||
|
<LinkButton |
||||||
|
href={`${ |
||||||
|
import.meta.env.VITE_APP_PLUS_LP |
||||||
|
}/plus?utm_source=excalidraw&utm_medium=app&utm_content=presentations_promo#excalidraw-redirect`}
|
||||||
|
> |
||||||
|
Sign up now |
||||||
|
</LinkButton> |
||||||
|
</div> |
||||||
|
</Sidebar.Tab> |
||||||
|
</DefaultSidebar> |
||||||
|
); |
||||||
|
}; |
||||||
@ -1,19 +0,0 @@ |
|||||||
import { isExcalidrawPlusSignedUser } from "../app_constants"; |
|
||||||
|
|
||||||
export const ExcalidrawPlusAppLink = () => { |
|
||||||
if (!isExcalidrawPlusSignedUser) { |
|
||||||
return null; |
|
||||||
} |
|
||||||
return ( |
|
||||||
<a |
|
||||||
href={`${ |
|
||||||
import.meta.env.VITE_APP_PLUS_APP |
|
||||||
}?utm_source=excalidraw&utm_medium=app&utm_content=signedInUserRedirectButton#excalidraw-redirect`}
|
|
||||||
target="_blank" |
|
||||||
rel="noopener" |
|
||||||
className="plus-button" |
|
||||||
> |
|
||||||
Go to Excalidraw+ |
|
||||||
</a> |
|
||||||
); |
|
||||||
}; |
|
||||||
@ -0,0 +1,22 @@ |
|||||||
|
export const ExcalidrawPlusPromoBanner = ({ |
||||||
|
isSignedIn, |
||||||
|
}: { |
||||||
|
isSignedIn: boolean; |
||||||
|
}) => { |
||||||
|
return ( |
||||||
|
<a |
||||||
|
href={`${ |
||||||
|
isSignedIn |
||||||
|
? import.meta.env.VITE_APP_PLUS_LP |
||||||
|
: import.meta.env.VITE_APP_PLUS_APP |
||||||
|
}/plus?utm_source=excalidraw&utm_medium=app&utm_content=${ |
||||||
|
isSignedIn ? "signedInBanner" : "guestBanner" |
||||||
|
}#excalidraw-redirect`}
|
||||||
|
target="_blank" |
||||||
|
rel="noopener" |
||||||
|
className="plus-banner" |
||||||
|
> |
||||||
|
Excalidraw+ |
||||||
|
</a> |
||||||
|
); |
||||||
|
}; |
||||||
@ -0,0 +1,15 @@ |
|||||||
|
import { FilledButton } from "./FilledButton"; |
||||||
|
|
||||||
|
export const LinkButton = ({ |
||||||
|
children, |
||||||
|
href, |
||||||
|
}: { |
||||||
|
href: string; |
||||||
|
children: React.ReactNode; |
||||||
|
}) => { |
||||||
|
return ( |
||||||
|
<a href={href} target="_blank" rel="noopener" className="link-button"> |
||||||
|
<FilledButton>{children}</FilledButton> |
||||||
|
</a> |
||||||
|
); |
||||||
|
}; |
||||||
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 14 KiB |
Loading…
Reference in new issue