Skip to content

Commit

Permalink
renamed prop name, removed unnecessary additional component
Browse files Browse the repository at this point in the history
  • Loading branch information
pramodcog committed Aug 26, 2024
1 parent 9ab65aa commit afd2097
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions react-components/src/components/Widgets/WindowWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type WindowWidgetProps = {
subtitle?: string;
header?: string;
type?: string;
openInNewTab?: ReactNode;
customComponent?: ReactNode;
children: ReactNode;
onClose?: () => void;
onResize?: (width: number, height: number) => void;
Expand All @@ -39,7 +39,7 @@ export const WindowWidget = ({
header,
type,
children,
openInNewTab,
customComponent,
onClose,
onResize
}: WindowWidgetProps): ReactElement => {
Expand Down Expand Up @@ -117,7 +117,7 @@ export const WindowWidget = ({
onResize={handleResize}>
<Widget>
<Widget.Header title={title} type={type} header={header} subtitle={subtitle}>
{openInNewTab !== undefined && <div>{openInNewTab}</div>}
{customComponent !== undefined && customComponent}
<CogsTooltip
content={
isMinimized
Expand Down
2 changes: 1 addition & 1 deletion react-components/src/components/Widgets/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export const WIDGET_WINDOW_X_OFFSET = 150;
export const WIDGET_WINDOW_Y_OFFSET = 75;
export const WIDGET_WIDTH_FACTOR = 0.4;
export const WIDGET_HEIGHT_FACTOR = 0.7;
export const WIDGET_WINDOW_MIN_WIDTH = 300;
export const WIDGET_WINDOW_MIN_WIDTH = 400;
export const WIDGET_WINDOW_MIN_HEIGHT = 48;
export const WIDGET_INSIDE_WINDOW_MIN_HEIGHT = 150;
8 changes: 6 additions & 2 deletions react-components/stories/SplitWindow.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const Main: Story = {
<WindowWidget
header="Widget Header"
onClose={handleClose}
openInNewTab={openExternalButton()}>
customComponent={openExternalButton()}>
<SecondaryRevealContainer />
</WindowWidget>
)}
Expand All @@ -61,7 +61,11 @@ export const Main: Story = {
};

function openExternalButton(): ReactNode {
return <Button>Open in New Tab</Button>;
return (
<Button style={{ whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>
Open in New Tab
</Button>
);
}

function SecondaryRevealContainer(): ReactElement {
Expand Down

0 comments on commit afd2097

Please sign in to comment.