diff --git a/apps/builddao/widget/Profile.jsx b/apps/builddao/widget/Profile.jsx index 762cf8e8..8cf8e6a1 100644 --- a/apps/builddao/widget/Profile.jsx +++ b/apps/builddao/widget/Profile.jsx @@ -5,9 +5,6 @@ if (!accountId) { } const profile = Social.getr(`${accountId}/profile`); -if (!profile) { - return ""; -} const ProfileContainer = styled.div` display: grid; diff --git a/apps/builddao/widget/Resources.jsx b/apps/builddao/widget/Resources.jsx index 274bf2cc..381d5132 100644 --- a/apps/builddao/widget/Resources.jsx +++ b/apps/builddao/widget/Resources.jsx @@ -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 ( +
+
{props.name}
+ +
+ ); +} + +if (!mdPath && postAccountId) { + return ( +
+
{props.name}
-if (!mdPath) { - return

No Markdown path configured

; + +
+ ); } return (
{props.name}
- +

No mdPath or post accountId configured

); diff --git a/apps/builddao/widget/app.jsx b/apps/builddao/widget/app.jsx index 9b3bbf69..f3bfeab7 100644 --- a/apps/builddao/widget/app.jsx +++ b/apps/builddao/widget/app.jsx @@ -208,6 +208,7 @@ const Root = styled.div` /* Typeahead Fix */ .rbt-token-removeable { background: #007bff; + color: #fff; } `; diff --git a/apps/builddao/widget/components/modals/event/Form.jsx b/apps/builddao/widget/components/modals/event/Form.jsx index 3e75bc97..ec575cae 100644 --- a/apps/builddao/widget/components/modals/event/Form.jsx +++ b/apps/builddao/widget/components/modals/event/Form.jsx @@ -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: () => <>, @@ -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; @@ -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"); @@ -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: { @@ -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]); } }} > - {item} + + {item} + ))} diff --git a/apps/builddao/widget/components/profile/ProfileInfo.jsx b/apps/builddao/widget/components/profile/ProfileInfo.jsx index c6b7cec9..99994217 100644 --- a/apps/builddao/widget/components/profile/ProfileInfo.jsx +++ b/apps/builddao/widget/components/profile/ProfileInfo.jsx @@ -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 = () => ( { {context.accountId === accountId && ( diff --git a/apps/builddao/widget/config/feed.jsx b/apps/builddao/widget/config/feed.jsx index 56756981..7935787b 100644 --- a/apps/builddao/widget/config/feed.jsx +++ b/apps/builddao/widget/config/feed.jsx @@ -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", @@ -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] `, }, }, @@ -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] `, }, }, @@ -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] `, diff --git a/apps/builddao/widget/config/resources.jsx b/apps/builddao/widget/config/resources.jsx index 3a80614e..75b3e5e0 100644 --- a/apps/builddao/widget/config/resources.jsx +++ b/apps/builddao/widget/config/resources.jsx @@ -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", + }, + }, }, }; diff --git a/apps/builddao/widget/events/ListView.jsx b/apps/builddao/widget/events/ListView.jsx index 3c6f860c..1eb837e0 100644 --- a/apps/builddao/widget/events/ListView.jsx +++ b/apps/builddao/widget/events/ListView.jsx @@ -20,7 +20,10 @@ const currentMonthEvents = events.filter((event) => { case "weekly": case "yearly": case "monthly": - return eventStartDate.getMonth() <= currentDate.getMonth() && eventEndDate.getMonth() >= currentDate.getMonth(); + return ( + eventStartDate.getMonth() <= currentDate.getMonth() && + eventEndDate.getMonth() >= currentDate.getMonth() + ); default: return eventStartDate.getMonth() === currentDate.getMonth(); } @@ -48,7 +51,14 @@ function formatDate(date) { .join(" "); } -function scheduleEventsWeekly(result, year, month, event, interval, daysOfWeek) { +function scheduleEventsWeekly( + result, + year, + month, + event, + interval, + daysOfWeek, +) { const daysInMonth = getDaysInMonth(year, month); for (let day = 1; day <= daysInMonth; day++) { const currentDate = new Date(year, month, day); @@ -86,14 +96,23 @@ const categorizedEvents = currentMonthEvents.reduce((result, event) => { switch (frequency) { case "daily": { for (let day = 1; day <= daysInMonth; day++) { - const formattedDate = getTimeStamp(new Date(currentYear, currentMonth, day)); + const formattedDate = getTimeStamp( + new Date(currentYear, currentMonth, day), + ); result[formattedDate] = result[formattedDate] || []; result[formattedDate].push(event); } break; } case "weekly": { - result = scheduleEventsWeekly(result, currentYear, currentMonth, event, interval, daysOfWeek); + result = scheduleEventsWeekly( + result, + currentYear, + currentMonth, + event, + interval, + daysOfWeek, + ); break; } case "yearly": @@ -101,7 +120,11 @@ const categorizedEvents = currentMonthEvents.reduce((result, event) => { const eventMonth = new Date(event.start).getMonth(); if (eventMonth === currentMonth) { const dateTimeStamp = getTimeStamp( - new Date(currentDate.getFullYear(), eventMonth + 1, new Date(event.start).getDate()), + new Date( + currentDate.getFullYear(), + eventMonth + 1, + new Date(event.start).getDate(), + ), ); if ( (daysOfWeek && daysOfWeek.includes(currentDate.getDay())) || @@ -193,7 +216,8 @@ const futureEvents = }); }) || []; -const pastEvents = dateKeys.filter((date) => !futureEvents.includes(date)) || []; +const pastEvents = + dateKeys.filter((date) => !futureEvents.includes(date)) || []; const sortEvents = (events) => { return events.sort((a, b) => parseInt(a) - parseInt(b)); @@ -224,7 +248,10 @@ const EventGroup = ({ date }) => { {it} @@ -317,7 +344,9 @@ const EventGroup = ({ date }) => { }, }} /> - {organizerProfile.name ?? organizers[0] ?? "No name profile"} + {organizerProfile.name ?? + organizers[0] ?? + "No name profile"} @@ -334,11 +363,20 @@ const EventGroup = ({ date }) => {
- {eventAuthor === context.accountId && ( - )} @@ -354,7 +392,9 @@ const EventGroup = ({ date }) => { const PastEvents = () => { return ( <> - {!pastEvents.length &&

No past events this month.

} + {!pastEvents.length && ( +

No past events this month.

+ )} {pastEvents.map((date, i) => ( ))} @@ -366,9 +406,13 @@ const [showPastEvents, setShowPastEvents] = useState(false); return ( - + {showPastEvents && } - {!futureEvents.length &&

No upcoming events this month

} + {!futureEvents.length && ( +

No upcoming events this month

+ )} {futureEvents.map((date, i) => ( ))} diff --git a/apps/builddao/widget/events/MonthView.jsx b/apps/builddao/widget/events/MonthView.jsx index eb0610a1..ee0f0ee4 100644 --- a/apps/builddao/widget/events/MonthView.jsx +++ b/apps/builddao/widget/events/MonthView.jsx @@ -1,4 +1,6 @@ -const { Modal, Hashtag, Button } = VM.require("buildhub.near/widget/components") || { +const { Modal, Hashtag, Button } = VM.require( + "buildhub.near/widget/components", +) || { Modal: () => <>, Hashtag: () => <>, Button: () => <>, @@ -25,7 +27,9 @@ useEffect(() => { return { ...event, groupId: event.title + "_" + index, - daysOfWeek: event.recurrence.daysOfWeek ?? [new Date(event.start).getDay()], + daysOfWeek: event.recurrence.daysOfWeek ?? [ + new Date(event.start).getDay(), + ], }; default: return event; @@ -198,7 +202,9 @@ return (
-
START
+
+ START +
{new Date(data.start).toLocaleDateString("en-us", { hour: "2-digit", @@ -206,7 +212,9 @@ return ( })}
-
END
+
+ END +
{new Date(data.end).toLocaleDateString("en-us", { hour: "2-digit", @@ -216,13 +224,17 @@ return (
{data.extendedProps.description && (
-
DESCRIPTION
+
+ DESCRIPTION +

{data.extendedProps.description}

)} {organizers.length > 0 && (
-
ORGANIZERS
+
+ ORGANIZERS +
{organizers.map((organizer) => { const organizerProfile = Social.getr(`${organizer}/profile`); @@ -243,7 +255,9 @@ return ( }, }} /> - {organizerProfile.name ?? organizers[0] ?? "No name profile"} + {organizerProfile.name ?? + organizers[0] ?? + "No name profile"} ); })} @@ -252,7 +266,9 @@ return ( )} {hashtags.length > 0 && (
-
HASHTAGS
+
+ HASHTAGS +
{hashtags.map((tag) => ( {tag} @@ -268,11 +284,20 @@ return ( )}
- {eventAuthor === context.accountId && ( - )}