@chakra-ui/core#Link JavaScript Examples

The following examples show how to use @chakra-ui/core#Link. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: header.js    From covid-19-website with MIT License 6 votes vote down vote up
NavLink = props => {
  const isExternal = props.to.startsWith('http');
  const linkElement = isExternal ? Link : GatsbyLink;
  const adjustedProps = {
    ...props,
    target: isExternal ? '_blank' : null,
    href: isExternal ? props.to : null,
  };

  return <Button variant="ghost" fontSize="20px" as={linkElement} fontWeight={500} {...adjustedProps} />
}
Example #2
Source File: index.js    From covid-19-website with MIT License 6 votes vote down vote up
render() {

    return (  <Layout>
      <SEO title="Home" />
      <Section
        backgroundColor={"purple"}
        paddingY={[1,8]}
      >
        <Flex>
          <Box {...headerContainerProps}>
            <Text {...headerStyling}>We're making some changes, you will be redirected to our sister website</Text>
            <Link href="https://covidtechsupport.com/">
              <Button {...buttonStyling}>Click here if not redirected</Button>
            </Link>
          </Box>
        </Flex>
      </Section>
    </Layout>)
  }
Example #3
Source File: index.js    From here-covid-19-tracker with MIT License 6 votes vote down vote up
AboutContent = () => {
  return (
    <>
      <Heading fontSize={["1.5rem", "2rem"]} lineHeight={1.125} mb="1.25rem">
        { "About" }
      </Heading>

      <Text>
        { `Using HERE location services (HERE Vector Map Tiles API and HERE Data Hub APIs) and ` }
        <Link alt="Center for Systems Science and Engineering (CSSE)" href="https://github.com/CSSEGISandData/COVID-19" color="#00AFAA">
          { "data provided by the Center for Systems Science and Engineering (CSSE) at Johns Hopkins University"}
        </Link>
        { `, and ` }
        <Link alt="DXY" href="https://ncov.dxy.cn/ncovh5/view/pneumonia?scene=2&clicktime=1579582238&enterid=1579582238&from=singlemessage&isappinstalled=0" color="#00AFAA">
          { "DXY" }
        </Link>
        { `, we display the spread of Coronavirus COVID-19 globally. For questions regarding the global data, please get in touch with ` }
        <Link alt="Center for Systems Science and Engineering (CSSE)" href="https://github.com/CSSEGISandData/COVID-19" color="#00AFAA">
          { "JHU CSSE"}
        </Link>
        { `. For questions regarding China-specific data, please contact ` }
        <Link alt="DXY" href="https://ncov.dxy.cn/ncovh5/view/pneumonia?scene=2&clicktime=1579582238&enterid=1579582238&from=singlemessage&isappinstalled=0" color="#00AFAA">
          { "DXY" }
        </Link>
        { `.` }
      </Text>

      <Heading fontSize={["1.25rem", "1.5rem"]} lineHeight={1.125} mt="1.75rem" mb="1.25rem">
        { "About HERE Technologies" }
      </Heading>
      <Text>
        { "HERE, a location data and technology platform, moves people, businesses and cities forward by harnessing the power of location. By leveraging our open platform, we empower our customers to achieve better outcomes – from helping a city manage its infrastructure or a business optimize its assets to guiding drivers to their destination safely. To learn more about HERE, please visit " }
        <Link href="https://www.here.com/" target="_blank" rel="noopener noreferrer" color="#00AFAA">{"www.here.com"}</Link>
        { " and " }
        <Link href="https://360.here.com/" target="_blank" rel="noopener noreferrer" color="#00AFAA">{"360.here.com"}</Link>
      </Text>
    </>
  )
}
Example #4
Source File: index.js    From here-covid-19-tracker with MIT License 6 votes vote down vote up
IntroParagraph = ({ points }) => {
  const currentDate = useDataDate(state => state.currentDate)

  const sum = points.length ? points.reduce((acc, cur) => {
    return acc + (cur.properties[currentDate] || 0)
  }, 0) : null

  return (
    <Text color="gray.600" mb="1.25rem">

      {`The first case of the new Coronavirus COVID-19 was recorded on 31 December in Wuhan, China (`}
      <Link alt="WHO — Novel coronavirus (COVID-19)" href="https://www.who.int/emergencies/diseases/novel-coronavirus-2019" color="#00AFAA">
        { "WHO" }
      </Link>
      { `). Since then,${sum ? " " + formatThousand(sum) : ""} confirmed cases have been recorded worldwide. This visualization shows the near real-time status based on data from the ` }
      <Link alt="Center for Systems Science and Engineering (CSSE)" href="https://github.com/CSSEGISandData/2019-nCoV" color="#00AFAA">
        { "Center for Systems Science and Engineering (CSSE)" }
      </Link>
      { ` at Johns Hopkins University and ` }
      <Link alt="DXY" href="https://ncov.dxy.cn/ncovh5/view/pneumonia?scene=2&clicktime=1579582238&enterid=1579582238&from=singlemessage&isappinstalled=0" color="#00AFAA">
        { "DXY." }
      </Link>
      { ` Data currently available on the following zoom levels: City level - US, Canada and Australia; Province level - China; Country level - other countries.` }
      { ` To read more about this map, see ` }
      <Link
        color="#00AFAA"
        alt="How we built an interactive map displaying the COVID-19 outbreak"
        href="https://developer.here.com/blog/how-we-built-an-interactive-map-displaying-the-covid-19-outbreak"
      >
        { "How we built an interactive map displaying the COVID-19 outbreak" }
      </Link>
      { "." }
    </Text>
  )
}
Example #5
Source File: footer.js    From dashboard with MIT License 6 votes vote down vote up
export default function Footer() {
  const color = useColorModeValue('gray.900', 'gray.200');
  const bgColor = useColorModeValue('gray.200', 'gray.500');

  return (
    <Stack direction="row" as="footer" mt={12} justify="center">
      {links.map(([icon, route, title]) => (
        <Link
          href={route}
          key={route}
          isExternal
          title={title}
          color={color}
          borderRadius="lg"
          p={2}
          _hover={{ bg: bgColor }}
        >
          <Box as={icon} boxSize={6} />
        </Link>
      ))}
    </Stack>
  );
}
Example #6
Source File: home.js    From space-rockets-challenge with MIT License 6 votes vote down vote up
function PageLink({ url, children, ...rest }) {
  return (
    <Link as={BrowserLink} to={url} {...rest}>
      <Flex
        justifyContent="space-between"
        p="6"
        boxShadow="md"
        borderWidth="1px"
        rounded="lg"
      >
        <Text fontSize="lg">{children}</Text>
        <Box as={ArrowRight} />
      </Flex>
    </Link>
  );
}
Example #7
Source File: launch.js    From space-rockets-challenge with MIT License 6 votes vote down vote up
function TimeAndLocation({ launch }) {
  return (
    <SimpleGrid columns={[1, 1, 2]} borderWidth="1px" p="4" borderRadius="md">
      <Stat>
        <StatLabel display="flex">
          <Box as={Watch} width="1em" />{" "}
          <Box ml="2" as="span">
            Launch Date
          </Box>
        </StatLabel>
        <StatNumber fontSize={["md", "xl"]}>
          {formatDateTime(launch.launch_date_local)}
        </StatNumber>
        <StatHelpText>{timeAgo(launch.launch_date_utc)}</StatHelpText>
      </Stat>
      <Stat>
        <StatLabel display="flex">
          <Box as={MapPin} width="1em" />{" "}
          <Box ml="2" as="span">
            Launch Site
          </Box>
        </StatLabel>
        <StatNumber fontSize={["md", "xl"]}>
          <Link
            as={RouterLink}
            to={`/launch-pads/${launch.launch_site.site_id}`}
          >
            {launch.launch_site.site_name_long}
          </Link>
        </StatNumber>
        <StatHelpText>{launch.launch_site.site_name}</StatHelpText>
      </Stat>
    </SimpleGrid>
  );
}
Example #8
Source File: header.js    From covid-19-website with MIT License 5 votes vote down vote up
Header = () => {
  const { isOpen, onOpen, onClose } = useDisclosure()

  return (
    <Flex
      as="header"
      backgroundColor="white"
      paddingX={["1rem", "4.5rem"]}
      paddingY={[1,6]}
      justifyContent="space-between"
      alignItems="center"
    >
      <GatsbyLink to="/">
        <Code4Covid width={200}/>
      </GatsbyLink>
      <IconButton
        display={["block", "block", "block", "block", "none"]} // Match this with the inverse of the buttons stack to use Chakra breakpoints
        variant="ghost"
        size="lg"
        aria-label="Navigation Button"
        icon="menu"
        onClick={onOpen}
      />
      <Drawer isOpen={isOpen} placement="right" onClose={onClose}>
        <DrawerOverlay />
        <DarkMode>
          <DrawerContent backgroundColor="gray.700" color="white">
            <DrawerCloseButton />
            <DrawerBody>
              <Stack as="nav" direction="column" marginTop={16} spacing={8}>
                {PAGES.map(page => (
                  <NavLink
                    key={page.children + page.to}
                    fontSize={28}
                    color="white"
                    css={css`
                      [aria-current]& {
                        font-weight: 700;
                      }
                    `}
                    {...page}
                  />
                ))}
                <Link textAlign="center" href="https://twitter.com/code4covid" isExternal>
                  <TwitterIcon width="40px" style={{ display: "inline-block" }} />
                </Link>
              </Stack>
            </DrawerBody>
          </DrawerContent>
        </DarkMode>
      </Drawer>
    </Flex>
  )
}
Example #9
Source File: CompanyReviewForm.js    From allay-fe with MIT License 4 votes vote down vote up
ReviewForm2 = ({
  history,
  loadingCompanies,
  companies,
  getCompanies,
  postReview,
}) => {
  //initialize animations
  AOS.init()
  const { register, handleSubmit, formState } = useForm()

  // thinking state
  const [thinking, setThinking] = useState(false)
  const dots = () => {
    setThinking(true)
  }

  // search state
  const [searchTerm, setSearchTerm] = useState('')
  const [searchResults, setSearchResults] = useState([])

  // no company state
  const [noCompany, setNoCompany] = useState(false)

  // location "state"
  const [location, setLocation] = useState({})
  const [newLocation, setNewLocation] = useState({})
  const stateSelectorHelper = (value) => {
    setLocation(value)
  }

  // star rating
  const [starState, setStarState] = useState(0)

  //progress bar
  const [progress, setProgress] = useState({
    prec: 99,
    time: 8,
    prog: 2,
  })

  // state for visibility
  const [Tag2, setTag2] = useState(false)
  const [Tag3, setTag3] = useState(false)
  const [Tag4, setTag4] = useState(false)
  const [Tag5, setTag5] = useState(false)
  const [Tag6, setTag6] = useState(false)

  // brings to top on render
  useEffect(() => {
    getCompanies()
    setProgress({
      prec: 95,
      time: 7,
      prog: 5,
    })
    const element = document.getElementById('Tag1')
    element.scrollIntoView({
      behavior: 'smooth',
      block: 'center',
    })
  }, [getCompanies])

  // company search function
  useEffect(() => {
    if (searchTerm.length >= 3) {
      const results = companies.filter((company) =>
        company.company_name.toLowerCase().startsWith(searchTerm.toLowerCase())
      )
      setSearchResults(results)
      if (results.length === 0) {
        setNoCompany(true)
      } else {
        setNoCompany(false)
      }
    }
  }, [searchTerm, companies])

  // state confirmation search function
  useEffect(() => {
    if (location.myState) {
      const stateId = states.filter((i) =>
        i.state_name.toLowerCase().startsWith(location.myState.toLowerCase())
      )
      setNewLocation({ ...location, myState: stateId[0].id })
    }
  }, [location])

  // timers for moves
  let timer = null
  let dotTimer = null

  // 2nd tag
  const time1 = () => {
    clearTimeout(timer)
    clearTimeout(dotTimer)
    dotTimer = setTimeout(dots, 300)
    timer = setTimeout(routeTo2, 1000)
  }
  const routeTo2 = () => {
    setTag2(true)
    setProgress({
      prec: 70,
      time: 6,
      prog: 20,
    })
    const element = document.getElementById('Tag2')
    element.scrollIntoView({ behavior: 'smooth', block: 'start' })
    setThinking(false)
  }

  // 3rd tag
  const time2 = () => {
    clearTimeout(timer)
    clearTimeout(dotTimer)
    dotTimer = setTimeout(dots, 300)
    timer = setTimeout(routeTo3, 1000)
  }
  const routeTo3 = () => {
    setTag3(true)
    setProgress({
      prec: 65,
      time: 4,
      prog: 35,
    })
    const element = document.getElementById('Tag3')
    element.scrollIntoView({ behavior: 'smooth', block: 'start' })
    setThinking(false)
  }

  //4th tag
  const time3 = () => {
    clearTimeout(timer)
    clearTimeout(dotTimer)
    dotTimer = setTimeout(dots, 300)
    timer = setTimeout(routeTo4, 1000)
  }
  const routeTo4 = () => {
    setTag4(true)
    setProgress({
      prec: 45,
      time: 2,
      prog: 65,
    })
    const element = document.getElementById('Tag4')
    element.scrollIntoView({ behavior: 'smooth', block: 'start' })
    setThinking(false)
  }

  // 5th tag
  const time4 = () => {
    clearTimeout(timer)
    clearTimeout(dotTimer)
    dotTimer = setTimeout(dots, 300)
    timer = setTimeout(routeTo5, 1000)
  }
  const routeTo5 = () => {
    setTag5(true)
    setProgress({
      prec: 20,
      time: 1,
      prog: 80,
    })
    const element = document.getElementById('Tag5')
    element.scrollIntoView({ behavior: 'smooth', block: 'center' })
    setThinking(false)
  }

  // 6th tag
  const time5 = () => {
    clearTimeout(timer)
    clearTimeout(dotTimer)
    dotTimer = setTimeout(dots, 300)
    timer = setTimeout(routeTo6, 1000)
  }
  const routeTo6 = () => {
    setTag6(true)
    setProgress({
      prec: 100,
      time: 0,
      prog: 100,
    })
    const element = document.getElementById('Tag6')
    element.scrollIntoView({ behavior: 'smooth', block: 'center' })
    setThinking(false)
  }

  //push to dashboard and send info to DS for review
  const sendInfoToDS = (data) => {
    var dataForDS = JSON.stringify(data)
    axiosToDS()
      .post('/check_review', dataForDS)
      .then((res) => {
        console.log(res)
      })
      .catch((err) => {
        console.log(err)
      })
    history.push('/dashboard')
  }

  //submit handler
  const submitForm = (data) => {
    postReview(localStorage.getItem('userId'), {
      ...data,
      review_type_id: 1,
      overall_rating: starState,
      city: newLocation.myCity,
      state_id: newLocation.myState,
    }).then(() => sendInfoToDS(data))
    ReactGA.event({
      category: 'Review',
      action: `Submit review`,
    })
  }

  return (
    // main container

    <>
      <Flex justify="center">
        <ProgressHeader progress={progress} />
      </Flex>

      <Flex w="100%" margin="0 auto" minH="100vh">
        {thinking ? (
          <>
            <Flex
              bottom="0"
              position="fixed"
              overflow="hidden"
              zIndex="999"
              pt="5%"
              pl="15%"
            >
              <ThinkingDots />
            </Flex>
          </>
        ) : null}
        {/* form container */}
        <Flex
          w="100%"
          bg="#FFF"
          flexDir="column"
          px="2%"
          pt="5%"
          margin="0 auto"
        >
          {/*--------------- start of form ---------------  */}
          <form onSubmit={handleSubmit(submitForm)}>
            <FormControl isRequired>
              {/* first prompt */}
              <Flex
                id="Tag1"
                align="center"
                h="5%"
                p="1%"
                w="416px"
                mb="8%"
                mt="5%"
                bg="#F2F6FE"
                rounded="20px"
                data-aos="fade-right"
                data-aos-offset="200"
                data-aos-delay="50"
                data-aos-duration="1000"
                data-aos-easing="ease-in-out"
                data-aos-mirror="true"
                data-aos-once="true"
              >
                <p>Tell me some details so we can get started</p>
              </Flex>
              {/* form container  */}
              <Flex w="100%" justify="flex-end">
                {/* company box */}
                <Flex
                  w="459px"
                  h="700px"
                  px="6"
                  py="8"
                  border="1px solid #BBBDC6"
                  rounded="6px"
                  flexDir="column"
                  justify="space-evenly"
                  data-aos="fade-in"
                  data-aos-offset="200"
                  data-aos-delay="1000"
                  data-aos-duration="1500"
                  data-aos-easing="ease-in-out"
                  data-aos-mirror="true"
                  data-aos-once="true"
                  data-aos-anchor="Tag1"
                >
                  <FormLabel>1. Company name</FormLabel>
                  {loadingCompanies ? (
                    <>
                      <Flex justify="center" w="100%">
                        <CustomSpinner />
                      </Flex>
                    </>
                  ) : (
                    <>
                      {' '}
                      <Input
                        h="56px"
                        variant="filled"
                        rounded="6px"
                        textTransform="capitalize"
                        type="text"
                        label="company_name"
                        name="company_name"
                        list="company_name"
                        ref={register}
                        onChange={(e) => setSearchTerm(e.target.value)}
                      />
                      <datalist id="company_name">
                        {searchResults.map((company) => (
                          <option value={company.company_name} key={company.id}>
                            {company.company_name}
                          </option>
                        ))}
                      </datalist>
                      {noCompany ? (
                        <>
                          <Link mb="3" color="grey" href="/add-company">
                            Oops, you need to add that company!
                          </Link>
                        </>
                      ) : (
                        <Flex mb="6" />
                      )}
                    </>
                  )}
                  <FormLabel>2. Status at the company</FormLabel>
                  <Select
                    h="56px"
                    mb="6"
                    rounded="6px"
                    variant="filled"
                    label="work_status_id"
                    name="work_status_id"
                    placeholder="Select one"
                    ref={register}
                  >
                    <option value={1}>Current Employee</option>
                    <option value={2}>Former Employee</option>
                    <option value={3}>Full Time</option>
                    <option value={4}>Part Time</option>
                    <option value={5}>Intern</option>
                  </Select>
                  <FormLabel>3. Job Title</FormLabel>
                  <Input
                    h="56px"
                    mb="6"
                    variant="filled"
                    rounded="6px"
                    autoCapitalize="none"
                    type="text"
                    label="job_title"
                    name="job_title"
                    list="job_title"
                    ref={register}
                  />
                  <FormLabel>3. Location of company</FormLabel>
                  <CustomAutoComplete
                    stateHelper={stateSelectorHelper}
                    id="Company Headquarters"
                    name="Company Headquarters"
                    label="Company Headquarters"
                    placeholder="e.g. Los Angeles, CA"
                  />
                  <FormLabel mt="6">5. Length of position</FormLabel>
                  <Flex w="100%" justify="space-between">
                    <Input
                      type="number"
                      min="1970"
                      max="2030"
                      h="56px"
                      variant="filled"
                      rounded="6px"
                      w="45%"
                      mr="2%"
                      label="start_date"
                      name="start_date"
                      placeholder="YYYY"
                      ref={register}
                    />

                    <Input
                      h="56px"
                      variant="filled"
                      rounded="6px"
                      autoCapitalize="none"
                      type="number"
                      min="1970"
                      max="2030"
                      w="45%"
                      label="end_date"
                      name="end_date"
                      placeholder="YYYY"
                      ref={register}
                    />
                  </Flex>
                </Flex>
                {/* avatar */}
                <Flex
                  h="700px"
                  align="flex-end"
                  ml="1%"
                  data-aos="fade-in"
                  data-aos-offset="200"
                  data-aos-delay="1000"
                  data-aos-duration="1500"
                  data-aos-easing="ease-in-out"
                  data-aos-mirror="true"
                  data-aos-once="true"
                  data-aos-anchor="Tag1"
                >
                  <Avatar size="md" src="https://bit.ly/broken-link" />
                </Flex>
              </Flex>
              <Flex
                justify="flex-end"
                mb="5%"
                data-aos="fade-in"
                data-aos-offset="120"
                data-aos-delay="1000"
                data-aos-duration="1500"
                data-aos-easing="ease-in-out"
                data-aos-mirror="true"
                data-aos-once="true"
                data-aos-anchor="Tag1"
              >
                <Button
                  data-cy="companyReviewFormButton"
                  h="56px"
                  w="17%"
                  mt="2%"
                  rounded="35px"
                  border="1px solid #344CD0"
                  color="#344CD0"
                  backgroundColor="#FFF"
                  _hover={{ backgroundColor: '#F2F6FE', cursor: 'pointer' }}
                  onClick={time1}
                >
                  Next
                </Button>
              </Flex>
              {/* Second prompt */}
              {Tag2 ? (
                <>
                  <Flex
                    id="Tag2"
                    align="center"
                    p="1%"
                    mb="2%"
                    h="5%"
                    w="45%"
                    bg="#F2F6FE"
                    rounded="20px"
                    data-aos="fade-right"
                    data-aos-offset="200"
                    data-aos-delay="50"
                    data-aos-duration="1000"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                  >
                    <p>Thank you for that information.</p>
                  </Flex>
                  <Flex
                    id="Tag2"
                    align="center"
                    p="1%"
                    h="5%"
                    w="416px"
                    mb="8%"
                    bg="#F2F6FE"
                    rounded="20px"
                    data-aos="fade-right"
                    data-aos-offset="200"
                    data-aos-delay="800"
                    data-aos-duration="1000"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                  >
                    <p>
                      Please add some comments below. Helpful comments include
                      information about company culture, work environment,
                      career growth, salary, etc.
                    </p>
                  </Flex>
                  <Flex w="100%" justify="flex-end">
                    {/* long hand interview box */}
                    <Flex
                      w="459px"
                      h="350px"
                      px="6"
                      py="8"
                      border="1px solid #BBBDC6"
                      rounded="6px"
                      flexDir="column"
                      justify="space-evenly"
                      data-aos="fade-in"
                      data-aos-offset="120"
                      data-aos-delay="2400"
                      data-aos-duration="1500"
                      data-aos-easing="ease-in-out"
                      data-aos-mirror="true"
                      data-aos-once="true"
                      data-aos-anchor="Tag2"
                    >
                      <FormLabel>Comments</FormLabel>
                      <Textarea
                        variant="filled"
                        resize="none"
                        h="250px"
                        rowsMax={6}
                        type="text"
                        name="comment"
                        rounded="6px"
                        ref={register}
                        data-cy="companyComment"
                      />
                    </Flex>
                    {/* avatar */}
                    <Flex
                      h="350px"
                      align="flex-end"
                      ml="1%"
                      data-aos="fade-in"
                      data-aos-offset="120"
                      data-aos-delay="2400"
                      data-aos-duration="1500"
                      data-aos-easing="ease-in-out"
                      data-aos-mirror="true"
                      data-aos-once="true"
                      data-aos-anchor="Tag2"
                    >
                      <Avatar size="md" src="https://bit.ly/broken-link" />
                    </Flex>
                  </Flex>
                  <Flex
                    justify="flex-end"
                    mb="5%"
                    data-aos="fade-in"
                    data-aos-offset="120"
                    data-aos-delay="2400"
                    data-aos-duration="1500"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                    data-aos-anchor="Tag2"
                  >
                    <Button
                      data-cy="companyReviewFormButton"
                      h="56px"
                      w="17%"
                      mt="2%"
                      rounded="35px"
                      border="1px solid #344CD0"
                      color="#344CD0"
                      backgroundColor="#FFF"
                      _hover={{ backgroundColor: '#F2F6FE', cursor: 'pointer' }}
                      onClick={time2}
                    >
                      Next
                    </Button>
                  </Flex>
                </>
              ) : null}
              {/* 3rd prompt */}
              {Tag3 ? (
                <>
                  <Flex
                    id="Tag3"
                    align="center"
                    h="5%"
                    p="1%"
                    w="416px"
                    mb="2%"
                    bg="#F2F6FE"
                    rounded="20px"
                    data-aos="fade-right"
                    data-aos-offset="200"
                    data-aos-delay="50"
                    data-aos-duration="1000"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                  >
                    <p>Thank you for sharing that.</p>
                  </Flex>
                  <Flex
                    align="center"
                    h="5%"
                    p="1%"
                    w="416px"
                    mb="8%"
                    bg="#F2F6FE"
                    rounded="20px"
                    data-aos="fade-right"
                    data-aos-offset="200"
                    data-aos-delay="1500"
                    data-aos-duration="1000"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                  >
                    <p>
                      To better understand company culture, would you please add
                      a few more details?
                    </p>
                  </Flex>
                  {/* hours container  */}
                  <Flex w="100%" justify="flex-end">
                    {/* hours box */}
                    <Flex
                      w="459px"
                      h="136px"
                      p="6"
                      border="1px solid #BBBDC6"
                      rounded="6px"
                      flexDir="column"
                      data-aos="fade-in"
                      data-aos-offset="120"
                      data-aos-delay="2800"
                      data-aos-duration="1500"
                      data-aos-easing="ease-in-out"
                      data-aos-mirror="true"
                      data-aos-once="true"
                      data-aos-anchor="Tag3"
                    >
                      <FormLabel>Working hours</FormLabel>
                      <Select
                        h="56px"
                        rounded="6px"
                        variant="filled"
                        label="typical_hours"
                        name="typical_hours"
                        placeholder="Select one"
                        ref={register}
                      >
                        <option value={29}>Less than 30 hours</option>
                        <option value={30}>30 hours+</option>
                        <option value={40}>40 hours+</option>
                        <option value={50}>50 hours+</option>
                        <option value={60}>60 hours+</option>
                      </Select>
                    </Flex>
                    {/* avatar */}
                    <Flex
                      h="136px"
                      align="flex-end"
                      ml="1%"
                      data-aos="fade-in"
                      data-aos-offset="200"
                      data-aos-delay="2800"
                      data-aos-duration="1500"
                      data-aos-easing="ease-in-out"
                      data-aos-mirror="true"
                      data-aos-once="true"
                      data-aos-anchor="Tag3"
                    >
                      <Avatar size="md" src="https://bit.ly/broken-link" />
                    </Flex>
                  </Flex>
                  <Flex
                    justify="flex-end"
                    mb="5%"
                    data-aos="fade-in"
                    data-aos-offset="120"
                    data-aos-delay="2800"
                    data-aos-duration="1500"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                    data-aos-anchor="Tag3"
                  >
                    <Button
                      data-cy="companyReviewFormButton"
                      h="56px"
                      w="17%"
                      mt="2%"
                      rounded="35px"
                      border="1px solid #344CD0"
                      color="#344CD0"
                      backgroundColor="#FFF"
                      _hover={{ backgroundColor: '#F2F6FE', cursor: 'pointer' }}
                      onClick={time3}
                    >
                      Next
                    </Button>
                  </Flex>
                </>
              ) : null}
              {/* 4th prompt */}
              {Tag4 ? (
                <>
                  <Flex
                    id="Tag4"
                    align="center"
                    h="5%"
                    p="1%"
                    w="416px"
                    mb="8%"
                    bg="#F2F6FE"
                    rounded="20px"
                    data-aos="fade-right"
                    data-aos-offset="200"
                    data-aos-delay="50"
                    data-aos-duration="1000"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                  >
                    <p>
                      Posting your hiring salary helps many job-seekers
                      negotiate fair salaries.
                    </p>
                  </Flex>
                  {/* salary container  */}
                  <Flex w="100%" justify="flex-end">
                    {/* salary box */}
                    <Flex
                      w="459px"
                      h="150px"
                      p="6"
                      border="1px solid #BBBDC6"
                      rounded="6px"
                      flexDir="column"
                      justify="space-evenly"
                      data-aos="fade-in"
                      data-aos-offset="120"
                      data-aos-delay="1000"
                      data-aos-duration="1500"
                      data-aos-easing="ease-in-out"
                      data-aos-mirror="true"
                      data-aos-once="true"
                      data-aos-anchor="Tag4"
                    >
                      <FormLabel>Hiring salary</FormLabel>
                      <InputGroup>
                        <InputLeftElement
                          mb="4"
                          py="28px"
                          color="gray.300"
                          fontSize="1.2em"
                          children="$"
                        />
                        <Input
                          h="56px"
                          mb="6"
                          variant="filled"
                          rounded="6px"
                          autoCapitalize="none"
                          type="number"
                          label="salary"
                          name="salary"
                          ref={register}
                        />
                      </InputGroup>
                    </Flex>
                    {/* avatar */}
                    <Flex
                      h="150px"
                      align="flex-end"
                      ml="1%"
                      data-aos="fade-in"
                      data-aos-offset="200"
                      data-aos-delay="1000"
                      data-aos-duration="1500"
                      data-aos-easing="ease-in-out"
                      data-aos-mirror="true"
                      data-aos-once="true"
                      data-aos-anchor="Tag4"
                    >
                      <Avatar size="md" src="https://bit.ly/broken-link" />
                    </Flex>
                  </Flex>
                  <Flex
                    justify="flex-end"
                    mb="5%"
                    data-aos="fade-in"
                    data-aos-offset="120"
                    data-aos-delay="1000"
                    data-aos-duration="1500"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                    data-aos-anchor="Tag4"
                  >
                    <Button
                      data-cy="companyReviewFormButton"
                      h="56px"
                      w="17%"
                      mt="2%"
                      rounded="35px"
                      border="1px solid #344CD0"
                      color="#344CD0"
                      backgroundColor="#FFF"
                      _hover={{ backgroundColor: '#F2F6FE', cursor: 'pointer' }}
                      onClick={time4}
                    >
                      Next
                    </Button>
                  </Flex>
                </>
              ) : null}
              {/* 5th prompt */}
              {Tag5 ? (
                <>
                  <Flex
                    id="Tag5"
                    align="center"
                    h="5%"
                    w="416px"
                    p="1%"
                    mb="2%"
                    bg="#F2F6FE"
                    rounded="20px"
                    data-aos="fade-right"
                    data-aos-offset="200"
                    data-aos-delay="50"
                    data-aos-duration="1000"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                  >
                    <p>Awesome! Thank you for sharing that.</p>
                  </Flex>
                  <Flex
                    align="center"
                    p="1%"
                    h="5%"
                    w="416px"
                    mb="8%"
                    bg="#F2F6FE"
                    rounded="20px"
                    data-aos="fade-right"
                    data-aos-offset="200"
                    data-aos-delay="1000"
                    data-aos-duration="1000"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                  >
                    <p>One last question.</p>
                  </Flex>
                  {/* overall container  */}
                  <Flex w="100%" justify="flex-end">
                    {/* overall box */}
                    <Flex
                      w="459px"
                      h="136px"
                      mb="8%"
                      p="6"
                      border="1px solid #BBBDC6"
                      rounded="6px"
                      flexDir="column"
                      data-aos="fade-in"
                      data-aos-offset="200"
                      data-aos-delay="1500"
                      data-aos-duration="1500"
                      data-aos-easing="ease-in-out"
                      data-aos-mirror="true"
                      data-aos-once="true"
                    >
                      <FormLabel mb="4">
                        Please rate your overall experience.
                      </FormLabel>
                      <Flex justify="center" w="100%">
                        <BeautyStars
                          name="companyOverall"
                          value={starState}
                          activeColor="#344CD0"
                          onChange={(value) => {
                            setStarState(value)
                            time5()
                          }}
                        />
                      </Flex>
                    </Flex>
                    {/* avatar */}
                    <Flex
                      h="136px"
                      align="flex-end"
                      ml="1%"
                      data-aos="fade-in"
                      data-aos-offset="200"
                      data-aos-delay="1500"
                      data-aos-duration="1500"
                      data-aos-easing="ease-in-out"
                      data-aos-mirror="true"
                      data-aos-once="true"
                      data-aos-anchor="Tag5"
                    >
                      <Avatar size="md" src="https://bit.ly/broken-link" />
                    </Flex>
                  </Flex>
                </>
              ) : null}
              {/* 6th prompt */}
              {Tag6 ? (
                <>
                  <Flex
                    id="Tag6"
                    align="center"
                    p="1%"
                    h="5%"
                    w="416px"
                    mb="8%"
                    bg="#F2F6FE"
                    rounded="20px"
                    data-aos="fade-right"
                    data-aos-offset="200"
                    data-aos-delay="50"
                    data-aos-duration="1000"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                    data-aos-anchor="#ratingTag"
                  >
                    <p>Thank you! Don’t forget to hit submit. </p>
                  </Flex>
                  {/* submit container  */}
                  <Flex w="100%" justify="flex-end">
                    {/* submit box */}
                    <Flex
                      w="459px"
                      h="136px"
                      mb="8%"
                      p="6"
                      justify="center"
                      align="center"
                      border="1px solid #BBBDC6"
                      rounded="6px"
                      flexDir="column"
                      data-aos="fade-in"
                      data-aos-offset="200"
                      data-aos-delay="1500"
                      data-aos-duration="1000"
                      data-aos-easing="ease-in-out"
                      data-aos-mirror="true"
                      data-aos-once="true"
                    >
                      <Button
                        bg="#344CD0"
                        color="white"
                        type="submit"
                        isLoading={formState.isSubmitting}
                        rounded="6px"
                        border="none"
                        data-cy="companyReviewSubmit"
                      >
                        Submit
                      </Button>
                    </Flex>
                    {/* avatar */}
                    <Flex
                      h="136px"
                      align="flex-end"
                      ml="1%"
                      data-aos="fade-in"
                      data-aos-offset="200"
                      data-aos-delay="1500"
                      data-aos-duration="1000"
                      data-aos-easing="ease-in-out"
                      data-aos-mirror="true"
                      data-aos-once="true"
                    >
                      <Avatar size="md" src="https://bit.ly/broken-link" />
                    </Flex>
                  </Flex>
                </>
              ) : null}
            </FormControl>
          </form>
        </Flex>
      </Flex>
    </>
  )
}
Example #10
Source File: InterviewForm.js    From allay-fe with MIT License 4 votes vote down vote up
InterviewForm = ({
  loadingCompanies,
  getCompanies,
  companies,
  postReview,
  history,
}) => {
  //initialize animations
  AOS.init()
  const { register, handleSubmit, formState } = useForm()

  // state "state"
  const [location, setLocation] = useState({})
  const [newLocation, setNewLocation] = useState({})
  const stateSelectorHelper = (value) => {
    setLocation(value)
  }

  // thinking state
  const [thinking, setThinking] = useState(false)
  const dots = () => {
    setThinking(true)
  }

  // search state
  const [searchTerm, setSearchTerm] = useState('')
  const [searchResults, setSearchResults] = useState([])

  // no company state
  const [noCompany, setNoCompany] = useState(false)

  // star rating
  const [starState, setStarState] = useState(0)

  // custom radio button state offer status
  const [offer, setOffer] = useState(1)

  //progress bar
  const [progress, setProgress] = useState({
    prec: 99,
    time: 8,
    prog: 2,
  })
  // company search function

  useEffect(() => {
    if (searchTerm.length >= 3) {
      const results = companies.filter((company) =>
        company.company_name.toLowerCase().startsWith(searchTerm.toLowerCase())
      )
      setSearchResults(results)
      if (results.length === 0) {
        setNoCompany(true)
      } else {
        setNoCompany(false)
      }
    }
  }, [searchTerm, companies])

  // state confirmation search function
  useEffect(() => {
    if (location.myState) {
      const stateId = states.filter((i) =>
        i.state_name.toLowerCase().startsWith(location.myState.toLowerCase())
      )
      setNewLocation({ ...location, myState: stateId[0].id })
    }
  }, [location])

  // state for visibility
  const [Tag2, setTag2] = useState(false)
  const [Tag3, setTag3] = useState(false)
  const [Tag4, setTag4] = useState(false)
  const [Tag5, setTag5] = useState(false)
  const [Tag6, setTag6] = useState(false)
  const [Tag7, setTag7] = useState(false)
  const [Tag8, setTag8] = useState(false)
  const [Tag9, setTag9] = useState(false)

  // brings to top on render
  useEffect(() => {
    getCompanies()
    setProgress({
      prec: 95,
      time: 7,
      prog: 5,
    })
    const element = document.getElementById('Tag1')
    element.scrollIntoView({
      behavior: 'smooth',
      block: 'start',
    })
  }, [getCompanies])

  // timers for moves
  let timer = null
  let dotTimer = null

  // 2nd tag
  const time1 = () => {
    clearTimeout(timer)
    clearTimeout(dotTimer)
    dotTimer = setTimeout(dots, 300)
    timer = setTimeout(routeTo2, 1000)
  }
  const routeTo2 = () => {
    setTag2(true)
    setProgress({
      prec: 80,
      time: 6,
      prog: 20,
    })
    const element = document.getElementById('Tag2')
    element.scrollIntoView({
      behavior: 'smooth',
      block: 'start',
    })
    setThinking(false)
  }

  // 3rd tag
  const time2 = () => {
    clearTimeout(timer)
    clearTimeout(dotTimer)
    dotTimer = setTimeout(dots, 300)
    timer = setTimeout(routeTo3, 1000)
  }

  const routeTo3 = () => {
    setTag3(true)
    setProgress({
      prec: 70,
      time: 5,
      prog: 30,
    })
    const element = document.getElementById('Tag3')
    element.scrollIntoView({
      behavior: 'smooth',
      block: 'center',
    })
    setThinking(false)
  }

  //4th tag
  const time3 = () => {
    clearTimeout(timer)
    clearTimeout(dotTimer)
    dotTimer = setTimeout(dots, 300)
    timer = setTimeout(routeTo4, 1000)
  }

  const routeTo4 = () => {
    setTag4(true)
    setProgress({
      prec: 60,
      time: 4,
      prog: 40,
    })
    const element = document.getElementById('Tag4')
    element.scrollIntoView({
      behavior: 'smooth',
      block: 'start',
    })
    setThinking(false)
  }

  // 5th tag
  const time4 = () => {
    clearTimeout(timer)
    clearTimeout(dotTimer)
    dotTimer = setTimeout(dots, 300)
    timer = setTimeout(routeTo5, 1000)
  }

  const routeTo5 = () => {
    setTag5(true)
    setProgress({
      prec: 50,
      time: 3,
      prog: 50,
    })
    const element = document.getElementById('Tag5')
    element.scrollIntoView({
      behavior: 'smooth',
      block: 'center',
    })
    setThinking(false)
  }

  // 6th tag
  const time5 = () => {
    clearTimeout(timer)
    clearTimeout(dotTimer)
    dotTimer = setTimeout(dots, 300)
    timer = setTimeout(routeTo6, 1000)
  }
  const routeTo6 = () => {
    setTag6(true)
    setProgress({
      prec: 40,
      time: 2,
      prog: 60,
    })
    const element = document.getElementById('Tag6')
    element.scrollIntoView({
      behavior: 'smooth',
      block: 'center',
    })
    setThinking(false)
  }

  // 7th tag
  const time6 = () => {
    clearTimeout(timer)
    clearTimeout(dotTimer)
    dotTimer = setTimeout(dots, 300)
    timer = setTimeout(routeTo7, 1000)
  }
  const routeTo7 = () => {
    setTag7(true)
    setProgress({
      prec: 30,
      time: 1,
      prog: 70,
    })
    const element = document.getElementById('Tag7')
    element.scrollIntoView({
      behavior: 'smooth',
      block: 'center',
    })
    setThinking(false)
  }

  // 8th tag
  const time7 = () => {
    clearTimeout(timer)
    clearTimeout(dotTimer)
    dotTimer = setTimeout(dots, 300)
    timer = setTimeout(routeTo8, 1000)
  }
  const routeTo8 = () => {
    setTag8(true)
    setProgress({
      prec: 20,
      time: 1,
      prog: 85,
    })
    const element = document.getElementById('Tag8')
    element.scrollIntoView({
      behavior: 'smooth',
      block: 'center',
    })
    setThinking(false)
  }

  // 9th tag
  const time8 = () => {
    clearTimeout(timer)
    clearTimeout(dotTimer)
    dotTimer = setTimeout(dots, 300)
    timer = setTimeout(routeTo9, 1000)
  }
  const routeTo9 = () => {
    setTag9(true)
    setProgress({
      prec: 100,
      time: 0,
      prog: 100,
    })
    const element = document.getElementById('Tag9')
    element.scrollIntoView({
      behavior: 'smooth',
      block: 'start',
    })
    setThinking(false)
  }

  // custom select for offer accepted
  const CustomRadio = React.forwardRef((props, ref) => {
    const { isChecked, isDisabled, value, ...rest } = props
    return (
      <Button
        ref={ref}
        variantColor={isChecked ? 'blue' : 'gray'}
        aria-checked={isChecked}
        role="radio"
        isDisabled={isDisabled}
        {...rest}
      />
    )
  })
  //push to dashboard and send info to DS for review
  const sendInfoToDS = (data) => {
    var dataForDS = JSON.stringify(data)
    axiosToDS()
      .post('/check_review', dataForDS)
      .then((res) => {
        console.log(res)
      })
      .catch((err) => {
        console.log(err)
      })
    history.push('/dashboard')
  }

  //submit handler
  const submitForm = (data) => {
    postReview(localStorage.getItem('userId'), {
      ...data,
      review_type_id: 2,
      overall_rating: starState,
      offer_status_id: offer,
      city: newLocation.myCity,
      state_id: newLocation.myState,
    }).then(() => sendInfoToDS(data))
    ReactGA.event({
      category: 'Review',
      action: `Submit review`,
    })
  }

  return (
    // main container
    <div>
      <Flex justify="center">
        <ProgressHeader progress={progress} />
      </Flex>
      <Flex w="100%" margin="0 auto" minH="100vh">
        {thinking ? (
          <>
            <Flex
              bottom="0"
              position="fixed"
              overflow="hidden"
              zIndex="999"
              pt="5%"
              pl="15%"
            >
              <ThinkingDots />
            </Flex>
          </>
        ) : null}

        {/* form container */}
        <Flex
          w="100%"
          bg="#FFF"
          flexDir="column"
          px="2%"
          pt="10%"
          margin="0 auto"
        >
          {/*--------------- start of form ---------------  */}
          <form onSubmit={handleSubmit(submitForm)}>
            <FormControl isRequired>
              {/* first prompt */}
              <Flex
                id="Tag1"
                align="center"
                h="5%"
                p="1%"
                w="416px"
                mb="8%"
                bg="#F2F6FE"
                rounded="20px"
                data-aos="fade-up"
                data-aos-offset="200"
                data-aos-delay="50"
                data-aos-duration="1000"
                data-aos-easing="ease-in-out"
                data-aos-mirror="true"
                data-aos-once="true"
              >
                <p>Great! I will need some general details to get started.</p>
              </Flex>
              {/* company container  */}
              <Flex w="100%" justify="flex-end">
                {/* company box */}
                <Flex
                  w="459px"
                  h="379px"
                  px="6"
                  py="10"
                  border="1px solid #BBBDC6"
                  rounded="6px"
                  flexDir="column"
                  data-aos="fade-in"
                  data-aos-offset="200"
                  data-aos-delay="1000"
                  data-aos-duration="1500"
                  data-aos-easing="ease-in-out"
                  data-aos-mirror="true"
                  data-aos-once="true"
                  data-aos-anchor="Tag1"
                >
                  <FormLabel>1. Company name</FormLabel>
                  {loadingCompanies ? (
                    <>
                      <Flex justify="center" w="100%">
                        <CustomSpinner />
                      </Flex>
                    </>
                  ) : (
                    <>
                      <Input
                        h="56px"
                        variant="filled"
                        rounded="6px"
                        textTransform="capitalize"
                        type="text"
                        label="company_name"
                        name="company_name"
                        list="company_name"
                        ref={register}
                        onChange={(e) => setSearchTerm(e.target.value)}
                      />
                      <datalist id="company_name">
                        {searchResults.map((company) => (
                          <option value={company.company_name} key={company.id}>
                            {company.company_name}
                          </option>
                        ))}
                      </datalist>
                      {noCompany ? (
                        <>
                          <Link mb="3" color="grey" href="/add-company">
                            Oops, you need to add that company!
                          </Link>
                        </>
                      ) : (
                        <Flex mb="6" />
                      )}
                    </>
                  )}
                  <FormLabel>2. Job title</FormLabel>
                  <Input
                    h="56px"
                    mb="6"
                    rounded="6px"
                    type="text"
                    variant="filled"
                    label="job_title"
                    name="job_title"
                    autoCapitalize="none"
                    ref={register}
                  />
                  <FormLabel>3. Place of interview</FormLabel>
                  <CustomAutoComplete
                    stateHelper={stateSelectorHelper}
                    id="Company Headquarters"
                    name="Company Headquarters"
                    label="Company Headquarters"
                    placeholder="e.g. Los Angeles, CA"
                    textTransform="capitalize"
                    h="56px"
                    mb="6"
                  />
                </Flex>

                {/* avatar */}
                <Flex
                  h="379px"
                  mt="5px"
                  align="flex-end"
                  ml="1%"
                  data-aos="fade-in"
                  data-aos-offset="200"
                  data-aos-delay="1000"
                  data-aos-duration="1500"
                  data-aos-easing="ease-in-out"
                  data-aos-mirror="true"
                  data-aos-once="true"
                  data-aos-anchor="Tag1"
                >
                  <Avatar size="md" src="https://bit.ly/broken-link" />
                </Flex>
              </Flex>
              <Flex
                justify="flex-end"
                mb="5%"
                data-aos="fade-in"
                data-aos-offset="200"
                data-aos-delay="1000"
                data-aos-duration="1500"
                data-aos-easing="ease-in-out"
                data-aos-mirror="true"
                data-aos-once="true"
                data-aos-anchor="Tag1"
              >
                <Button
                  data-cy="interviewReviewFormButton"
                  h="56px"
                  w="17%"
                  mt="2%"
                  rounded="35px"
                  border="1px solid #344CD0"
                  color="#344CD0"
                  backgroundColor="#FFF"
                  _hover={{ backgroundColor: '#F2F6FE', cursor: 'pointer' }}
                  onClick={time1}
                >
                  Next
                </Button>
              </Flex>

              {/* second prompt */}
              {Tag2 ? (
                <>
                  <Flex
                    id="Tag2"
                    align="center"
                    h="5%"
                    w="416px"
                    py="1%"
                    px="1%"
                    mb="2%"
                    bg="#F2F6FE"
                    rounded="20px"
                    data-aos="fade-right"
                    data-aos-offset="200"
                    data-aos-delay="50"
                    data-aos-duration="1000"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                  >
                    <p>Thank you for that information.</p>
                  </Flex>
                  <Flex
                    id="roundsTag"
                    justify="center"
                    align="center"
                    p="1%"
                    h="5%"
                    w="416px"
                    mb="8%"
                    bg="#F2F6FE"
                    rounded="20px"
                    data-aos="fade-right"
                    data-aos-offset="200"
                    data-aos-delay="1000"
                    data-aos-duration="1000"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                  >
                    <p>
                      For the quality of this review I will ask some in depth
                      questions. Let’s begin with how many rounds of interviews
                      you had? Please include phone interviews and onsite
                      interviews.
                    </p>
                  </Flex>
                  {/* rounds container  */}
                  <Flex w="100%" justify="flex-end">
                    {/* rounds box */}
                    <Flex
                      w="459px"
                      h="150px"
                      p="6"
                      border="1px solid #BBBDC6"
                      rounded="6px"
                      flexDir="column"
                      justify="space-evenly"
                      data-aos="fade-in"
                      data-aos-offset="120"
                      data-aos-delay="2000"
                      data-aos-duration="1500"
                      data-aos-easing="ease-in-out"
                      data-aos-mirror="true"
                      data-aos-once="true"
                      data-aos-anchor="roundsTag"
                    >
                      <FormLabel>Select rounds of interviews</FormLabel>
                      <Select
                        h="56px"
                        mb="6"
                        rounded="6px"
                        variant="filled"
                        label="interview_rounds"
                        name="interview_rounds"
                        placeholder="Select one"
                      >
                        <option value={1}>1</option>
                        <option value={2}>2</option>
                        <option value={3}>3</option>
                        <option value={4}>4</option>
                        <option value={5}>5</option>
                        <option value={6}>6</option>
                        <option value={7}>7</option>
                        <option value={8}>8</option>
                        <option value={9}>9</option>
                        <option value={10}>10</option>
                      </Select>
                    </Flex>
                    {/* avatar */}
                    <Flex
                      h="150px"
                      align="flex-end"
                      ml="1%"
                      data-aos="fade-in"
                      data-aos-offset="200"
                      data-aos-delay="2000"
                      data-aos-duration="1500"
                      data-aos-easing="ease-in-out"
                      data-aos-mirror="true"
                      data-aos-once="true"
                      data-aos-anchor="roundsTag"
                    >
                      <Avatar size="md" src="https://bit.ly/broken-link" />
                    </Flex>
                  </Flex>
                  <Flex
                    justify="flex-end"
                    mb="5%"
                    data-aos="fade-in"
                    data-aos-offset="200"
                    data-aos-delay="2000"
                    data-aos-duration="1500"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                    data-aos-anchor="roundsTag"
                  >
                    <Button
                      data-cy="interviewReviewFormButton"
                      h="56px"
                      w="17%"
                      mt="2%"
                      rounded="35px"
                      border="1px solid #344CD0"
                      color="#344CD0"
                      backgroundColor="#FFF"
                      _hover={{ backgroundColor: '#F2F6FE', cursor: 'pointer' }}
                      onClick={time2}
                    >
                      Next
                    </Button>
                  </Flex>
                </>
              ) : null}
              {/* third prompt */}
              {Tag3 ? (
                <>
                  <Flex
                    id="Tag3"
                    align="center"
                    p="1%"
                    h="5%"
                    w="416px"
                    mb="8%"
                    bg="#F2F6FE"
                    rounded="20px"
                    data-aos="fade-right"
                    data-aos-offset="200"
                    data-aos-delay="50"
                    data-aos-duration="1000"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                  >
                    <p>
                      To better assist you I have included several different
                      interview types to choose from. Please select all types
                      that best describes the interview process you went
                      through.
                    </p>
                  </Flex>
                  <Flex w="100%" justify="flex-end">
                    {/* types of interview box */}
                    <Flex
                      w="459px"
                      h="220px"
                      px="6"
                      py="8"
                      border="1px solid #BBBDC6"
                      rounded="6px"
                      flexDir="column"
                      justify="space-evenly"
                      data-aos="fade-in"
                      data-aos-offset="120"
                      data-aos-delay="1000"
                      data-aos-duration="1500"
                      data-aos-easing="ease-in-out"
                      data-aos-mirror="true"
                      data-aos-once="true"
                      data-aos-anchor="Tag3"
                    >
                      <FormLabel>Select types of interviews</FormLabel>
                      <CheckboxGroup>
                        <Flex>
                          <Flex direction="column" pr="0.5%">
                            <Checkbox
                              size="md"
                              border="rgba(72, 72, 72, 0.1)"
                              name="phone_interview"
                              ref={register}
                            >
                              Phone interview
                            </Checkbox>
                            <Checkbox
                              size="md"
                              border="rgba(72, 72, 72, 0.1)"
                              name="resume_review"
                              ref={register}
                            >
                              Resume review
                            </Checkbox>
                            <Checkbox
                              size="md"
                              border="rgba(72, 72, 72, 0.1)"
                              name="take_home_assignments"
                              ref={register}
                            >
                              Take home assignments
                            </Checkbox>
                            <Checkbox
                              size="md"
                              border="rgba(72, 72, 72, 0.1)"
                              name="online_coding_assignments"
                              ref={register}
                            >
                              Online coding tests
                            </Checkbox>
                          </Flex>
                          <Flex direction="column">
                            <Checkbox
                              size="md"
                              border="rgba(72, 72, 72, 0.1)"
                              name="portfolio_review"
                              ref={register}
                            >
                              Portfolio review
                            </Checkbox>
                            <Checkbox
                              size="md"
                              border="rgba(72, 72, 72, 0.1)"
                              name="screen_share"
                              ref={register}
                            >
                              Screen share
                            </Checkbox>
                            <Checkbox
                              size="md"
                              border="rgba(72, 72, 72, 0.1)"
                              name="open_source_contribution"
                              ref={register}
                            >
                              Open source contribution
                            </Checkbox>
                            <Checkbox
                              size="md"
                              border="rgba(72, 72, 72, 0.1)"
                              name="side_projects"
                              ref={register}
                            >
                              Side projects
                            </Checkbox>
                          </Flex>
                        </Flex>
                      </CheckboxGroup>
                    </Flex>
                    {/* avatar */}
                    <Flex
                      h="220px"
                      align="flex-end"
                      ml="1%"
                      data-aos="fade-in"
                      data-aos-offset="120"
                      data-aos-delay="0"
                      data-aos-duration="1500"
                      data-aos-easing="ease-in-out"
                      data-aos-mirror="true"
                      data-aos-once="true"
                      id="Tag3"
                    >
                      <Avatar size="md" src="https://bit.ly/broken-link" />
                    </Flex>
                  </Flex>
                  <Flex
                    justify="flex-end"
                    mb="5%"
                    data-aos="fade-in"
                    data-aos-offset="120"
                    data-aos-delay="0"
                    data-aos-duration="1500"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                    id="Tag3"
                  >
                    <Button
                      data-cy="interviewReviewFormButton"
                      h="56px"
                      w="17%"
                      mt="2%"
                      rounded="35px"
                      border="1px solid #344CD0"
                      color="#344CD0"
                      backgroundColor="#FFF"
                      _hover={{ backgroundColor: '#F2F6FE', cursor: 'pointer' }}
                      onClick={time3}
                    >
                      Next
                    </Button>
                  </Flex>
                </>
              ) : null}
              {/* fourth prompt */}
              {Tag4 ? (
                <>
                  <Flex
                    id="Tag4"
                    align="center"
                    p="1%"
                    mb="2%"
                    h="5%"
                    w="416px"
                    bg="#F2F6FE"
                    rounded="20px"
                    data-aos="fade-right"
                    data-aos-offset="200"
                    data-aos-delay="50"
                    data-aos-duration="1000"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                  >
                    <p>Great!</p>
                  </Flex>
                  <Flex
                    align="center"
                    p="1%"
                    h="5%"
                    w="416px"
                    mb="8%"
                    bg="#F2F6FE"
                    rounded="20px"
                    data-aos="fade-right"
                    data-aos-offset="200"
                    data-aos-delay="1200"
                    data-aos-duration="1000"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                  >
                    <p>
                      Use this section to describe your interview experience
                      using the options selected above for reference.
                    </p>
                  </Flex>
                  <Flex w="100%" justify="flex-end">
                    {/* long hand interview box */}
                    <Flex
                      w="459px"
                      h="242px"
                      px="6"
                      py="8"
                      border="1px solid #BBBDC6"
                      rounded="6px"
                      flexDir="column"
                      justify="space-evenly"
                      data-aos="fade-in"
                      data-aos-offset="120"
                      data-aos-delay="2600"
                      data-aos-duration="1500"
                      data-aos-easing="ease-in-out"
                      data-aos-mirror="true"
                      data-aos-once="true"
                      data-aos-anchor="Tag4"
                    >
                      <FormLabel>Describe the interview process</FormLabel>
                      <Textarea
                        variant="filled"
                        h="144px"
                        rowsMax={6}
                        type="text"
                        name="comment"
                        placeholder="What questions came up? What did you discuss? What did you come away with from this interview? "
                        rounded="6px"
                        resize="none"
                        ref={register}
                        data-cy="interviewComment"
                      />
                    </Flex>
                    {/* avatar */}
                    <Flex
                      h="242px"
                      align="flex-end"
                      ml="1%"
                      data-aos="fade-in"
                      data-aos-offset="120"
                      data-aos-delay="2600"
                      data-aos-duration="1500"
                      data-aos-easing="ease-in-out"
                      data-aos-mirror="true"
                      data-aos-once="true"
                      data-aos-anchor="Tag4"
                    >
                      <Avatar size="md" src="https://bit.ly/broken-link" />
                    </Flex>
                  </Flex>
                  <Flex
                    justify="flex-end"
                    mb="5%"
                    data-aos="fade-in"
                    data-aos-offset="120"
                    data-aos-delay="2600"
                    data-aos-duration="1500"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                    data-aos-anchor="Tag4"
                  >
                    <Button
                      data-cy="interviewReviewFormButton"
                      h="56px"
                      w="17%"
                      mt="2%"
                      rounded="35px"
                      border="1px solid #344CD0"
                      color="#344CD0"
                      backgroundColor="#FFF"
                      _hover={{ backgroundColor: '#F2F6FE', cursor: 'pointer' }}
                      onClick={time4}
                    >
                      Next
                    </Button>
                  </Flex>
                </>
              ) : null}
              {/* 5th prompt */}
              {Tag5 ? (
                <>
                  <Flex
                    align="center"
                    h="5%"
                    p="1%"
                    w="416px"
                    mb="2%"
                    bg="#F2F6FE"
                    rounded="20px"
                    data-aos="fade-right"
                    data-aos-offset="200"
                    data-aos-delay="50"
                    data-aos-duration="1000"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                  >
                    <p>
                      Thanks! Your opinion is very valuable and helps Lambda
                      job-seekers be better prepared.
                    </p>
                  </Flex>
                  <Flex
                    id="Tag5"
                    align="center"
                    h="5%"
                    p="1%"
                    w="416px"
                    mb="8%"
                    bg="#F2F6FE"
                    rounded="20px"
                    data-aos="fade-right"
                    data-aos-offset="200"
                    data-aos-delay="1000"
                    data-aos-duration="1000"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                  >
                    <p>
                      Please provide a difficulty rating for your interview. How
                      easy or hard was the interview?
                    </p>
                  </Flex>
                  {/* diff container  */}
                  <Flex w="100%" justify="flex-end">
                    {/* diff box */}
                    <Flex
                      w="459px"
                      h="150px"
                      p="6"
                      border="1px solid #BBBDC6"
                      rounded="6px"
                      flexDir="column"
                      justify="space-evenly"
                      data-aos="fade-in"
                      data-aos-offset="120"
                      data-aos-delay="3000"
                      data-aos-duration="1500"
                      data-aos-easing="ease-in-out"
                      data-aos-mirror="true"
                      data-aos-once="true"
                      data-aos-anchor="Tag5"
                    >
                      <FormLabel>Rate the difficulty</FormLabel>
                      <Select
                        h="56px"
                        mb="6"
                        rounded="6px"
                        variant="filled"
                        label="difficulty_rating"
                        name="difficulty_rating"
                        placeholder="Select one"
                        ref={register}
                      >
                        <option value={5}>Very difficult</option>
                        <option value={4}>Difficult</option>
                        <option value={3}>Average</option>
                        <option value={2}>Easy</option>
                        <option value={1}>Very easy</option>
                      </Select>
                    </Flex>
                    {/* avatar */}
                    <Flex
                      h="150px"
                      align="flex-end"
                      ml="1%"
                      data-aos="fade-in"
                      data-aos-offset="200"
                      data-aos-delay="3000"
                      data-aos-duration="1500"
                      data-aos-easing="ease-in-out"
                      data-aos-mirror="true"
                      data-aos-once="true"
                      data-aos-anchor="Tag5"
                    >
                      <Avatar size="md" src="https://bit.ly/broken-link" />
                    </Flex>
                  </Flex>
                  <Flex
                    justify="flex-end"
                    mb="8%"
                    data-aos="fade-in"
                    data-aos-offset="200"
                    data-aos-delay="2700"
                    data-aos-duration="1500"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                    data-aos-anchor="Tag5"
                  >
                    <Button
                      data-cy="interviewReviewFormButton"
                      h="56px"
                      w="17%"
                      mt="2%"
                      rounded="35px"
                      border="1px solid #344CD0"
                      color="#344CD0"
                      backgroundColor="#FFF"
                      _hover={{ backgroundColor: '#F2F6FE', cursor: 'pointer' }}
                      onClick={time5}
                    >
                      Next
                    </Button>
                  </Flex>
                </>
              ) : null}
              {/* 6th prompt */}
              {Tag6 ? (
                <>
                  <Flex
                    id="Tag6"
                    justify="center"
                    align="center"
                    p="1%"
                    h="5%"
                    w="416px"
                    mb="8%"
                    bg="#F2F6FE"
                    rounded="20px"
                    data-aos="fade-right"
                    data-aos-offset="200"
                    data-aos-delay="50"
                    data-aos-duration="1000"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                  >
                    <p>
                      Your review is almost complete. Tell me how your interview
                      process ended. Did you recieve an offer?
                    </p>
                  </Flex>
                  {/* offer container  */}
                  <Flex w="100%" justify="flex-end">
                    {/* diff box */}
                    <Flex
                      w="459px"
                      h="176px"
                      mb="8%"
                      py="6"
                      border="1px solid #BBBDC6"
                      rounded="6px"
                      flexDir="column"
                      data-aos="fade-in"
                      data-aos-offset="200"
                      data-aos-delay="1000"
                      data-aos-duration="1500"
                      data-aos-easing="ease-in-out"
                      data-aos-mirror="true"
                      data-aos-once="true"
                    >
                      <Flex w="100%" justify="center">
                        <RadioButtonGroup
                          display="flex"
                          flexDir="column"
                          spacing={0}
                          label="offer_status_id"
                          name="offer_status_id"
                          defaultValue="1"
                          onChange={(val) => {
                            setOffer(val)
                            time6()
                          }}
                        >
                          <CustomRadio value="1" w="100%">
                            No offer
                          </CustomRadio>
                          <CustomRadio value="2" w="100%" data-cy="accepted">
                            Accepted
                          </CustomRadio>
                          <CustomRadio value="3" w="100%">
                            Declined
                          </CustomRadio>
                        </RadioButtonGroup>
                      </Flex>
                    </Flex>
                    {/* avatar */}
                    <Flex
                      h="176px"
                      align="flex-end"
                      ml="1%"
                      data-aos="fade-in"
                      data-aos-offset="200"
                      data-aos-delay="1000"
                      data-aos-duration="1500"
                      data-aos-easing="ease-in-out"
                      data-aos-mirror="true"
                      data-aos-once="true"
                    >
                      <Avatar size="md" src="https://bit.ly/broken-link" />
                    </Flex>
                  </Flex>
                </>
              ) : null}
              {/* 7th prompt */}
              {Tag7 ? (
                <>
                  <Flex
                    id="Tag7"
                    align="center"
                    h="5%"
                    p="1%"
                    w="416px"
                    mb="2%"
                    bg="#F2F6FE"
                    rounded="20px"
                    data-aos="fade-right"
                    data-aos-offset="200"
                    data-aos-delay="50"
                    data-aos-duration="1000"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                  >
                    <p>Thank you for that information.</p>
                  </Flex>
                  <Flex
                    id="salaryTag"
                    align="center"
                    h="5%"
                    p="1%"
                    w="416px"
                    mb="8%"
                    bg="#F2F6FE"
                    rounded="20px"
                    data-aos="fade-right"
                    data-aos-offset="200"
                    data-aos-delay="1500"
                    data-aos-duration="1000"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                  >
                    <p>
                      If you were offered, asked, or negotiated a salary,
                      including it in your review increases the helpfulness of
                      this post.
                    </p>
                  </Flex>
                  {/* salary container  */}
                  <Flex w="100%" justify="flex-end">
                    {/* salary box */}
                    <Flex
                      w="459px"
                      h="150px"
                      p="6"
                      border="1px solid #BBBDC6"
                      rounded="6px"
                      flexDir="column"
                      justify="space-evenly"
                      data-aos="fade-in"
                      data-aos-offset="200"
                      data-aos-delay="1000"
                      data-aos-duration="3000"
                      data-aos-easing="ease-in-out"
                      data-aos-mirror="true"
                      data-aos-once="true"
                      data-aos-anchor="salaryTag"
                    >
                      <FormLabel>Salary</FormLabel>
                      <InputGroup>
                        <InputLeftElement
                          mb="4"
                          py="28px"
                          color="gray.300"
                          fontSize="1.2em"
                          children="$"
                        />
                        <Input
                          h="56px"
                          rounded="6px"
                          type="number"
                          variant="filled"
                          label="salary"
                          name="salary"
                          autoCapitalize="none"
                          ref={register}
                        />
                      </InputGroup>
                    </Flex>
                    {/* avatar */}
                    <Flex
                      h="150px"
                      align="flex-end"
                      ml="1%"
                      data-aos="fade-in"
                      data-aos-offset="200"
                      data-aos-delay="1000"
                      data-aos-duration="3000"
                      data-aos-easing="ease-in-out"
                      data-aos-mirror="true"
                      data-aos-once="true"
                      data-aos-anchor="salaryTag"
                    >
                      <Avatar size="md" src="https://bit.ly/broken-link" />
                    </Flex>
                  </Flex>
                  <Flex
                    justify="flex-end"
                    mb="5%"
                    data-aos="fade-in"
                    data-aos-offset="200"
                    data-aos-delay="1000"
                    data-aos-duration="3000"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                    data-aos-anchor="salaryTag"
                  >
                    <Button
                      data-cy="interviewReviewFormButton"
                      h="56px"
                      w="17%"
                      mt="2%"
                      rounded="35px"
                      border="1px solid #344CD0"
                      color="#344CD0"
                      backgroundColor="#FFF"
                      _hover={{ backgroundColor: '#F2F6FE', cursor: 'pointer' }}
                      onClick={time7}
                    >
                      Next
                    </Button>
                  </Flex>
                </>
              ) : null}
              {/* 8th prompt */}
              {Tag8 ? (
                <>
                  <Flex
                    id="Tag8"
                    align="center"
                    h="5%"
                    w="416px"
                    p="1%"
                    mb="2%"
                    bg="#F2F6FE"
                    rounded="20px"
                    data-aos="fade-right"
                    data-aos-offset="200"
                    data-aos-delay="50"
                    data-aos-duration="1000"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                  >
                    <p>Thanks!</p>
                  </Flex>
                  <Flex
                    id="ratingTag"
                    align="center"
                    p="1%"
                    h="5%"
                    w="416px"
                    mb="8%"
                    bg="#F2F6FE"
                    rounded="20px"
                    data-aos="fade-right"
                    data-aos-offset="200"
                    data-aos-delay="900"
                    data-aos-duration="1000"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                  >
                    <p>
                      Last question. How would you rate your overall interview
                      experience?
                    </p>
                  </Flex>
                  {/* overall container  */}
                  <Flex w="100%" justify="flex-end">
                    {/* overall box */}
                    <Flex
                      w="459px"
                      h="136px"
                      mb="8%"
                      p="6"
                      border="1px solid #BBBDC6"
                      rounded="6px"
                      flexDir="column"
                      data-aos="fade-in"
                      data-aos-offset="200"
                      data-aos-delay="1500"
                      data-aos-duration="1000"
                      data-aos-easing="ease-in-out"
                      data-aos-mirror="true"
                      data-aos-once="true"
                    >
                      <FormLabel mb="4">Rate overall experience</FormLabel>
                      <Flex justify="center" w="100%">
                        <BeautyStars
                          name="interviewRating"
                          value={starState}
                          activeColor="#344CD0"
                          onChange={(value) => {
                            setStarState(value)
                            time8()
                          }}
                        />
                      </Flex>
                    </Flex>
                    {/* avatar */}
                    <Flex
                      h="136px"
                      align="flex-end"
                      ml="1%"
                      data-aos="fade-in"
                      data-aos-offset="200"
                      data-aos-delay="1500"
                      data-aos-duration="1000"
                      data-aos-easing="ease-in-out"
                      data-aos-mirror="true"
                      data-aos-once="true"
                    >
                      <Avatar size="md" src="https://bit.ly/broken-link" />
                    </Flex>
                  </Flex>
                </>
              ) : null}
              {Tag9 ? (
                <>
                  <Flex
                    id="Tag9"
                    align="center"
                    p="1%"
                    h="5%"
                    w="416px"
                    mb="8%"
                    bg="#F2F6FE"
                    rounded="20px"
                    data-aos="fade-right"
                    data-aos-offset="200"
                    data-aos-delay="50"
                    data-aos-duration="1000"
                    data-aos-easing="ease-in-out"
                    data-aos-mirror="true"
                    data-aos-once="true"
                    data-aos-anchor="#ratingTag"
                  >
                    <p>Thank you! Don’t forget to hit submit.</p>
                  </Flex>
                  {/* submit container  */}
                  <Flex w="100%" justify="flex-end">
                    {/* submit box */}
                    <Flex
                      w="459px"
                      h="136px"
                      mb="8%"
                      p="6"
                      justify="center"
                      align="center"
                      border="1px solid #BBBDC6"
                      rounded="6px"
                      flexDir="column"
                      data-aos="fade-in"
                      data-aos-offset="200"
                      data-aos-delay="1500"
                      data-aos-duration="1000"
                      data-aos-easing="ease-in-out"
                      data-aos-mirror="true"
                      data-aos-once="true"
                    >
                      <Button
                        bg="#344CD0"
                        color="white"
                        type="submit"
                        isLoading={formState.isSubmitting}
                        rounded="6px"
                        border="none"
                        data-cy="interviewReviewSubmit"
                      >
                        Submit
                      </Button>
                    </Flex>
                    {/* avatar */}
                    <Flex
                      h="136px"
                      align="flex-end"
                      ml="1%"
                      data-aos="fade-in"
                      data-aos-offset="200"
                      data-aos-delay="1500"
                      data-aos-duration="1000"
                      data-aos-easing="ease-in-out"
                      data-aos-mirror="true"
                      data-aos-once="true"
                    >
                      <Avatar size="md" src="https://bit.ly/broken-link" />
                    </Flex>
                  </Flex>
                </>
              ) : null}
            </FormControl>
          </form>
        </Flex>
      </Flex>
    </div>
  )
}
Example #11
Source File: index.js    From here-covid-19-tracker with MIT License 4 votes vote down vote up
App = () => {
  const currentTab = useTabStore(state => state.currentTab)

  const { data, error } = useSWR(`https://xyz.api.here.com/hub/spaces/${spaceId}/bbox?west=-180&north=90&east=180&south=-90&access_token=${accessToken}`, fetcher, { focusThrottleInterval: 60000 })
  const points = data ? (data.features || []) : []

  useEffect(() => {
    const cbox = document.getElementsByClassName("main-combobox")[0]
    if (cbox) cbox.focus()
  }, [])

  return (
    <>
      <Box
        display={!currentTab ? "block" : ["none", null, "block"]}
        position="fixed"
        top="0"
        left="0"
        bottom="0"
        zIndex={999999}
        borderTop="0.25rem solid #00AFAA"
        width={["100%", null, "25rem", "30rem"]}
        boxShadow="lg"
        overflow="scroll"
        bg="white"
        pb="5rem"
        style={{
          WebkitOverflowScrolling: "touch",
        }}
      >
        <Box px="1.25rem" pt="1.25rem">
          <Heading fontSize={["1.5rem", "2rem", null, "2.5rem"]} lineHeight={1.125} mb="1.25rem">
            <Text mr="0.75rem" as="span">
              { "Tracking Coronavirus" } <br/>
              { "COVID-19" }
            </Text>
          </Heading>
          { points.length ? <IntroParagraph points={points} /> : null}
          { points.length ? <TimeSlider points={points} /> : null }
        </Box>
        { points.length ? <Listing rows={points} /> : null }
      </Box>

      <Flex
        position="absolute"
        bottom={["3.5rem", null, "1.25rem"]}
        left={["1rem", null, "26.25rem", "32.5rem"]}
        right={["1rem", null, "2rem"]}
        zIndex={2}
        justifyContent="space-between"
        alignItems="flex-end"
      >
        <Flex flexWrap="wrap" justifyContent="space-between" flex="1 1 auto" pr={["0.75rem", null, 0]}>
          <Text as="span" fontSize="xs" color="gray.900" fontWeight={600}>
            {"Data: "}
            <Link href="https://github.com/CSSEGISandData/COVID-19" color="#00AFAA" bg="white" py="0.125rem" px="0.25rem">{"JHU CSSE"}</Link>
            { " and " }
            <Link href="https://ncov.dxy.cn/ncovh5/view/pneumonia?scene=2&clicktime=1579582238&enterid=1579582238&from=singlemessage&isappinstalled=0" color="#00AFAA" bg="white" py="0.125rem" px="0.25rem">
              {"DXY"}
            </Link>
          </Text>
          <Text as="span" fontSize="xs" color="gray.900" fontWeight={600}>
            {"Made with Leaflet, "}
            <Link href="https://developer.here.com/documentation/vector-tiles-api/dev_guide?cid=Freemium-DeveloperPortalTutorial-PJ-0-Javascript-DevPortal-&utm_source=DeveloperPortalTutorial&utm_medium=referral&utm_campaign=Webinar_IOT_2020_Golden-Age-Location-Enabled-AI-Jan-16" color="#00AFAA" bg="white" py="0.125rem" px="0.25rem">{"HERE Vector Map Tiles API"}</Link>
            {" and "}
            <Link href="https://developer.here.com/products/xyz?cid=Freemium-DeveloperPortalTutorial-PJ-0-XYZ-DevPortal-&utm_source=DeveloperPortalTutorial&utm_medium=referral&utm_campaign=CoronaVirusMap" color="#00AFAA" bg="white" py="0.125rem" px="0.25rem">{"HERE Data Hub APIs"}</Link>
            { " | " }
            <Link href="#" color="#00AFAA" bg="white" py="0.125rem" px="0.25rem">
              {"Get the code"}
              <Icon name="github" ml="0.25rem" mt="-0.125rem" />
            </Link>
          </Text>
        </Flex>
        <Link flex="none" href="https://developer.here.com/?cid=Freemium-DeveloperPortalTutorial-PJ-0-Javascript-DevPortal-&utm_source=DeveloperPortalTutorial&utm_medium=referral&utm_campaign=Webinar_IOT_2020_Golden-Age-Location-Enabled-AI-Jan-16">
          <img src={hereLogo} alt="HERE logo" style={{ width: "2.5rem", marginLeft: "0.75rem" }} />
        </Link>
      </Flex>

      <Map points={points} />

      <Search />

      <Box
        position="fixed"
        bottom={["5.5rem", null, "4rem"]}
        right={["1rem", null, "2.5rem"]}
        zIndex={2}
        width={["6rem", "8rem", "10rem"]}
        height={["6rem", "8rem", "10rem"]}
        boxShadow="lg"
        borderRadius="100%"
        bg="white"
        border="0.125rem solid"
        borderColor="gray.50"
        pointerEvents="none"
      >
        <Globe />
      </Box>

      {
        currentTab === 2 ? (
          <Box
            display="block"
            position="fixed"
            top="0"
            left="0"
            bottom="0"
            zIndex={999999}
            borderTop="0.25rem solid #00AFAA"
            width={["100%", null, "25rem", "30rem"]}
            boxShadow="lg"
            overflow="scroll"
            bg="white"
            pb="5rem"
            style={{
              WebkitOverflowScrolling: "touch",
            }}
          >
            <Box px="1.25rem" pt="1.25rem">
              <AboutContent />
            </Box>
          </Box>
        ) : null
      }

      <NavigationTabs />

      <CurrentCircle />

    </>
  )
}