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

Display Fix for Marketplaces#712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
FalkWolsky merged 2 commits intomainfromdev
Feb 25, 2024
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 37 additions & 16 deletionsclient/packages/lowcoder/src/pages/ApplicationV2/HomeLayout.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,7 +34,7 @@ import { isFetchingFolderElements } from "../../redux/selectors/folderSelector";
import { checkIsMobile } from "util/commonUtils";
import MarketplaceHeaderImage from "assets/images/marketplaceHeaderImage.jpg";
import { Divider } from "antd";
import { Margin } from "../setting/theme/styledComponents";
import { Margin } from "../setting/theme/styledComponents";

const Wrapper = styled.div`
display: flex;
Expand DownExpand Up@@ -239,6 +239,7 @@ const LayoutSwitcher = styled.div`
}
`;


function showNewUserGuide(user: User) {
return (
user.orgDev &&
Expand DownExpand Up@@ -278,7 +279,7 @@ export function HomeLayout(props: HomeLayoutProps) {
const { breadcrumb = [], elements = [], localMarketplaceApps = [], globalMarketplaceApps = [],mode } = props;
const user = useSelector(getUser);
const isFetching = useSelector(isFetchingFolderElements);

const isSelfHost = window.location.host !== 'app.lowcoder.cloud';
const [filterBy, setFilterBy] = useState<HomeResKey>("All");
const [searchValue, setSearchValue] = useState("");
const [layout, setLayout] = useState<HomeLayoutType>(
Expand All@@ -294,14 +295,16 @@ export function HomeLayout(props: HomeLayoutProps) {
}

var displayElements = elements;
if (mode === "marketplace") {
if (mode === "marketplace" && isSelfHost) {
const markedLocalApps = localMarketplaceApps.map(app => ({ ...app, isLocalMarketplace: true }));
const markedGlobalApps = globalMarketplaceApps.map(app => ({ ...app, isLocalMarketplace: false }));
// Merge local and global apps into the elements array
displayElements = [...markedLocalApps, ...markedGlobalApps];
}

console.log("HomeLayout: displayElements", displayElements);
else if (mode === "marketplace") {
const markedLocalApps = localMarketplaceApps.map(app => ({ ...app, isLocalMarketplace: true }));
displayElements = [...markedLocalApps];
}

const resList: HomeRes[] = displayElements
.filter((e) =>
Expand DownExpand Up@@ -454,19 +457,37 @@ export function HomeLayout(props: HomeLayoutProps) {
<>
{layout === "list" ? (
<>
<h2 style={{padding: "0 36px"}}>{trans("home.localMarketplaceTitle")}</h2>
<HomeTableView resources={resList.filter(app => app.isLocalMarketplace)} />
<Divider style={{padding: "0 36px", margin: "0 36px", width: "calc(100% - 72px) !important"}}/>
<h2 style={{padding: "0 36px"}}>{trans("home.globalMarketplaceTitle")}</h2>
<HomeTableView resources={resList.filter(app => !app.isLocalMarketplace)} />
{isSelfHost ? (
<>
<h2 style={{ padding: "0 36px" }}>{trans("home.localMarketplaceTitle")}</h2>
<HomeTableView resources={resList.filter(app => app.isLocalMarketplace)} />
<Divider style={{ padding: "0 36px", margin: "0 36px", width: "calc(100% - 72px) !important" }} />
<h2 style={{ padding: "0 36px" }}>{trans("home.globalMarketplaceTitle")}</h2>
<HomeTableView resources={resList.filter(app => !app.isLocalMarketplace)} />
</>
) : (
<>
<h2 style={{padding: "0 36px"}}>{trans("home.globalMarketplaceTitle")}</h2>
<HomeTableView resources={resList.filter(app => app.isLocalMarketplace)} />
</>
)}
</>
) : (
<>
<h2 style={{padding: "0 36px"}}>{trans("home.localMarketplaceTitle")}</h2>
<HomeCardView resources={resList.filter(app => app.isLocalMarketplace)} />
<Divider style={{padding: "0 36px", margin: "12px 36px", width: "calc(100% - 72px) !important"}}/>
<h2 style={{padding: "0 36px"}}>{trans("home.globalMarketplaceTitle")}</h2>
<HomeCardView resources={resList.filter(app => !app.isLocalMarketplace)} />
<>
{isSelfHost ? (
<>
<h2 style={{padding: "0 36px"}}>{trans("home.localMarketplaceTitle")}</h2>
<HomeCardView resources={resList.filter(app => app.isLocalMarketplace)} />
<Divider style={{padding: "0 36px", margin: "12px 36px", width: "calc(100% - 72px) !important"}}/>
<h2 style={{padding: "0 36px"}}>{trans("home.globalMarketplaceTitle")}</h2>
<HomeCardView resources={resList.filter(app => !app.isLocalMarketplace)} />
</>
) : (
<>
<h2 style={{padding: "0 36px"}}>{trans("home.globalMarketplaceTitle")}</h2>
<HomeCardView resources={resList.filter(app => app.isLocalMarketplace)} />
</>
)}
</>
)}
</>
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp