Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project page update #53

Merged
merged 9 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions dapp/public/icons/check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions dapp/public/icons/failed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 10 additions & 6 deletions dapp/src/components/Commit.astro
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@ import PrimaryButton from "./utils/PrimaryButton.astro";
import { commitHash } from "../service/WriteContractService";
import { loadProjectInfo } from "../service/StateService";
import { loadedPublicKey } from "./stellar-wallets-kit";
import { latestCommit } from "../utils/store";
import { latestCommit, projectInfoLoaded } from "../utils/store";

document.addEventListener("astro:page-load", () => {
function updateCommitSectionVisibility() {
const projectInfo = loadProjectInfo();

if (projectInfo) {
const connectedPublicKey = loadedPublicKey();
const isMaintainer = connectedPublicKey
? projectInfo.maintainers.includes(connectedPublicKey)
: false;
? projectInfo.maintainers.includes(connectedPublicKey)
: false;
const updateCommitSection = document.getElementById(
"update-commit-section",
);
Expand All @@ -66,9 +66,13 @@ import PrimaryButton from "./utils/PrimaryButton.astro";
}
}
}

// Call the function when the page loads
updateCommitSectionVisibility();
projectInfoLoaded.subscribe((loaded) => {
if (loaded) {
updateCommitSectionVisibility();
}
});

const commit_hash = document.getElementById(
"commit_hash",
Expand Down
2 changes: 1 addition & 1 deletion dapp/src/components/CommitRecord.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const CommitRecord = ({

return (
<div
className={`commit-record relative bg-white pt-5 pb-3 px-4 rounded-lg border border-gray-200 shadow-sm flex justify-between items-start ${isLatestCommit ? "border-2 border-blue-300 bg-zinc-300" : ""}`}
className={`commit-record relative bg-white pt-5 pb-3 px-4 rounded-lg border border-gray-200 shadow-sm flex justify-between items-start ${isLatestCommit ? "border-2 border-lime bg-zinc-300" : ""}`}
data-sha={sha}
id={isLatestCommit ? "latest-commit-record" : undefined}
>
Expand Down
Loading
Loading