6
6
7
7
import React from 'react'
8
8
9
+ import { ASSETS_ENDPOINT } from '@/config'
10
+ import { GALLERY } from '@/constant'
9
11
import { connectStore , buildLog } from '@/utils'
10
12
11
13
import Pagi from '@/components/Pagi'
14
+ import { PagiOptionSwitcher } from '@/components/Switcher'
12
15
13
16
import FilterBar from './FilterBar'
14
17
import DateSelector from './DateSelector'
@@ -19,25 +22,27 @@ import filtersItems from './fakeFiltersItems'
19
22
import meetups from './fakeMeetups'
20
23
21
24
import { Wrapper , InnerWrapper , ContentWrapper , CardsWrapper } from './styles'
22
- import { useInit } from './logic'
25
+ import { useInit , changeGalleryType } from './logic'
23
26
24
27
/* eslint-disable-next-line */
25
28
const log = buildLog ( 'C:CoolGuideContent' )
26
29
27
- // const GALLERY_TYPES = [
28
- // {
29
- // icon: GALLERY.MAIN_COLUMN ,
30
- // key:'0' ,
31
- // },
32
- // {
33
- // icon: GALLERY.MASONRY_COLUMN ,
34
- // key:'1' ,
35
- // },
36
- // ]
30
+ const GALLERY_TYPES = [
31
+ {
32
+ iconSrc : ` ${ ASSETS_ENDPOINT } /words_only.svg` ,
33
+ key :GALLERY . TEXT_ONLY ,
34
+ } ,
35
+ {
36
+ iconSrc : ` ${ ASSETS_ENDPOINT } /text_with_image.svg` ,
37
+ key :GALLERY . TEXT_WITH_IMAGE ,
38
+ } ,
39
+ ]
37
40
38
41
const MeetupsContentContainer = ( { meetupsContent :store } ) => {
39
42
useInit ( store )
40
43
44
+ const { activeGalleryType} = store
45
+
41
46
return (
42
47
< Wrapper >
43
48
< InnerWrapper >
@@ -46,18 +51,18 @@ const MeetupsContentContainer = ({ meetupsContent: store }) => {
46
51
< DateSelector />
47
52
< CardsWrapper >
48
53
{ meetups . map ( item => (
49
- < Card key = { item . id } item = { item } />
54
+ < Card key = { item . id } item = { item } type = { activeGalleryType } />
50
55
// <ActivityCard key={item.id} item={item} />
51
56
) ) }
52
57
</ CardsWrapper >
53
58
54
59
< Pagi margin = { { top :'60px' , bottom :'80px' } } >
55
- { /* <PagiOptionSwitcher
60
+ < PagiOptionSwitcher
56
61
activeKey = { activeGalleryType }
57
62
title = "显示模式"
58
63
items = { GALLERY_TYPES }
59
- onChange={item => console.log(item.key) }
60
- /> */ }
64
+ onChange = { changeGalleryType }
65
+ />
61
66
</ Pagi >
62
67
</ ContentWrapper >
63
68
</ InnerWrapper >