Skip to content

Commit e37670f

Browse files
committed
cluster overview design updates
1 parent 7ef2936 commit e37670f

File tree

14 files changed

+383
-133
lines changed

14 files changed

+383
-133
lines changed

www/src/App.tsx

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,46 @@
1-
import 'react-toggle/style.css'
2-
import { Suspense, lazy } from 'react'
3-
import { Route, Routes } from 'react-router-dom'
41
import { ApolloProvider } from '@apollo/client'
5-
import { IntercomProvider } from 'react-use-intercom'
6-
import { Grommet, ThemeType } from 'grommet'
2+
import { mergeDeep } from '@apollo/client/utilities'
3+
import { GrowthBook, GrowthBookProvider } from '@growthbook/growthbook-react'
74
import {
85
BreadcrumbsProvider,
96
GlobalStyle,
10-
honorableThemeDark,
11-
honorableThemeLight,
12-
styledThemeDark,
13-
styledThemeLight,
147
useThemeColorMode,
158
} from '@pluralsh/design-system'
169
import { MarkdocContextProvider } from '@pluralsh/design-system/dist/markdoc'
10+
import { Grommet, ThemeType } from 'grommet'
1711
import {
1812
CssBaseline,
1913
ThemeProvider as HonorableThemeProvider,
2014
mergeTheme,
2115
} from 'honorable'
16+
import mpRecipe from 'honorable-recipe-mp'
17+
import { Suspense, lazy } from 'react'
18+
import { Route, Routes } from 'react-router-dom'
19+
import 'react-toggle/style.css'
20+
import { IntercomProvider } from 'react-use-intercom'
2221
import styled, {
2322
StyleSheetManager,
2423
ThemeProvider as StyledThemeProvider,
2524
} from 'styled-components'
26-
import { mergeDeep } from '@apollo/client/utilities'
27-
import mpRecipe from 'honorable-recipe-mp'
28-
import { GrowthBook, GrowthBookProvider } from '@growthbook/growthbook-react'
2925

3026
import { shouldForwardProp } from './utils/shouldForwardProp'
3127

3228
import { PluralErrorBoundary } from './components/utils/PluralErrorBoundary'
3329

34-
import { client } from './helpers/client'
35-
import { INTERCOM_APP_ID } from './constants'
36-
import { DEFAULT_THEME } from './theme'
37-
import { HistoryRouter, browserHistory } from './router'
38-
import { growthbook } from './helpers/growthbook'
30+
import {
31+
polyfilledHonorableThemeDark,
32+
polyfilledHonorableThemeLight,
33+
polyfilledStyledThemeDark,
34+
polyfilledStyledThemeLight,
35+
} from 'styles'
3936
import { OverlayContextProvider } from './components/layout/Overlay'
40-
import NavContextProvider from './contexts/NavigationContext'
4137
import { CursorPositionProvider } from './components/utils/CursorPosition'
38+
import { INTERCOM_APP_ID } from './constants'
39+
import NavContextProvider from './contexts/NavigationContext'
40+
import { client } from './helpers/client'
41+
import { growthbook } from './helpers/growthbook'
42+
import { HistoryRouter, browserHistory } from './router'
43+
import { DEFAULT_THEME } from './theme'
4244

4345
const Plural = lazy(() => import('./components/Plural'))
4446
const Invite = lazy(() => import('./components/Invite'))
@@ -105,7 +107,9 @@ function App() {
105107
const colorMode = useThemeColorMode()
106108

107109
const honorableTheme = mergeTheme(
108-
colorMode === 'light' ? honorableThemeLight : honorableThemeDark,
110+
colorMode === 'light'
111+
? polyfilledHonorableThemeLight
112+
: polyfilledHonorableThemeDark,
109113
{
110114
global: [
111115
// This provides the mp spacing props to honorable
@@ -114,7 +118,10 @@ function App() {
114118
],
115119
}
116120
)
117-
const styledTheme = colorMode === 'light' ? styledThemeLight : styledThemeDark
121+
const styledTheme =
122+
colorMode === 'light'
123+
? polyfilledStyledThemeLight
124+
: polyfilledStyledThemeDark
118125
const mergedStyledTheme = mergeDeep(DEFAULT_THEME, styledTheme)
119126

120127
const routes = (
@@ -182,6 +189,7 @@ function App() {
182189
<IntercomProvider appId={INTERCOM_APP_ID}>
183190
<StyleSheetManager shouldForwardProp={shouldForwardProp}>
184191
<HonorableThemeProvider theme={honorableTheme}>
192+
{/* @ts-ignore - this will be fixed when we bump DS */}
185193
<StyledThemeProvider theme={mergedStyledTheme}>
186194
<GrowthBookProvider
187195
growthbook={growthbook as any as GrowthBook}

www/src/components/create-cluster/CreateCluster.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
SendMessageIcon,
88
Stepper,
99
} from '@pluralsh/design-system'
10-
import { useNavigate } from 'react-router-dom'
1110
import styled, { useTheme } from 'styled-components'
1211

1312
import { ReactElement, useMemo, useState } from 'react'
@@ -34,6 +33,7 @@ import {
3433
cloudSteps,
3534
localSteps,
3635
} from './CreateClusterWizard'
36+
import { Link } from 'react-router-dom'
3737

3838
export const CUR_CREATE_CLUSTER_STEP_KEY = 'cur-create-cluster-step'
3939
export const CLOUD_OPTION_KEY = 'cloud-option'
@@ -43,7 +43,6 @@ const TTL_KEY = 'create-cluster-ttl'
4343

4444
export function CreateCluster() {
4545
const theme = useTheme()
46-
const navigate = useNavigate()
4746
const [curStep, setCurStep] = usePersistedState<CreateClusterStepKey>(
4847
CUR_CREATE_CLUSTER_STEP_KEY,
4948
CreateClusterStepKey.ChooseCloud,
@@ -129,10 +128,11 @@ export function CreateCluster() {
129128
width="100%"
130129
>
131130
<Button
132-
css={{ flex: 1 }}
131+
as={Link}
132+
to="/overview"
133133
secondary
134134
startIcon={<ReturnIcon />}
135-
onClick={() => navigate('/overview/clusters/plural-cloud')}
135+
style={{ flex: 1 }}
136136
>
137137
Back home
138138
</Button>

www/src/components/layout/ApplicationLayout.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ import Header from './Header'
77
import Sidebar from './Sidebar'
88
import Subheader from './Subheader'
99
import WithApplicationUpdate from './WithApplicationUpdate'
10+
import { useTheme } from 'styled-components'
1011

1112
function ApplicationLayout({ children }: any) {
13+
const { colors } = useTheme()
1214
const isProduction = import.meta.env.MODE === 'production'
1315

1416
return (
@@ -21,6 +23,7 @@ function ApplicationLayout({ children }: any) {
2123
overflow="hidden"
2224
flexDirection="column"
2325
flexGrow={1}
26+
background={colors['fill-accent']}
2427
>
2528
{isProduction && (
2629
<WithApplicationUpdate>

www/src/components/layout/Header.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ const APP_ICON_LIGHT = '/header-logo-light.png'
1111
const APP_ICON_DARK = '/header-logo-dark.png'
1212

1313
const HeaderSC = styled.div(({ theme }) => ({
14-
backgroundColor:
15-
theme.mode === 'light' ? theme.colors['fill-one'] : theme.colors.grey[850],
14+
backgroundColor: theme.colors['fill-zero'],
1615
borderBottom: theme.borders.default,
1716
}))
1817

www/src/components/layout/Sidebar.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,12 @@ function SidebarMenuItem({
135135
)
136136
}
137137

138-
const SidebarSC = styled(DSSidebar)((_) => ({
138+
const SidebarSC = styled(DSSidebar)(({ theme }) => ({
139139
flexGrow: 1,
140140
minHeight: 0,
141141
height: 'auto',
142+
background: theme.colors['fill-zero'],
143+
borderRight: theme.borders['fill-one'],
142144
overflow: 'auto',
143145
}))
144146

www/src/components/layout/Subheader.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ const SubheaderContent = styled.div(({ theme }) => ({
5959
paddingTop: theme.spacing.small,
6060
paddingBottom: theme.spacing.small,
6161
alignItems: 'center',
62-
backgroundColor: theme.colors['fill-one'],
62+
backgroundColor: theme.colors['fill-zero'],
63+
borderBottom: theme.borders['fill-one'],
6364
maxHeight: '100%',
6465
paddingLeft: theme.spacing.large,
6566
paddingRight: theme.spacing.large,

www/src/components/overview/OverviewHeader.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Button, SubTab, TabList } from '@pluralsh/design-system'
1+
import { SubTab, TabList } from '@pluralsh/design-system'
22
import { Flex } from 'honorable'
33
import { ReactElement, useRef } from 'react'
4-
import { useLocation, useNavigate } from 'react-router-dom'
4+
import { useLocation } from 'react-router-dom'
55

66
import { LinkTabWrap } from '../utils/Tabs'
77

@@ -13,7 +13,6 @@ const DIRECTORY = [
1313

1414
export default function OverviewHeader(): ReactElement {
1515
const tabStateRef = useRef<any>(null)
16-
const navigate = useNavigate()
1716
const { pathname } = useLocation()
1817
const currentTab = DIRECTORY.find((tab) => pathname?.startsWith(tab.path))
1918

@@ -36,11 +35,6 @@ export default function OverviewHeader(): ReactElement {
3635
</LinkTabWrap>
3736
))}
3837
</TabList>
39-
<Flex gap="medium">
40-
<Button onClick={() => navigate('/create-cluster')}>
41-
Create cluster
42-
</Button>
43-
</Flex>
4438
</Flex>
4539
)
4640
}
Lines changed: 44 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,43 @@
1-
import { Button, Card, ClusterIcon, Flex } from '@pluralsh/design-system'
1+
import { Button, Card, Flex } from '@pluralsh/design-system'
22
import { hasUnfinishedCreation } from 'components/create-cluster/CreateCluster'
33
import { useState } from 'react'
4-
import { useNavigate } from 'react-router-dom'
5-
import styled, { useTheme } from 'styled-components'
4+
import { Link } from 'react-router-dom'
5+
import styled from 'styled-components'
66

7+
import { Body2P, Title2H1 } from 'components/utils/Typography'
8+
import ReactPlayer from 'react-player'
9+
import { ClustersHelpSection } from './ClustersHelpSection'
710
import { useDeleteUnfinishedInstance } from './plural-cloud/DeleteInstance'
811

9-
export default function ClusterListEmptyState() {
10-
const theme = useTheme()
11-
const navigate = useNavigate()
12-
12+
export function ClusterListEmptyState() {
1313
const [showUnfinished, setShowUnfinished] = useState(hasUnfinishedCreation())
1414
const { triggerDelete, loading } = useDeleteUnfinishedInstance({
1515
onClear: () => setShowUnfinished(false),
1616
})
1717

1818
return (
19-
<Card css={{ minWidth: 'fit-content' }}>
20-
<Wrapper>
21-
<ClusterIcon size={theme.spacing.xxxlarge} />
19+
<GridWrapSC>
20+
<CreateClusterCardSC>
2221
<Flex
2322
direction="column"
24-
gap="xxsmall"
23+
gap="small"
2524
textAlign="center"
26-
marginTop={theme.spacing.medium}
2725
>
28-
<span css={theme.partials.text.subtitle2}>
29-
You don't have any clusters yet.
30-
</span>
31-
<span
32-
css={{
33-
...theme.partials.text.body2,
34-
color: theme.colors['text-light'],
35-
}}
26+
<Title2H1 css={{ fontWeight: 400 }}>
27+
Create your first cluster
28+
</Title2H1>
29+
<Body2P
30+
$color="text-light"
31+
css={{ maxWidth: 450 }}
3632
>
3733
Once you create your first cluster, you will find an overview of its
3834
details here.
39-
</span>
35+
</Body2P>
4036
</Flex>
4137
<Button
42-
css={{ maxWidth: 300, width: '100%' }}
43-
onClick={() => navigate('/create-cluster')}
38+
as={Link}
39+
to="/create-cluster"
40+
style={{ maxWidth: 300, width: '100%' }}
4441
>
4542
{showUnfinished ? 'Resume cluster creation' : 'Create cluster'}
4643
</Button>
@@ -54,17 +51,36 @@ export default function ClusterListEmptyState() {
5451
Cancel cluster creation
5552
</Button>
5653
)}
57-
</Wrapper>
58-
</Card>
54+
</CreateClusterCardSC>
55+
<Card css={{ overflow: 'clip', minWidth: 450 }}>
56+
<ReactPlayer
57+
url="https://www.youtube.com/watch?v=sEb_gflm-ME"
58+
controls
59+
width="100%"
60+
height="100%"
61+
/>
62+
</Card>
63+
<div css={{ gridColumn: '1 / -1' }}>
64+
<ClustersHelpSection />
65+
</div>
66+
</GridWrapSC>
5967
)
6068
}
6169

62-
const Wrapper = styled.div(({ theme }) => ({
63-
margin: 'auto',
70+
const GridWrapSC = styled.div(({ theme }) => ({
71+
display: 'grid',
72+
gridTemplateColumns: '1fr 1fr',
73+
gridTemplateRows: 'auto',
74+
gap: `${theme.spacing.xlarge}px ${theme.spacing.large}px`,
75+
}))
76+
77+
const CreateClusterCardSC = styled(Card)(({ theme }) => ({
6478
display: 'flex',
6579
flexDirection: 'column',
80+
justifyContent: 'center',
6681
alignItems: 'center',
67-
maxWidth: '600px',
82+
minWidth: 450,
83+
background: theme.colors['fill-zero'],
6884
padding: `${theme.spacing.xxxlarge}px`,
6985
gap: `${theme.spacing.medium}px`,
7086
}))

0 commit comments

Comments
 (0)