chore: update demo banner

This commit is contained in:
Steven 2023-07-28 22:49:18 +08:00
parent 0eea0a92db
commit 96a68ab117
3 changed files with 10 additions and 4 deletions

View File

@ -2,6 +2,7 @@ import { useEffect, useState } from "react";
import { Outlet } from "react-router-dom"; import { Outlet } from "react-router-dom";
import { globalService } from "./services"; import { globalService } from "./services";
import useUserStore from "./stores/v1/user"; import useUserStore from "./stores/v1/user";
import DemoBanner from "./components/DemoBanner";
function App() { function App() {
const userStore = useUserStore(); const userStore = useUserStore();
@ -27,7 +28,14 @@ function App() {
initialState(); initialState();
}, []); }, []);
return <>{!loading && <Outlet />}</>; return (
!loading && (
<>
<DemoBanner />
<Outlet />
</>
)
);
} }
export default App; export default App;

View File

@ -12,7 +12,7 @@ const DemoBanner: React.FC = () => {
if (!shouldShow) return null; if (!shouldShow) return null;
return ( return (
<div className="z-10 flex flex-row items-center justify-center w-full py-2 text-sm sm:text-lg font-medium dark:text-gray-300 bg-white dark:bg-zinc-700 shadow"> <div className="z-10 relative flex flex-row items-center justify-center w-full py-2 text-sm sm:text-lg font-medium dark:text-gray-300 bg-white dark:bg-zinc-700 shadow">
<div className="w-full max-w-4xl px-4 flex flex-row justify-between items-center gap-x-3"> <div className="w-full max-w-4xl px-4 flex flex-row justify-between items-center gap-x-3">
<span>Slash - An open source, self-hosted bookmarks and link sharing platform</span> <span>Slash - An open source, self-hosted bookmarks and link sharing platform</span>
<a <a

View File

@ -2,7 +2,6 @@ import { useEffect } from "react";
import { Outlet, useNavigate } from "react-router-dom"; import { Outlet, useNavigate } from "react-router-dom";
import useUserStore from "../stores/v1/user"; import useUserStore from "../stores/v1/user";
import Header from "../components/Header"; import Header from "../components/Header";
import DemoBanner from "../components/DemoBanner";
const Root: React.FC = () => { const Root: React.FC = () => {
const navigate = useNavigate(); const navigate = useNavigate();
@ -20,7 +19,6 @@ const Root: React.FC = () => {
<> <>
{currentUser && ( {currentUser && (
<div className="w-full h-full flex flex-col justify-start items-start"> <div className="w-full h-full flex flex-col justify-start items-start">
<DemoBanner />
<Header /> <Header />
<Outlet /> <Outlet />
</div> </div>