Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.

Commit

Permalink
Added conditioning on Soon tab to check if items exist else show plac…
Browse files Browse the repository at this point in the history
…eholder
  • Loading branch information
CamelJuno committed Jun 16, 2022
1 parent 09e65fc commit 6f102f4
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/pages/ecosystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Ecosystem from "../components/ecosystem";
import EcosystemVideoMov from "../videos/ecosystem.mp4";
import EcosystemVideo from "../videos/ecosystem.webm";
import EcosystemPoster from "../videos/ecosystem.png";
import {useEffect} from "react";
import {useState, useEffect} from "react";

const menu = require('../contents/urls.json');
const ecosystems = require('../contents/ecosystems.json');
Expand All @@ -21,8 +21,19 @@ function loadTab(props){
}

const EcosystemPage = (props) => {
function checkSoon(){
for (var index = 0; index < ecosystems.length; ++index) {
var ecosystem = ecosystems[index];
if(ecosystem.category == "Soon"){
setSoon(true);
break;
}
}
}
const [hasSoon, setSoon] = useState(false);
useEffect(() => {
loadTab(props);
checkSoon()
document.getElementById('filter-nav').classList.remove('opened');
window.scrollTo(0,0)
});
Expand Down Expand Up @@ -228,13 +239,18 @@ const EcosystemPage = (props) => {
</div>
</div>
<div className={'row'}>
{ecosystems.map((ecosystem,index) => {
{hasSoon && ecosystems.map((ecosystem,index) => {
return (
ecosystem.category === 'Soon' && (<div key={index} className={'col-6 col-md-3 p-2'}>
<Ecosystem ecosystem={ecosystem}/>
</div>)
)
})}
{!hasSoon &&
<div className={'text-box'} data-sal="fade">
Have an ongoing project coming up on Juno? Let us know. <a className={'p-1'} href={'https://github.com/CosmosContracts/website/pulls'} target={'_blank'} rel={'noreferrer'}><i className={'icon-social-github'} aria-label={'Github'}></i></a>
</div>
}
</div>
</div>

Expand Down

0 comments on commit 6f102f4

Please sign in to comment.