Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
reichert621 committed Aug 28, 2020
1 parent d5e8947 commit d45b8bf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/components/EmbeddableWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ class EmbeddableWidget extends React.Component<Props, State> {
this.setState({isOpen, isTransitioning: false}, () =>
this.send('papercups:toggle', {isOpen})
);
}, 400);
}, 200);
});
} else {
this.setState({isOpen}, () => this.send('papercups:toggle', {isOpen}));
Expand Down Expand Up @@ -371,7 +371,10 @@ class EmbeddableWidget extends React.Component<Props, State> {
variant: 'styles.WidgetToggleContainer',
}}
>
<WidgetToggle toggle={this.handleToggleOpen} />
<WidgetToggle
isDisabled={isTransitioning}
toggle={this.handleToggleOpen}
/>
</motion.div>
</ThemeProvider>
);
Expand Down
9 changes: 8 additions & 1 deletion src/components/WidgetToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ const Path = (props: any) => (
/>
);

export const WidgetToggle = ({toggle}: {toggle: () => void}) => {
export const WidgetToggle = ({
isDisabled,
toggle,
}: {
isDisabled?: boolean;
toggle: () => void;
}) => {
return (
<Flex
sx={{
Expand All @@ -29,6 +35,7 @@ export const WidgetToggle = ({toggle}: {toggle: () => void}) => {
sx={{
variant: 'styles.WidgetToggle',
}}
disabled={isDisabled}
onClick={toggle}
>
<svg width='27' height='27' viewBox='0 0 27 27'>
Expand Down

0 comments on commit d45b8bf

Please sign in to comment.