66
77import React from 'react'
88import { inject , observer } from 'mobx-react'
9- import { Tabs } from 'antd'
109
11- import styled from 'styled-components'
12- // import Link from 'next/link'
10+ import Tabber from '../../components/Tabber'
1311
1412import {
1513 makeDebugger ,
@@ -19,20 +17,12 @@ import {
1917
2018import * as logic from './logic'
2119
22- import { Banner , BannerLogo } from './styles'
20+ import { Banner , BannerLogo , TabberWrapper } from './styles'
2321
2422const debug = makeDebugger ( 'C:Banner' )
2523
26- const { TabPane } = Tabs
27-
28- const MTabs = styled ( Tabs ) `
29- position: absolute;
30- bottom: -17px;
31- width: 80vw;
32- `
33-
34- function callback ( key ) {
35- console . log ( 'callback: ' , key )
24+ const onChange = e => {
25+ console . log ( 'callback: ' , e )
3626}
3727
3828class BannerContainer extends React . Component {
@@ -43,19 +33,17 @@ class BannerContainer extends React.Component {
4333
4434 render ( ) {
4535 const { banner } = this . props
46- const { curUrlPath } = banner
36+ const { curUrlPath, curCommunity } = banner
4737
4838 const defaultIcon = 'js'
4939 const iconKey = curUrlPath === '/' ? defaultIcon : curUrlPath
5040
5141 return (
5242 < Banner >
5343 < BannerLogo path = { getSVGIconPath ( iconKey ) } />
54- < MTabs onChange = { callback } >
55- < TabPane tab = "帖子" key = "1" />
56- < TabPane tab = "教程" key = "2" />
57- < TabPane tab = "用户" key = "3" />
58- </ MTabs >
44+ < TabberWrapper >
45+ < Tabber source = { curCommunity } onChange = { onChange } />
46+ </ TabberWrapper >
5947 </ Banner >
6048 )
6149 }
0 commit comments