Updates links to use Link instead of anchor

This commit is contained in:
Alicia Sykes 2024-05-20 22:43:12 +01:00
parent a2f5bcb263
commit 97fd19492e
3 changed files with 15 additions and 23 deletions

View File

@ -170,7 +170,7 @@ const About = (): JSX.Element => {
<Heading as="h3" size="small" id="#feature-contents" color={colors.primary}>Contents</Heading>
<ul>
{docs.map((section, index: number) => (
<li>
<li key={index}>
<b>{index + 1}</b>
<a href={`#${makeAnchor(section.title)}`}>{section.title}</a></li>
))}
@ -200,9 +200,9 @@ const About = (): JSX.Element => {
<ul>
{section.resources.map((link: string | { title: string, link: string }, linkIndx: number) => (
typeof link === 'string' ? (
<li id={`link-${linkIndx}`}><a target="_blank" rel="noreferrer" href={link}>{link}</a></li>
<li key={`link-${linkIndx}`} id={`link-${linkIndx}`}><a target="_blank" rel="noreferrer" href={link}>{link}</a></li>
) : (
<li id={`link-${linkIndx}`}><a target="_blank" rel="noreferrer" href={link.link}>{link.title}</a></li>
<li key={`link-${linkIndx}`} id={`link-${linkIndx}`}><a target="_blank" rel="noreferrer" href={link.link}>{link.title}</a></li>
)
))}
</ul>
@ -273,15 +273,6 @@ const About = (): JSX.Element => {
</li>
</ul>
{/*
**Configuration Settings**:
- `CHROME_PATH` (e.g. `/usr/bin/chromium`) - The path the the Chromium executable
- `PORT` (e.g. `3000`) - Port to serve the API, when running server.js
- `DISABLE_GUI` (e.g. `false`) - Disable the GUI, and only serve the API
- `API_TIMEOUT_LIMIT` (e.g. `10000`) - The timeout limit for API requests, in milliseconds
- `REACT_APP_API_ENDPOINT` (e.g. `/api`) - The endpoint for the API (can be local or remote)</p> */}
</Section>
<Heading as="h2" size="medium" color={colors.primary}>API Documentation</Heading>

View File

@ -1,6 +1,6 @@
import styled from '@emotion/styled';
import { type ChangeEvent, type FormEvent, useState, useEffect } from 'react';
import { useNavigate, useLocation, type NavigateOptions } from 'react-router-dom';
import { Link, useNavigate, useLocation, type NavigateOptions } from 'react-router-dom';
import Heading from 'web-check-live/components/Form/Heading';
import Input from 'web-check-live/components/Form/Input'
@ -217,10 +217,12 @@ const Home = (): JSX.Element => {
<HomeContainer>
<FancyBackground />
<UserInputMain onSubmit={formSubmitEvent}>
<Heading as="h1" size="xLarge" align="center" color={colors.primary}>
<img width="64" src="/web-check.png" alt="Web Check Icon" />
Web Check
</Heading>
<a href="/">
<Heading as="h1" size="xLarge" align="center" color={colors.primary}>
<img width="64" src="/web-check.png" alt="Web Check Icon" />
Web Check
</Heading>
</a>
<Input
id="user-input"
value={userInput}
@ -276,7 +278,7 @@ const Home = (): JSX.Element => {
<Heading as="h2" size="small" color={colors.primary}>Supported Checks</Heading>
<ul>
{docs.map((doc, index) => (<li key={index}>{doc.title}</li>))}
<li><a href="/check/about">+ more!</a></li>
<li><Link to="/check/about">+ more!</Link></li>
</ul>
</div>
<div className="links">
@ -286,9 +288,9 @@ const Home = (): JSX.Element => {
<a target="_blank" rel="noreferrer" href="https://app.netlify.com/start/deploy?repository=https://github.com/lissy93/web-check" title="Deploy your own private or public instance of Web-Check to Netlify">
<Button>Deploy your own</Button>
</a>
<a href="check/about#api-documentation" title="View the API documentation, to use Web-Check programmatically">
<Link to="/check/about#api-documentation" title="View the API documentation, to use Web-Check programmatically">
<Button>API Docs</Button>
</a>
</Link>
</div>
</SiteFeaturesWrapper>
<Footer isFixed={true} />

View File

@ -248,9 +248,8 @@ const Results = (props: { address?: string } ): JSX.Element => {
const urlTypeOnly = ['url'] as AddressType[]; // Many jobs only run with these address types
// const api = process.env.REACT_APP_API_ENDPOINT || '/api'; // Where is the API hosted?
const api = '/api'; // Where is the API hosted?
const api = import.meta.env.PUBLIC_API_ENDPOINT || '/api'; // Where is the API hosted?
// Fetch and parse IP address for given URL
const [ipAddress, setIpAddress] = useMotherHook({
jobId: 'get-ip',