diff --git a/src/DevHub/pages/community/configuration.jsx b/src/DevHub/pages/community/configuration.jsx
index 10cc1f94b..1621d4c04 100644
--- a/src/DevHub/pages/community/configuration.jsx
+++ b/src/DevHub/pages/community/configuration.jsx
@@ -1,15 +1,10 @@
-// Pulls community data
-// Cycles through the addons
-// Creates a tile
-// Supplies the onSubmit and data
-
const {
nearDevGovGigsWidgetsAccountId,
permissions,
handle,
community,
- communityAddonConfigs,
- availableAddons,
+ // communityAddonConfigs, Commenting out to reduce scope on root merge
+ // availableAddons,
deleteCommunity,
updateCommunity,
} = props;
@@ -19,6 +14,7 @@ const [selectedAddon, setSelectedAddon] = useState(null);
const [hasUnsavedChanges, setHasUnsavedChanges] = useState(false);
const sectionSubmit = (sectionData) => {
+ console.log(sectionData);
const updatedCommunityData = {
...Object.entries(sectionData).reduce(
(update, [propertyKey, propertyValue]) => ({
@@ -79,21 +75,6 @@ function CommunityAddonConfigurator({ addonConfig }) {
);
}
-function handleCreateAddon(addonId, value) {
- console.log(value);
- // const uuid = UUID.generate("xxxxxxx");
- // addCommunityAddon({
- // handle,
- // config: {
- // name: "Wiki",
- // config_id: uuid,
- // addon_id: addonId,
- // parameters: JSON.stringify(value),
- // enabled: true,
- // },
- // });
-}
-
return (
(
))}
- {hasConfigurePermissions && (
+ {/* {hasConfigurePermissions && (
- )}
+ )} */}
{hasDeletePermissions && (
deleteCommunity({ handle }),
+ onClick: () => deleteCommunity(nearDevGovGigsContractAccountId, { handle }),
}}
/>
diff --git a/src/DevHub/pages/community/index.jsx b/src/DevHub/pages/community/index.jsx
index 83107f09b..bb02e9b41 100644
--- a/src/DevHub/pages/community/index.jsx
+++ b/src/DevHub/pages/community/index.jsx
@@ -37,6 +37,7 @@ const NavUnderline = styled.ul`
const {
nearDevGovGigsWidgetsAccountId,
+ nearDevGovGigsContractAccountId,
handle,
tab,
permissions,
@@ -45,6 +46,14 @@ const {
availableAddons,
} = props;
+const { href } = VM.require(
+ `${nearDevGovGigsWidgetsAccountId}/widget/DevHub.modules.utils`
+);
+
+if (!href) {
+ return <>>;
+}
+
if (!tab) {
tab = "Activity";
}
@@ -53,32 +62,50 @@ const [isLinkCopied, setLinkCopied] = useState(false);
const tabs = [
{
- iconClass: "bi bi-house-door",
- viewer: "devgovgigs.near/widget/gigs-board.pages.community.activity",
title: "Activity",
+ iconClass: "bi bi-house-door",
+ view: `${nearDevGovGigsWidgetsAccountId}/widget/DevHub.entity.community.Activity`,
+ params: {
+ handle,
+ },
},
- ...(communityAddonConfigs || []).map((addon) => ({
- title: addon.name,
- route: availableAddons.find((it) => it.id === addon.config_id).viewer,
- viewer: availableAddons.find((it) => it.id === addon.config_id).viewer,
- iconClass: addon.icon,
+ {
+ title: "Teams",
+ iconClass: "bi bi-people-fill",
+ view: `${nearDevGovGigsWidgetsAccountId}/widget/DevHub.entity.community.Teams`,
params: {
- viewer: availableAddons.find((it) => it.id === addon.config_id).viewer,
- data: addon.parameters || "", // @elliotBraem not sure which will work better I guess this is needed for the wiki data but we can also add another data object inside the addon's parameters
- ...JSON.parse(addon.parameters), // this seems to work witht the wiki for now
+ handle,
},
- })),
+ },
+
+ // Commenting the below out to reduce scope
+
+ // ...(communityAddonConfigs || []).map((addon) => ({
+ // title: addon.name,
+ // route: availableAddons.find((it) => it.id === addon.config_id).viewer,
+ // viewer: availableAddons.find((it) => it.id === addon.config_id).viewer,
+ // iconClass: addon.icon,
+ // params: {
+ // viewer: availableAddons.find((it) => it.id === addon.config_id).viewer,
+ // data: addon.parameters || "", // @elliotBraem not sure which will work better I guess this is needed for the wiki data but we can also add another data object inside the addon's parameters
+ // ...JSON.parse(addon.parameters), // this seems to work witht the wiki for now
+ // },
+ // })),
];
const onShareClick = () =>
clipboard
.writeText(
- `https://near.org/${nearDevGovGigsWidgetsAccountId}/widget/DevHub.App?page=community?handle=${handle}`
- ) // TODO: how should this be determined?
+ href({
+ gateway: "near.org",
+ widgetSrc: `${nearDevGovGigsWidgetsAccountId}/widget/DevHub.App`,
+ params: { page: "community", handle },
+ })
+ )
.then(setLinkCopied(true));
-// TODO;
-let currentTab = tabs.find((tab) => tab.title == props.tab);
-console.log(currentTab);
+
+let currentTab = tabs.find((it) => it.title === tab);
+
return (
{community.name}
{community.description}
- {props.tab}
{permissions.can_configure && (
-
+
+
+
)}
- {tabs.map(({ defaultActive, params, route, title }) =>
- title ? (
-
-
- {title}
-
-
- ) : null
+ {tabs.map(
+ ({ title }) =>
+ title && (
+
+
+ {title}
+
+
+ )
)}
- {/* TODO: remove */}
-
{tabs.find((tab) => tab.viewer == props.tab)[0]}
-
{tabs.map((tab) => tab.viewer).join(",")}
-
+
+ {currentTab && (
+
+ )}
+
);