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)` const StyleAnim = styled(OpacityIn)`
position: relative; position: relative;
height: 100%;
` `
function withPage(WrappedComponent: FC<PageProps>) { function withPage(WrappedComponent: FC<PageProps>) {

12
src/index.css

@ -3,10 +3,12 @@
@import "@blueprintjs/icons/lib/css/blueprint-icons.css"; @import "@blueprintjs/icons/lib/css/blueprint-icons.css";
@import "@blueprintjs/table/lib/css/table.css"; @import "@blueprintjs/table/lib/css/table.css";
/* html, html,body, #root{
body {
height: 100%; 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" import { createGlobalStyle } from "styled-components"
export const GlobalStyles = createGlobalStyle` 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 { 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 { NavLink, useHistory } from "react-router-dom"
import styled from "styled-components" import styled from "styled-components"
import { GlobalStyles } from "./GlobalStyles" import { GlobalStyles } from "./GlobalStyles"
@ -34,7 +34,7 @@ function BaseLayout(props: PageProps) {
<Navbar.Group align={Alignment.LEFT}> <Navbar.Group align={Alignment.LEFT}>
<Navbar.Heading></Navbar.Heading> <Navbar.Heading></Navbar.Heading>
<Navbar.Divider /> <Navbar.Divider />
<NavLink to={"/"}> <NavLink to={"/home"} strict exact activeClassName="actived">
<Button className="bp5-minimal" icon="home" text="Home" /> <Button className="bp5-minimal" icon="home" text="Home" />
</NavLink> </NavLink>
<Popover <Popover
@ -64,7 +64,7 @@ function BaseLayout(props: PageProps) {
<Button className="bp5-minimal" icon="settings" /> <Button className="bp5-minimal" icon="settings" />
<Navbar.Divider /> <Navbar.Divider />
{/* <NavLink to={"/about"}> */} {/* <NavLink to={"/about"}> */}
<Button onClick={()=>setIsOpenAbout(true)} className="bp5-minimal" icon="person" text="关于" /> <Button onClick={() => setIsOpenAbout(true)} className="bp5-minimal" icon="person" text="关于" />
{/* </NavLink> */} {/* </NavLink> */}
</Navbar.Group> </Navbar.Group>
</Navbar> </Navbar>

19
src/views/Home/index.tsx

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

Loading…
Cancel
Save