import React, {useState} from 'react' import { Card, Container, Button, Flex, Label, Heading, Text, Stack, useElementRect, useTheme, } from '@sanity/ui' import {CloseIcon} from '@sanity/icons' import styled, {css} from 'styled-components' const BlueColor = css` color: ${({theme}) => theme.sanity.color.muted.primary.enabled.fg}; ` const LabelContainer = styled(Label)` ${BlueColor} ` const TextContainer = styled(Text)` ${BlueColor} ` export const GetStartedTutorial = () => { const [hideTutorial, setShowTutorial] = useState( window.localStorage.getItem('getstarted_closedTutorial') !== null ) const {sanity} = useTheme() const [rootElement, setRootElement] = useState() const rect = useElementRect(rootElement) const isSmallScreen = rect?.width < sanity.media[1] const isProdEnv = process.env.NODE_ENV !== 'development' const onClose = () => { window.localStorage.setItem('getstarted_closedTutorial', 'true') setShowTutorial(true) } if (hideTutorial || isProdEnv) { return null } return (