diff --git a/src/app/App.tsx b/src/app/App.tsx index f00af006..3c7c540d 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -66,7 +66,7 @@ const App: FCWithDeps = (
-
+
} /> } /> diff --git a/src/common/Home.scss b/src/common/Home.scss index 58798fd2..18eb7826 100644 --- a/src/common/Home.scss +++ b/src/common/Home.scss @@ -1,50 +1,7 @@ @import 'node_modules/@shlinkio/shlink-frontend-kit/dist/base'; -@import '../utils/mixins/vertical-align'; - -$mainCardWidth: 720px; -$fiveColumnsSize: .4167; // 12 / 5 -> Can't use "/" operator in latest dart-sass - -.home { - position: relative; - padding-top: 15px; - width: 100%; - - @media (min-width: $mdMin) { - padding-top: 0; - height: calc(100vh - #{$headerHeight} - #{($footer-height + $footer-margin)}); - } -} - -.home__logo-wrapper { - padding: 1.5rem !important; - height: 100% !important; - min-height: 300px; -} - -.home__logo { - @include vertical-align(); - - width: calc(#{$mainCardWidth * $fiveColumnsSize} - 3rem); -} - -.home__main-card { - margin: 0 auto; - max-width: $mainCardWidth; - - @media (min-width: $mdMin) { - @include vertical-align(); - } -} - -.home__title-wrapper { - padding: 1.5rem !important; - border-bottom: 1px solid var(--border-color); -} .home__title { - text-align: center; font-size: 1.75rem; - margin: 0; @media (min-width: $mdMin) { font-size: 2.2rem; diff --git a/src/common/Home.tsx b/src/common/Home.tsx index 42dc695d..3b6d31ab 100644 --- a/src/common/Home.tsx +++ b/src/common/Home.tsx @@ -1,9 +1,10 @@ import { faExternalLinkAlt, faPlus } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { clsx } from 'clsx'; import { useEffect } from 'react'; import { ExternalLink } from 'react-external-link'; import { Link, useNavigate } from 'react-router-dom'; -import { Card, Row } from 'reactstrap'; +import { Card } from 'reactstrap'; import type { ServersMap } from '../servers/data'; import { ServersListGroup } from '../servers/ServersListGroup'; import { ShlinkLogo } from './img/ShlinkLogo'; @@ -27,33 +28,36 @@ export const Home = ({ servers }: HomeProps) => { }, [serversList, navigate]); return ( -
- - -
-
-
- -
+
+ +
+
+
+
-
-
-

Welcome!

-
+ +
+

+ Welcome! +

{!hasServers && ( -
-

This application will help you manage your Shlink servers.

-

+

+

This application will help you manage your Shlink servers.

+

- Add a server + Add a server

-

+

- Learn more about Shlink + Learn more about Shlink +

@@ -61,7 +65,7 @@ export const Home = ({ servers }: HomeProps) => { )}
- +
); diff --git a/src/common/NoMenuLayout.tsx b/src/common/NoMenuLayout.tsx index 868c1a1e..2a2e171d 100644 --- a/src/common/NoMenuLayout.tsx +++ b/src/common/NoMenuLayout.tsx @@ -1,6 +1,11 @@ +import { clsx } from 'clsx'; import type { FC, PropsWithChildren } from 'react'; import './NoMenuLayout.scss'; -export const NoMenuLayout: FC = ({ children }) => ( -
{children}
+export type NoMenuLayoutProps = PropsWithChildren & { + className?: string; +}; + +export const NoMenuLayout: FC = ({ children, className }) => ( +
{children}
); diff --git a/src/servers/ManageServers.tsx b/src/servers/ManageServers.tsx index 571f5c68..afef682d 100644 --- a/src/servers/ManageServers.tsx +++ b/src/servers/ManageServers.tsx @@ -5,7 +5,7 @@ import { Result, SearchField, SimpleCard } from '@shlinkio/shlink-frontend-kit'; import type { FC } from 'react'; import { useMemo, useState } from 'react'; import { Link } from 'react-router-dom'; -import { Button, Row } from 'reactstrap'; +import { Button } from 'reactstrap'; import { NoMenuLayout } from '../common/NoMenuLayout'; import type { FCWithDeps } from '../container/utils'; import { componentFactory, useDependencies } from '../container/utils'; @@ -44,24 +44,22 @@ const ManageServers: FCWithDeps = ({ serv const [errorImporting, setErrorImporting] = useTimeoutToggle(false, SHOW_IMPORT_MSG_TIME); return ( - - + + - -
+
+
Import servers {filteredServers.length > 0 && ( - )}
-
- -
- + +
@@ -83,7 +81,7 @@ const ManageServers: FCWithDeps = ({ serv {errorImporting && ( -
+
The servers could not be imported. Make sure the format is correct.
)} diff --git a/test/app/App.test.tsx b/test/app/App.test.tsx index 2be2b3c4..ab6a9405 100644 --- a/test/app/App.test.tsx +++ b/test/app/App.test.tsx @@ -56,7 +56,7 @@ describe('', () => { it.each([ ['/foo', 'shlink-wrapper'], ['/bar', 'shlink-wrapper'], - ['/', 'shlink-wrapper d-flex d-md-block align-items-center'], + ['/', 'shlink-wrapper d-flex align-items-center pt-3'], ])('renders expected classes on shlink-wrapper based on current pathname', async (pathname, expectedClasses) => { const { container } = await setUp(pathname); const shlinkWrapper = container.querySelector('.shlink-wrapper');