mirror of
https://github.com/outline/outline.git
synced 2026-11-21 21:44:30 +03:00
19 lines
423 B
TypeScript
19 lines
423 B
TypeScript
import type { NavigationNode } from "../types";
|
|
import * as React from "react";
|
|
|
|
type ShareContextType = {
|
|
shareId?: string;
|
|
sharedTree?: NavigationNode;
|
|
};
|
|
|
|
export const ShareContext = React.createContext<ShareContextType>({});
|
|
|
|
export default function useShare(): ShareContextType & { isShare: boolean } {
|
|
const value = React.useContext(ShareContext);
|
|
|
|
return {
|
|
...value,
|
|
isShare: !!value.shareId,
|
|
};
|
|
}
|