Skip to content

Commit

Permalink
feat: support props.className
Browse files Browse the repository at this point in the history
  • Loading branch information
dwelle committed Jun 12, 2024
1 parent ab648b8 commit 1d084f0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/excalidraw/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1493,11 +1493,15 @@ class App extends React.Component<AppProps, AppState> {

return (
<div
className={clsx("excalidraw excalidraw-container", {
"excalidraw--view-mode": this.state.viewModeEnabled,
"excalidraw--mobile": this.device.editor.isMobile,
"excalidraw--zen-mode": this.state.zenModeEnabled,
})}
className={clsx(
"excalidraw excalidraw-container",
this.props.className,
{
"excalidraw--view-mode": this.state.viewModeEnabled,
"excalidraw--mobile": this.device.editor.isMobile,
"excalidraw--zen-mode": this.state.zenModeEnabled,
},
)}
style={{
["--ui-pointerEvents" as any]: shouldBlockPointerEvents
? POINTER_EVENTS.disabled
Expand Down
2 changes: 2 additions & 0 deletions packages/excalidraw/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ polyfill();

const ExcalidrawBase = (props: ExcalidrawProps) => {
const {
className,
onChange,
initialData,
excalidrawAPI,
Expand Down Expand Up @@ -115,6 +116,7 @@ const ExcalidrawBase = (props: ExcalidrawProps) => {
<InitializeApp langCode={langCode} theme={theme}>
<App
id={id}
className={className}
onChange={onChange}
initialData={initialData}
excalidrawAPI={excalidrawAPI}
Expand Down
1 change: 1 addition & 0 deletions packages/excalidraw/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ export type OnUserFollowedPayload = {

export interface ExcalidrawProps {
id?: string | null;
className?: string;
onChange?: (
elements: readonly OrderedExcalidrawElement[],
appState: AppState,
Expand Down

0 comments on commit 1d084f0

Please sign in to comment.