Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4c8be4b

Browse files
authored
Merge pull requestlowcoder-org#712 from lowcoder-org/dev
Display Fix for Marketplaces
2 parents0a4fd6c +3320fe2 commit4c8be4b

File tree

1 file changed

+37
-16
lines changed

1 file changed

+37
-16
lines changed

‎client/packages/lowcoder/src/pages/ApplicationV2/HomeLayout.tsx‎

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import { isFetchingFolderElements } from "../../redux/selectors/folderSelector";
3434
import{checkIsMobile}from"util/commonUtils";
3535
importMarketplaceHeaderImagefrom"assets/images/marketplaceHeaderImage.jpg";
3636
import{Divider}from"antd";
37-
import{Margin}from"../setting/theme/styledComponents";
37+
import{Margin}from"../setting/theme/styledComponents";
3838

3939
constWrapper=styled.div`
4040
display: flex;
@@ -239,6 +239,7 @@ const LayoutSwitcher = styled.div`
239239
}
240240
`;
241241

242+
242243
functionshowNewUserGuide(user:User){
243244
return(
244245
user.orgDev&&
@@ -278,7 +279,7 @@ export function HomeLayout(props: HomeLayoutProps) {
278279
const{ breadcrumb=[], elements=[], localMarketplaceApps=[], globalMarketplaceApps=[],mode}=props;
279280
constuser=useSelector(getUser);
280281
constisFetching=useSelector(isFetchingFolderElements);
281-
282+
constisSelfHost=window.location.host!=='app.lowcoder.cloud';
282283
const[filterBy,setFilterBy]=useState<HomeResKey>("All");
283284
const[searchValue,setSearchValue]=useState("");
284285
const[layout,setLayout]=useState<HomeLayoutType>(
@@ -294,14 +295,16 @@ export function HomeLayout(props: HomeLayoutProps) {
294295
}
295296

296297
vardisplayElements=elements;
297-
if(mode==="marketplace"){
298+
if(mode==="marketplace"&&isSelfHost){
298299
constmarkedLocalApps=localMarketplaceApps.map(app=>({ ...app,isLocalMarketplace:true}));
299300
constmarkedGlobalApps=globalMarketplaceApps.map(app=>({ ...app,isLocalMarketplace:false}));
300301
// Merge local and global apps into the elements array
301302
displayElements=[...markedLocalApps, ...markedGlobalApps];
302303
}
303-
304-
console.log("HomeLayout: displayElements",displayElements);
304+
elseif(mode==="marketplace"){
305+
constmarkedLocalApps=localMarketplaceApps.map(app=>({ ...app,isLocalMarketplace:true}));
306+
displayElements=[...markedLocalApps];
307+
}
305308

306309
constresList:HomeRes[]=displayElements
307310
.filter((e)=>
@@ -454,19 +457,37 @@ export function HomeLayout(props: HomeLayoutProps) {
454457
<>
455458
{layout==="list" ?(
456459
<>
457-
<h2style={{padding:"0 36px"}}>{trans("home.localMarketplaceTitle")}</h2>
458-
<HomeTableViewresources={resList.filter(app=>app.isLocalMarketplace)}/>
459-
<Dividerstyle={{padding:"0 36px",margin:"0 36px",width:"calc(100% - 72px) !important"}}/>
460-
<h2style={{padding:"0 36px"}}>{trans("home.globalMarketplaceTitle")}</h2>
461-
<HomeTableViewresources={resList.filter(app=>!app.isLocalMarketplace)}/>
460+
{isSelfHost ?(
461+
<>
462+
<h2style={{padding:"0 36px"}}>{trans("home.localMarketplaceTitle")}</h2>
463+
<HomeTableViewresources={resList.filter(app=>app.isLocalMarketplace)}/>
464+
<Dividerstyle={{padding:"0 36px",margin:"0 36px",width:"calc(100% - 72px) !important"}}/>
465+
<h2style={{padding:"0 36px"}}>{trans("home.globalMarketplaceTitle")}</h2>
466+
<HomeTableViewresources={resList.filter(app=>!app.isLocalMarketplace)}/>
467+
</>
468+
) :(
469+
<>
470+
<h2style={{padding:"0 36px"}}>{trans("home.globalMarketplaceTitle")}</h2>
471+
<HomeTableViewresources={resList.filter(app=>app.isLocalMarketplace)}/>
472+
</>
473+
)}
462474
</>
463475
) :(
464-
<>
465-
<h2style={{padding:"0 36px"}}>{trans("home.localMarketplaceTitle")}</h2>
466-
<HomeCardViewresources={resList.filter(app=>app.isLocalMarketplace)}/>
467-
<Dividerstyle={{padding:"0 36px",margin:"12px 36px",width:"calc(100% - 72px) !important"}}/>
468-
<h2style={{padding:"0 36px"}}>{trans("home.globalMarketplaceTitle")}</h2>
469-
<HomeCardViewresources={resList.filter(app=>!app.isLocalMarketplace)}/>
476+
<>
477+
{isSelfHost ?(
478+
<>
479+
<h2style={{padding:"0 36px"}}>{trans("home.localMarketplaceTitle")}</h2>
480+
<HomeCardViewresources={resList.filter(app=>app.isLocalMarketplace)}/>
481+
<Dividerstyle={{padding:"0 36px",margin:"12px 36px",width:"calc(100% - 72px) !important"}}/>
482+
<h2style={{padding:"0 36px"}}>{trans("home.globalMarketplaceTitle")}</h2>
483+
<HomeCardViewresources={resList.filter(app=>!app.isLocalMarketplace)}/>
484+
</>
485+
) :(
486+
<>
487+
<h2style={{padding:"0 36px"}}>{trans("home.globalMarketplaceTitle")}</h2>
488+
<HomeCardViewresources={resList.filter(app=>app.isLocalMarketplace)}/>
489+
</>
490+
)}
470491
</>
471492
)}
472493
</>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp