Migrate NotFound component to tailwind

This commit is contained in:
Alejandro Celaya
2025-04-01 11:18:32 +02:00
parent ca4543b227
commit ad00e54df8
7 changed files with 787 additions and 7 deletions

View File

@@ -30,7 +30,7 @@ const MainHeader: FCWithDeps<unknown, MainHeaderDeps> = () => {
return (
<Navbar color="primary" dark fixed="top" className="main-header" expand="md">
<NavbarBrand tag={Link} to="/">
<ShlinkLogo className="main-header__brand-logo" color="white" /> Shlink
<ShlinkLogo className="main-header__brand-logo tw:inline" color="white" /> Shlink
</NavbarBrand>
<NavbarToggler onClick={toggleCollapse}>

View File

@@ -1,19 +1,18 @@
import { SimpleCard } from '@shlinkio/shlink-frontend-kit';
import { Button, SimpleCard } from '@shlinkio/shlink-frontend-kit/tailwind';
import type { FC, PropsWithChildren } from 'react';
import { Link } from 'react-router';
type NotFoundProps = PropsWithChildren<{ to?: string }>;
export const NotFound: FC<NotFoundProps> = ({ to = '/', children = 'Home' }) => (
<div className="home">
<SimpleCard className="p-4">
<div className="tw:pt-4">
<SimpleCard className="tw:p-4 tw:w-full tw:lg:w-[50%] tw:m-auto">
<h2>Oops! We could not find requested route.</h2>
<p>
Use your browser&apos;s back button to navigate to the page you have previously come from, or just press this
button.
</p>
<br />
<Link to={to} className="btn btn-outline-primary btn-lg">{children}</Link>
<Button inline to={to} size="lg">{children}</Button>
</SimpleCard>
</div>
);

View File

@@ -5,6 +5,7 @@ import pack from '../package.json';
import { container } from './container';
import { setUpStore } from './container/store';
import { register as registerServiceWorker } from './serviceWorkerRegistration';
import './tailwind.css';
import './index.scss';
const store = setUpStore(container);

3
src/tailwind.css Normal file
View File

@@ -0,0 +1,3 @@
@import 'tailwindcss' prefix(tw) important;
@source '../node_modules/@shlinkio/shlink-frontend-kit';
@import '@shlinkio/shlink-frontend-kit/tailwind.preset.css';