mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add rounded corners to welcome banners
Signed-off-by: Juho Heikka <juho.heikka@gmail.com>
This commit is contained in:
parent
64fb590377
commit
bcf66b1967
@ -71,4 +71,10 @@
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
.BannerCarouselWrapper {
|
||||
border-radius: var(--border-radius);
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,10 +33,10 @@ export const defaultWidth = 320;
|
||||
@observer
|
||||
export class Welcome extends React.Component {
|
||||
render() {
|
||||
const welcomeBanner = WelcomeBannerRegistry.getInstance().getItems();
|
||||
const welcomeBanners = WelcomeBannerRegistry.getInstance().getItems();
|
||||
|
||||
// if there is banner with specified width, use it to calculate the width of the container
|
||||
const maxWidth = welcomeBanner.reduce((acc, curr) => {
|
||||
const maxWidth = welcomeBanners.reduce((acc, curr) => {
|
||||
const currWidth = curr.width ?? 0;
|
||||
|
||||
if (acc > currWidth) {
|
||||
@ -49,10 +49,10 @@ export class Welcome extends React.Component {
|
||||
return (
|
||||
<div className="flex justify-center Welcome align-center">
|
||||
<div style={{ width: `${maxWidth}px` }} data-testid="welcome-banner-container">
|
||||
{welcomeBanner.length > 0 ? (
|
||||
{welcomeBanners.length > 0 ? (
|
||||
<Carousel
|
||||
stopAutoPlayOnHover={true}
|
||||
indicators={welcomeBanner.length > 1}
|
||||
indicators={welcomeBanners.length > 1}
|
||||
autoPlay={true}
|
||||
navButtonsAlwaysInvisible={true}
|
||||
indicatorIconButtonProps={{
|
||||
@ -67,8 +67,8 @@ export class Welcome extends React.Component {
|
||||
}}
|
||||
interval={8000}
|
||||
>
|
||||
{welcomeBanner.map((item, index) =>
|
||||
<item.Banner key={index} />
|
||||
{welcomeBanners.map((item, index) =>
|
||||
<div key={index} className="BannerCarouselWrapper"><item.Banner/></div>
|
||||
)}
|
||||
</Carousel>
|
||||
) : <Icon svg="logo-lens" className="logo" />}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user