@@ -2,18 +2,20 @@ import { Dialog } from 'idea-react';
22import { observable } from 'mobx' ;
33import { observer } from 'mobx-react' ;
44import { Component } from 'react' ;
5- import { Modal } from 'react-bootstrap' ;
5+ import { Image , Modal } from 'react-bootstrap' ;
66import { splitArray } from 'web-utility' ;
77
8- import { Organization , OrganizationModel } from '../../models/Organization ' ;
8+ import { Organization } from '@open-source-bazaar/china-ngo-database ' ;
99import systemStore from '../../models/System' ;
10- import { LarkImage } from '../LarkImage' ;
10+ import { OrganizationModel } from '../../models/Organization' ;
11+
1112import { OrganizationCard } from './Card' ;
13+ import styles from './LandScape.module.less' ;
1214
13- export type ChinaPublicInterestLandscapeProps = Pick < OrganizationModel , 'categoryMap' > ;
15+ export type OpenCollaborationLandscapeProps = Pick < OrganizationModel , 'categoryMap' > ;
1416
1517@observer
16- export class ChinaPublicInterestLandscape extends Component < ChinaPublicInterestLandscapeProps > {
18+ export class OpenCollaborationLandscape extends Component < OpenCollaborationLandscapeProps > {
1719 @observable
1820 accessor itemSize = 5 ;
1921
@@ -33,24 +35,22 @@ export class ChinaPublicInterestLandscape extends Component<ChinaPublicInterestL
3335
3436 if ( ! organization ) return < > </ > ;
3537
36- // eslint-disable-next-line @typescript-eslint/no-unused-vars
3738 const { id, ...data } = organization ;
3839
3940 return < OrganizationCard { ...data } /> ;
4041 }
4142
42- renderLogo = ( { name, logo } : Organization ) => (
43+ renderLogo = ( { name } : Organization ) => (
4344 < li
4445 key = { name as string }
45- className = "border list-item"
46- style = { { cursor : 'pointer' } }
46+ className = { `border ${ styles . listItem } ` }
4747 onClick = { ( ) => this . modal . open ( { name : name as string } ) }
4848 >
49- < LarkImage
50- className = "object-fit-contain"
51- style = { { width : this . itemSize + 'rem' , height : this . itemSize + 'rem' } }
52- src = { logo ?. data ?. attributes ?. url }
53- / >
49+ < div style = { { fontSize : this . itemSize + 'rem' } } >
50+ { name . slice ( 0 , 2 ) }
51+ < br />
52+ { name . slice ( 2 , 4 ) }
53+ </ div >
5454 </ li >
5555 ) ;
5656
@@ -60,16 +60,11 @@ export class ChinaPublicInterestLandscape extends Component<ChinaPublicInterestL
6060
6161 return (
6262 < >
63- { rows . map ( ( row , index ) => (
64- < ul
65- key = { index }
66- className = { `list-unstyled d-flex flex-${ screenNarrow ? 'column' : 'row' } gap-2` }
67- >
63+ { rows . map ( row => (
64+ < ul className = { `list-unstyled d-flex flex-${ screenNarrow ? 'column' : 'row' } gap-2` } >
6865 { row . map ( ( [ name , list ] ) => (
6966 < li key = { name } className = "flex-fill" >
70- < h2 className = "h5 p-2 text-white bg-primary" >
71- { name }
72- </ h2 >
67+ < h2 className = { `h5 p-2 text-white ${ styles . groupTitle } ` } > { name } </ h2 >
7368
7469 < ol className = "list-unstyled d-flex flex-wrap gap-2" >
7570 { list . map ( this . renderLogo ) }
@@ -82,4 +77,4 @@ export class ChinaPublicInterestLandscape extends Component<ChinaPublicInterestL
8277 </ >
8378 ) ;
8479 }
85- }
80+ }
0 commit comments