公用底部导入

This commit is contained in:
禺狨 2023-03-24 14:25:43 +08:00
parent 084a0652c6
commit fb98e0986a
9 changed files with 44 additions and 8 deletions

View File

@ -1,7 +1,7 @@
#root { #root {
width: 100%; width: 100%;
margin: 0 auto; margin: 0 auto;
// text-align: center; text-align: center;
} }
.logo { .logo {

View File

@ -6,10 +6,9 @@ export const Footer: React.FC = () => {
<Layout.Footer <Layout.Footer
style={{ style={{
width: "100%", width: "100%",
backgroundColor: "#ffffff", backgroundColor: "#333333",
height: 130, height: 90,
textAlign: "center", textAlign: "center",
paddingBottom: 100,
}} }}
> >
<i <i

View File

@ -1,3 +1,4 @@
export * from "./footer"; export * from "./footer";
export * from "./no-footer";
export * from "./no-header"; export * from "./no-header";
export * from "./header"; export * from "./header";

View File

@ -0,0 +1,21 @@
import React from "react";
import { Layout } from "antd";
export const NoFooter: React.FC = () => {
return (
<Layout.Footer
style={{
width: "100%",
backgroundColor: "#ffffff",
height: 130,
textAlign: "center",
paddingBottom: 100,
}}
>
<i
style={{ fontSize: 30, color: "#cccccc" }}
className="iconfont icon-waterprint"
></i>
</Layout.Footer>
);
};

View File

@ -74,3 +74,16 @@
grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-columns: repeat(3, minmax(0, 1fr));
position: relative; position: relative;
} }
.extra {
width: 1200px;
margin: 0 auto;
margin-top: 80px;
margin-bottom: 80px;
text-align: center;
height: 40px;
font-size: 16px;
font-weight: 400;
color: rgba(0, 0, 0, 0.2);
line-height: 40px;
}

View File

@ -206,6 +206,7 @@ const IndexPage = () => {
))} ))}
</div> </div>
)} )}
<div className={styles["extra"]}>~~</div>
</> </>
); );
}; };

View File

@ -2,7 +2,7 @@ import { useDispatch } from "react-redux";
import { Outlet } from "react-router-dom"; import { Outlet } from "react-router-dom";
import styles from "./index.module.scss"; import styles from "./index.module.scss";
import { saveConfigAction } from "../../store/system/systemConfigSlice"; import { saveConfigAction } from "../../store/system/systemConfigSlice";
import { Header, NoHeader } from "../../compenents"; import { Header, NoHeader, Footer } from "../../compenents";
import { useLocation } from "react-router-dom"; import { useLocation } from "react-router-dom";
interface Props { interface Props {
@ -20,6 +20,7 @@ export const InitPage = (props: Props) => {
{pathname === "/login" && <NoHeader></NoHeader>} {pathname === "/login" && <NoHeader></NoHeader>}
{pathname !== "/login" && <Header></Header>} {pathname !== "/login" && <Header></Header>}
<Outlet /> <Outlet />
{pathname !== "/login" && <Footer></Footer>}
</div> </div>
</> </>
); );

View File

@ -7,7 +7,7 @@ import { useNavigate } from "react-router-dom";
import { loginAction, logoutAction } from "../../store/user/loginUserSlice"; import { loginAction, logoutAction } from "../../store/user/loginUserSlice";
import { login, system, user } from "../../api/index"; import { login, system, user } from "../../api/index";
import { setToken } from "../../utils/index"; import { setToken } from "../../utils/index";
import { Footer } from "../../compenents"; import { NoFooter } from "../../compenents";
const LoginPage: React.FC = () => { const LoginPage: React.FC = () => {
const dispatch = useDispatch(); const dispatch = useDispatch();
@ -156,7 +156,7 @@ const LoginPage: React.FC = () => {
</div> </div>
</div> </div>
<div className={styles["footer"]}> <div className={styles["footer"]}>
<Footer></Footer> <NoFooter></NoFooter>
</div> </div>
</div> </div>
); );