diff --git a/src/forge/Information/Component/partner.jsx b/src/forge/Information/Component/partner.jsx index 699d9f187..9cced7031 100644 --- a/src/forge/Information/Component/partner.jsx +++ b/src/forge/Information/Component/partner.jsx @@ -22,17 +22,20 @@ function Partner(props) { },[id]) function getUnit(array){ - const newArray = array.map(e => { + const newArray = [] + for(let i in array) { + let e = array[i] if (e.zonePartnersList && e.zonePartnersList.length > 0) { e.zonePartnersList[0].typeName = e.typeName } - return e.zonePartnersList - }) + if ( e.zonePartnersList.length > 0 ) { + newArray.push(e.zonePartnersList) + } + } while(newArray[1] && newArray[1].length + newArray[0].length <= 5) { newArray[0] = [...newArray[0], ...newArray.splice(1, 1)] } - console.log(newArray) setTopics(newArray) } @@ -47,7 +50,7 @@ function Partner(props) { i.map((j,k1)=>{ return(
) diff --git a/src/forge/Information/Pages/newsDetail.jsx b/src/forge/Information/Pages/newsDetail.jsx index ce20aae94..a6a9d58b6 100644 --- a/src/forge/Information/Pages/newsDetail.jsx +++ b/src/forge/Information/Pages/newsDetail.jsx @@ -45,7 +45,7 @@ function NewsDetail(props){{detail.name}