Added more improvements to landing page

This commit is contained in:
Alejandro Celaya 2021-07-12 12:05:33 +02:00
parent 0789494a40
commit 8045fa8886
4 changed files with 17 additions and 9 deletions

View file

@ -2,6 +2,8 @@ import { isEmpty, values } from 'ramda';
import { Link } from 'react-router-dom';
import { Card, Row } from 'reactstrap';
import { ExternalLink } from 'react-external-link';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faExternalLinkAlt, faPlus } from '@fortawesome/free-solid-svg-icons';
import ServersListGroup from '../servers/ServersListGroup';
import { ServersMap } from '../servers/data';
import { ShlinkLogo } from './img/ShlinkLogo';
@ -30,12 +32,18 @@ const Home = ({ servers }: HomeProps) => {
</div>
<ServersListGroup embedded servers={serversList}>
{!hasServers && (
<div className="p-4">
<p className="mb-4">This application will help you manage your Shlink servers.</p>
<p className="text-center mb-0">
<Link to="/server/create" className="btn btn-outline-primary btn-lg mr-2">Add a server</Link>
<ExternalLink href="https://shlink.io/documentation" className="btn btn-outline-secondary btn-lg">
Learn more
<div className="p-4 text-center">
<p className="mb-5">This application will help you manage your Shlink servers.</p>
<p>
<Link to="/server/create" className="btn btn-outline-primary btn-lg mr-2">
<FontAwesomeIcon icon={faPlus} /> <span className="ml-1">Add a server</span>
</Link>
</p>
<p className="mb-0 mt-5">
<ExternalLink href="https://shlink.io/documentation">
<small>
<span className="mr-1">Learn more about Shlink</span> <FontAwesomeIcon icon={faExternalLinkAlt} />
</small>
</ExternalLink>
</p>
</div>

View file

@ -15,7 +15,7 @@ const ServersDropdown = (serversExporter: ServersExporter) => ({ servers, select
const serversList = values(servers);
const createServerItem = (
<DropdownItem tag={Link} to="/server/create">
<FontAwesomeIcon icon={plusIcon} /> <span className="ml-1">Add server</span>
<FontAwesomeIcon icon={plusIcon} /> <span className="ml-1">Add a server</span>
</DropdownItem>
);

View file

@ -35,7 +35,7 @@ describe('<Home />', () => {
},
0,
],
[{}, 2 ],
[{}, 3 ],
])('shows link to create or set-up server only when no servers exist', (servers, expectedParagraphs) => {
const wrapped = createComponent({ servers });
const p = wrapped.find('p');

View file

@ -43,6 +43,6 @@ describe('<ServersDropdown />', () => {
expect(item).toHaveLength(1);
expect(item.prop('to')).toEqual('/server/create');
expect(item.find('span').text()).toContain('Add server');
expect(item.find('span').text()).toContain('Add a server');
});
});