From 3d602d2ed4ee2d812ff5878f29b03e7208f249b2 Mon Sep 17 00:00:00 2001 From: Kamil Gabryjelski Date: Fri, 11 Feb 2022 15:49:09 +0100 Subject: [PATCH] Add max widths --- .../src/components/EmptyState/index.tsx | 60 +++++++++++++------ 1 file changed, 43 insertions(+), 17 deletions(-) diff --git a/superset-frontend/src/components/EmptyState/index.tsx b/superset-frontend/src/components/EmptyState/index.tsx index bc64f7bf83313..99a6ce7bc7160 100644 --- a/superset-frontend/src/components/EmptyState/index.tsx +++ b/superset-frontend/src/components/EmptyState/index.tsx @@ -18,7 +18,7 @@ */ import React, { ReactNode } from 'react'; -import { styled, css } from '@superset-ui/core'; +import { styled, css, SupersetTheme } from '@superset-ui/core'; import { Empty } from 'src/common/components'; import Button from 'src/components/Button'; @@ -61,6 +61,8 @@ const EmptyStateContainer = styled.div` `} `; +const TextContainer = styled.div``; + const Title = styled.p` ${({ theme }) => css` font-size: ${theme.typography.sizes.m}px; @@ -137,13 +139,21 @@ export const EmptyStateBig = ({ }: EmptyStateProps) => ( - {title} - {description && {description}} - {buttonAction && buttonText && ( - - {buttonText} - - )} + + css` + max-width: ${theme.gridUnit * 150}px; + ` + } + > + {title} + {description && {description}} + {buttonAction && buttonText && ( + + {buttonText} + + )} + ); @@ -156,13 +166,21 @@ export const EmptyStateMedium = ({ }: EmptyStateProps) => ( - {title} - {description && {description}} - {buttonText && buttonAction && ( - - {buttonText} - - )} + + css` + max-width: ${theme.gridUnit * 100}px; + ` + } + > + {title} + {description && {description}} + {buttonText && buttonAction && ( + + {buttonText} + + )} + ); @@ -173,7 +191,15 @@ export const EmptyStateSmall = ({ }: EmptyStateSmallProps) => ( - {title} - {description && {description}} + + css` + max-width: ${theme.gridUnit * 75}px; + ` + } + > + {title} + {description && {description}} + );