Skip to content

Commit

Permalink
Remove align prop of ExportMenu
Browse files Browse the repository at this point in the history
  • Loading branch information
axelboc committed May 28, 2024
1 parent 345f8e8 commit 4394f86
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions packages/lib/src/toolbar/controls/ExportMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ import Btn from './Btn';
import { useFloatingDismiss } from './hooks';
import { download, floatingMinWidth } from './utils';

const PLACEMENTS = {
center: 'bottom',
left: 'bottom-start',
right: 'bottom-end',
} as const;

interface ExportEntry {
format: string;
url: URL | (() => Promise<URL | Blob>) | undefined;
Expand All @@ -31,11 +25,10 @@ interface ExportEntry {
interface Props {
entries: ExportEntry[];
isSlice?: boolean;
align?: keyof typeof PLACEMENTS;
}

function ExportMenu(props: Props) {
const { entries, isSlice, align = 'center' } = props;
const { entries, isSlice } = props;
const availableEntries = entries.filter(({ url }) => !!url);

const [isOpen, toggle] = useToggle();
Expand All @@ -46,7 +39,6 @@ function ExportMenu(props: Props) {

const { refs, floatingStyles, context } = useFloating<HTMLButtonElement>({
open: isOpen,
placement: PLACEMENTS[align],
middleware: [floatingMinWidth, offset(6), shift({ padding: 6 })],
onOpenChange: toggle,
whileElementsMounted: autoUpdate,
Expand Down

0 comments on commit 4394f86

Please sign in to comment.