-
Notifications
You must be signed in to change notification settings - Fork 593
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
969c56b
commit 778c226
Showing
35 changed files
with
791 additions
and
643 deletions.
There are no files selected for viewing
17 changes: 0 additions & 17 deletions
17
frontend/packages/console-app/src/components/quick-starts/QuickStartDrawer.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,11 @@ | ||
.co-quick-start-drawer-head { | ||
position: sticky; | ||
top: 0px; | ||
background: inherit; | ||
z-index: var(--pf-global--ZIndex--xs); | ||
} | ||
|
||
.co-quick-start-drawer { | ||
&__title { | ||
display: flex; | ||
align-items: center; | ||
flex-wrap: wrap; | ||
} | ||
|
||
&__body { | ||
display: flex; | ||
flex-direction: column; | ||
z-index: 0; | ||
position: relative; | ||
} | ||
|
||
&__modal > .pf-c-modal-box__footer { | ||
display: block; | ||
} | ||
&__duration { | ||
display: inline-block; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
frontend/packages/console-app/src/components/quick-starts/QuickStartPanelContent.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.co-quick-start-panel-content { | ||
&-head { | ||
position: sticky; | ||
top: 0px; | ||
background: inherit; | ||
z-index: var(--pf-global--ZIndex--xs); | ||
} | ||
&__title { | ||
display: flex; | ||
align-items: center; | ||
flex-wrap: wrap; | ||
} | ||
&__duration { | ||
display: inline-block; | ||
} | ||
} |
72 changes: 72 additions & 0 deletions
72
frontend/packages/console-app/src/components/quick-starts/QuickStartPanelContent.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import * as React from 'react'; | ||
import * as classNames from 'classnames'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { | ||
DrawerPanelContent, | ||
DrawerPanelBody, | ||
DrawerHead, | ||
DrawerActions, | ||
DrawerCloseButton, | ||
Title, | ||
} from '@patternfly/react-core'; | ||
import { QuickStart } from './utils/quick-start-types'; | ||
import { AsyncComponent } from '@console/internal/components/utils'; | ||
import { useScrollDirection, ScrollDirection } from '@console/shared/'; | ||
import './QuickStartDrawer.scss'; | ||
|
||
type HandleClose = () => void; | ||
|
||
type QuickStartPanelContentProps = { | ||
quickStarts: QuickStart[]; | ||
activeQuickStartID: string; | ||
handleClose: HandleClose; | ||
}; | ||
|
||
const QuickStartPanelContent: React.FC<QuickStartPanelContentProps> = ({ | ||
quickStarts = [], | ||
handleClose, | ||
activeQuickStartID, | ||
}) => { | ||
const [scrollDirection, handleScrollCallback] = useScrollDirection(); | ||
const { t } = useTranslation(); | ||
const quickStart = quickStarts.find((qs) => qs.metadata.name === activeQuickStartID); | ||
|
||
const headerClasses = classNames('co-quick-start-panel-content-head', { | ||
'pf-u-box-shadow-sm-bottom': | ||
scrollDirection && scrollDirection !== ScrollDirection.scrolledToTop, | ||
}); | ||
|
||
return quickStart ? ( | ||
<DrawerPanelContent onScroll={handleScrollCallback}> | ||
<div className={headerClasses}> | ||
<DrawerHead> | ||
<div className="co-quick-start-panel-content__title"> | ||
<Title | ||
headingLevel="h1" | ||
size="xl" | ||
style={{ marginRight: 'var(--pf-global--spacer--md)' }} | ||
> | ||
{quickStart?.spec.displayName}{' '} | ||
<small className="co-quick-start-panel-content__duration text-secondary"> | ||
{t('quickstart~{{duration, number}} minutes', { | ||
duration: quickStart?.spec.durationMinutes, | ||
})} | ||
</small> | ||
</Title> | ||
</div> | ||
<DrawerActions> | ||
<DrawerCloseButton onClick={handleClose} /> | ||
</DrawerActions> | ||
</DrawerHead> | ||
</div> | ||
<DrawerPanelBody> | ||
<AsyncComponent | ||
loader={() => import('./QuickStartController').then((c) => c.default)} | ||
quickStart={quickStart} | ||
/> | ||
</DrawerPanelBody> | ||
</DrawerPanelContent> | ||
) : null; | ||
}; | ||
|
||
export default QuickStartPanelContent; |
2 changes: 1 addition & 1 deletion
2
...end/packages/console-app/src/components/quick-starts/__tests__/quick-start-utils.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.