Skip to content

Commit

Permalink
Cleanup Gateway (#221)
Browse files Browse the repository at this point in the history
* Add modern layout for profile

* Add light mode for page

* fix

* Remove Resoluion, Answer, and Opportunity feed

* Remove Task Feed

* Configure adding posts to resources

* Remove documentation feed

* Remove custom event button

* Revert "fix"

This reverts commit c61a1d0.

* Revert "Add light mode for page"

This reverts commit 28676cd.

* Revert "Add modern layout for profile"

This reverts commit 60e72ea.

* Fix no display on new profiles

* Fix formatting issues
  • Loading branch information
itexpert120 authored Mar 20, 2024
1 parent a6c8add commit ab57343
Show file tree
Hide file tree
Showing 9 changed files with 152 additions and 138 deletions.
3 changes: 0 additions & 3 deletions apps/builddao/widget/Profile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ if (!accountId) {
}

const profile = Social.getr(`${accountId}/profile`);
if (!profile) {
return "";
}

const ProfileContainer = styled.div`
display: grid;
Expand Down
30 changes: 27 additions & 3 deletions apps/builddao/widget/Resources.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,43 @@ const { Header } = VM.require("buildhub.near/widget/components.Header") || {
Header: () => <></>,
};

const { Post } = VM.require("buildhub.near/widget/components") || {
Post: () => <></>,
};

const { MarkdownView } = VM.require("buildhub.near/widget/md-view") || {
MarkdownView: () => <></>,
};

const mdPath = props.mdPath;
const postAccountId = props.postAccountId;

if (mdPath && !postAccountId) {
return (
<div>
<Header>{props.name}</Header>
<MarkdownView path={mdPath} />
</div>
);
}

if (!mdPath && postAccountId) {
return (
<div>
<Header>{props.name}</Header>

if (!mdPath) {
return <p>No Markdown path configured</p>;
<Post
accountId={postAccountId}
blockHeight={props.postBlockHeight}
noBorder={true}
/>
</div>
);
}

return (
<div>
<Header>{props.name}</Header>
<MarkdownView path={mdPath} />
<p>No mdPath or post accountId configured</p>
</div>
);
1 change: 1 addition & 0 deletions apps/builddao/widget/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ const Root = styled.div`
/* Typeahead Fix */
.rbt-token-removeable {
background: #007bff;
color: #fff;
}
`;

Expand Down
21 changes: 17 additions & 4 deletions apps/builddao/widget/components/modals/event/Form.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const { Modal, Button, ProgressState } = VM.require("buildhub.near/widget/components") || {
const { Modal, Button, ProgressState } = VM.require(
"buildhub.near/widget/components",
) || {
Modal: () => <></>,
Button: () => <></>,
ProgressState: () => <></>,
Expand All @@ -8,7 +10,8 @@ const bootstrapTheme = props.bootstrapTheme || "dark";

const Wrapper = styled.div`
.btn-close {
filter: invert(39%) sepia(45%) saturate(6660%) hue-rotate(199deg) brightness(101%) contrast(104%) !important;
filter: invert(39%) sepia(45%) saturate(6660%) hue-rotate(199deg)
brightness(101%) contrast(104%) !important;
}
.rbt-token-label {
color: white !important;
Expand Down Expand Up @@ -220,6 +223,7 @@ const [startTime, setStartTime] = useState(getCurrentTime());
const [endTime, setEndTime] = useState(getCurrentTime());
const [location, setLocation] = useState("");
const [hashtags, setHashtags] = useState([]);
// const [customButtonSrc, setCustomButtonSrc] = useState("");
const [repeat, setRepeat] = useState(false);
const [customModal, setCustomModal] = useState(false);
const [customFrequency, setCustomFrequency] = useState("weekly");
Expand Down Expand Up @@ -343,6 +347,7 @@ const onSubmit = () => {
hashtags, // this can be moved to metadata.tags, but must be object with keys, e.g { [hashtag]: "" }
// this i'll leave up to you but we need them for filtering
cover: state.image,
// customButtonSrc: customButtonSrc,
},
}),
metadata: {
Expand Down Expand Up @@ -426,13 +431,21 @@ const CustomRepeatInputModal = () => {
className="cursor-pointer"
onClick={() => {
if (customDaysOfWeek.includes(item)) {
setCustomDaysOfWeek(customDaysOfWeek.filter((i) => i !== item));
setCustomDaysOfWeek(
customDaysOfWeek.filter((i) => i !== item),
);
} else {
setCustomDaysOfWeek([...customDaysOfWeek, item]);
}
}}
>
<ProgressState status={customDaysOfWeek.includes(item) ? "focused" : "default"}>{item}</ProgressState>
<ProgressState
status={
customDaysOfWeek.includes(item) ? "focused" : "default"
}
>
{item}
</ProgressState>
</div>
))}
</div>
Expand Down
10 changes: 5 additions & 5 deletions apps/builddao/widget/components/profile/ProfileInfo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ const { Button, Hashtag } = VM.require("buildhub.near/widget/components") || {
const accountId = props.accountId || context.accountId;

const profile = Social.getr(`${accountId}/profile`);
if (!profile) {
return "";
}

const CopyIcon = () => (
<svg
Expand Down Expand Up @@ -40,7 +37,6 @@ const Container = styled.div`
width: 4rem !important;
height: 4rem !important;
border-radius: 100%;
image-rendering: pixelated;
object-fit: cover;
}
}
Expand Down Expand Up @@ -273,7 +269,11 @@ const InfoSection = () => {
<Widget
src="mob.near/widget/Image"
loading=""
props={{ image: profile.image }}
props={{
image: profile.image,
fallbackUrl:
"https://ipfs.near.social/ipfs/bafkreig5wfjcbvhoipnylbe2rh2tirt5zi3n3iu55aq5phbd5m2zcc6ppu",
}}
/>

{context.accountId === accountId && (
Expand Down
100 changes: 0 additions & 100 deletions apps/builddao/widget/config/feed.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,6 @@ return {
requiredHashtags: ["build"],
},
},
resolutions: {
path: "buildhub.near/widget/Feed",
blockHeight: "final",
init: {
name: "Resolutions", // maybe these should be moved to navbar specific
icon: "bi-calendar3",
requiredHashtags: ["build", "resolution", "nearyearresolutions2024"],
template: `### 🎉 NEAR YEAR RESOLUTIONS: 2024
(posted via [${daoName} Gateway](${feedLink}))
**🌟 REFLECTIONS ON THE PAST YEAR:**
- [Reflection 1 from the past year]
- [Reflection 2 from the past year]
**🎯 NEW YEAR'S RESOLUTIONS:**
- [Resolution 1]
- [Resolution 2]
**📊 MEASURING SUCCESS:**
- [Metric 1 for Success]
- [Metric 2 for Success]
`,
},
},
updates: {
path: "buildhub.near/widget/Feed",
blockHeight: "final",
Expand All @@ -67,30 +43,6 @@ return {
**🛑 BLOCKERS**
- [what's blocking you?]
- [how can someone help?]
`,
},
},
documentation: {
path: "buildhub.near/widget/Feed",
blockHeight: "final",
init: {
name: "Documentation",
icon: "bi-book",
requiredHashtags: ["build", "documentation"],
template: `## TITLE
(posted via [${daoName} Gateway](${feedLink}?tab=documentation))
**WHAT IS _____?**
- [context]
- [why is it important?]
**EXAMPLE**
- [how can this be demonstrated?]
- [what is the expected outcome?]
**USAGE**
- [where is it used?]
- [how to use it]
`,
},
},
Expand All @@ -106,40 +58,6 @@ return {
[what are you thinking about?]
[why are you asking?]
`,
},
},
answer: {
path: "buildhub.near/widget/Feed",
blockHeight: "final",
init: {
name: "Answer",
icon: "bi-journal-code",
requiredHashtags: ["build", "answer"],
template: `## Share an answer
(posted via [${daoName} Gateway](${feedLink}?tab=answer))
[please restate the question you are answering]
[your answer]
[link to relevant docs, examples, or resources]
`,
},
},
opportunity: {
path: "buildhub.near/widget/Feed",
blockHeight: "final",
init: {
name: "Opportunity",
icon: "bi-briefcase",
requiredHashtags: ["build", "opportunity"],
template: `## TITLE
(posted via [${daoName} Gateway](${feedLink}?tab=opportunity))
[what is the opportunity?]
[explain the motivation or reason]
`,
},
},
Expand All @@ -156,24 +74,6 @@ return {
**What idea are you proposing?**
- [Describe the idea]
**Context or additional information:**
- [Provide any context or details]
`,
},
},
task: {
path: "buildhub.near/widget/Feed",
blockHeight: "final",
init: {
name: "Task",
icon: "bi-check-lg",
requiredHashtags: ["build", "task"],
template: `## TASK TITLE
(posted via [${daoName} Gateway](${feedLink}?tab=task))
**What needs to be done?**
- [Describe the task or action steps]
**Context or additional information:**
- [Provide any context or details]
`,
Expand Down
10 changes: 10 additions & 0 deletions apps/builddao/widget/config/resources.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,15 @@ return {
"https://raw.githubusercontent.com/NEARBuilders/gateway/main/resources.md",
},
},
deployWeb4: {
path: "buildhub.near/widget/Resources",
blockHeight: "final",
init: {
name: "Deploying to Web4",
icon: "bi-rocket",
postAccountId: "efiz.near",
postBlockHeight: "113409716",
},
},
},
};
Loading

0 comments on commit ab57343

Please sign in to comment.