Browse Source

feat: 开发中

main
谢亚昕 5 months ago
parent
commit
48e9647d58
  1. 1
      src/base/withPage.tsx
  2. 12
      src/index.css
  3. 4
      src/layout/GlobalStyles.ts
  4. 6
      src/layout/base.tsx
  5. 19
      src/views/Home/index.tsx

1
src/base/withPage.tsx

@ -9,6 +9,7 @@ interface PageProps {
const StyleAnim = styled(OpacityIn)`
position: relative;
height: 100%;
`
function withPage(WrappedComponent: FC<PageProps>) {

12
src/index.css

@ -3,10 +3,12 @@
@import "@blueprintjs/icons/lib/css/blueprint-icons.css";
@import "@blueprintjs/table/lib/css/table.css";
/* html,
body {
html,body, #root{
height: 100%;
}
#root {
min-height: 100%;
} */
.container {
max-width: 1200px;
margin: 0 auto;
}

4
src/layout/GlobalStyles.ts

@ -1,7 +1,5 @@
import { createGlobalStyle } from "styled-components"
export const GlobalStyles = createGlobalStyle`
html,body, #root{
height: 100%;
}
`

6
src/layout/base.tsx

@ -1,5 +1,5 @@
import { Alignment, Button, Dialog, DialogBody, DialogFooter, Menu, MenuDivider, MenuItem, Navbar, Popover } from "@blueprintjs/core"
import { FC, ReactNode, useState } from "react"
import { ReactNode, useState } from "react"
import { NavLink, useHistory } from "react-router-dom"
import styled from "styled-components"
import { GlobalStyles } from "./GlobalStyles"
@ -34,7 +34,7 @@ function BaseLayout(props: PageProps) {
<Navbar.Group align={Alignment.LEFT}>
<Navbar.Heading></Navbar.Heading>
<Navbar.Divider />
<NavLink to={"/"}>
<NavLink to={"/home"} strict exact activeClassName="actived">
<Button className="bp5-minimal" icon="home" text="Home" />
</NavLink>
<Popover
@ -64,7 +64,7 @@ function BaseLayout(props: PageProps) {
<Button className="bp5-minimal" icon="settings" />
<Navbar.Divider />
{/* <NavLink to={"/about"}> */}
<Button onClick={()=>setIsOpenAbout(true)} className="bp5-minimal" icon="person" text="关于" />
<Button onClick={() => setIsOpenAbout(true)} className="bp5-minimal" icon="person" text="关于" />
{/* </NavLink> */}
</Navbar.Group>
</Navbar>

19
src/views/Home/index.tsx

@ -21,22 +21,7 @@ export default withPage(function Project({ children }) {
router.push("/project/child")
}
return (
<>
<Wrapper>
<Title>HOME</Title>
</Wrapper>
<Wrapper>
<Title>HOME</Title>
</Wrapper>
<Wrapper>
<Title>HOME</Title>
</Wrapper>
<Wrapper>
<Title>HOME</Title>
</Wrapper>
<Wrapper>
<Title>HOME</Title>
</Wrapper>
<div className="container">
<Wrapper>
<Title>HOME</Title>
</Wrapper>
@ -47,6 +32,6 @@ export default withPage(function Project({ children }) {
</div>
{children}
</div>
</>
</div>
)
})

Loading…
Cancel
Save