All files / modules/75-cf/pages/onboarding OnboardingPage.tsx

93.75% Statements 15/16
100% Branches 0/0
50% Functions 1/2
93.33% Lines 14/15

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88              1x 1x 1x 1x 1x 1x 1x 1x 1x   1x 1x 1x 1x   1x                                                                                                                                  
/*
 * Copyright 2021 Harness Inc. All rights reserved.
 * Use of this source code is governed by the PolyForm Shield 1.0.0 license
 * that can be found in the licenses directory at the root of this repository, also available at
 * https://polyformproject.org/wp-content/uploads/2020/06/PolyForm-Shield-1.0.0.txt.
 */
 
import React from 'react'
import { Button, Container, Heading, Text } from '@wings-software/uicore'
import { useHistory, useParams } from 'react-router-dom'
import { Intent, Color } from '@harness/design-system'
import routes from '@common/RouteDefinitions'
import { useStrings } from 'framework/strings'
import theBasicsImage from './basics.svg'
import upAndRunningImage from './upAndRunning.svg'
import css from './OnboardingPage.module.scss'
 
export const OnboardingPage = () => {
  const { accountId, orgIdentifier, projectIdentifier } = useParams<Record<string, string>>()
  const { getString } = useStrings()
  const history = useHistory()
 
  return (
    <Container padding="huge" height="100%" background={Color.WHITE}>
      <Heading
        style={{
          fontSize: '30px',
          fontWeight: 700,
          color: '#22222A',
          lineHeight: '32px'
        }}
      >
        {getString('cf.onboarding.title')}
        <Text
          style={{
            fontWeight: 400,
            fontSize: '16px',
            lineHeight: '40px',
            color: '#4F5162'
          }}
        >
          {getString('cf.onboarding.subTitle')}
        </Text>
      </Heading>
      <Container margin={{ top: 'xxxlarge' }}>
        <Container
          style={{ display: 'grid', justifyContent: 'center', padding: '0' }}
          className={css.basicImageContainer}
        >
          <img src={theBasicsImage} width={1154} height={425} title={getString('featureFlagsText')} />
        </Container>
      </Container>
 
      <Container margin={{ top: 'xxxlarge' }}>
        <Heading level={2} className={css.h2}>
          {getString('cf.onboarding.upAndRunning')}
        </Heading>
        <Container
          style={{ display: 'grid', justifyContent: 'center', padding: '20px 0 40px' }}
          className={css.stepImageContainer}
        >
          <img
            src={upAndRunningImage}
            style={{ transform: 'scale(1.15)' }}
            className={css.stepsImage}
            width={1162}
            height={125}
            title={getString('featureFlagsText')}
          />
        </Container>
      </Container>
 
      <Container style={{ display: 'grid', justifyContent: 'center' }}>
        <Button
          intent={Intent.PRIMARY}
          text={getString('cf.onboarding.tryItOut')}
          large
          style={{ fontWeight: 700 }}
          width={350}
          onClick={() => {
            history.push(routes.toCFOnboardingDetail({ accountId, orgIdentifier, projectIdentifier }))
          }}
        />
      </Container>
    </Container>
  )
}