Skip to content
This repository was archived by the owner on Mar 16, 2026. It is now read-only.

Commit 25711ba

Browse files
authored
Merge pull request #713 from aibtcdev/cleanups1
update
2 parents bfd63d3 + 040589b commit 25711ba

4 files changed

Lines changed: 108 additions & 92 deletions

File tree

src/app/application-layout.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,23 +253,23 @@ export default function ApplicationLayout({
253253
<div className="flex justify-center items-center gap-6 relative z-10"></div>
254254

255255
{/* Right Section - Navigation Links, BTC Balance Dropdown & Auth Button */}
256-
<div className="flex items-center gap-6 relative z-10 justify-end">
256+
<div className="flex items-center gap-2 lg:gap-3 xl:gap-6 relative z-10 justify-end flex-nowrap">
257257
<a
258258
href="https://docs.aibtc.com/how-aibtc-works"
259-
className="text-sm font-medium text-foreground/80 hover:text-foreground transition-colors duration-200"
259+
className="text-xs lg:text-sm font-medium text-foreground/80 hover:text-foreground transition-colors duration-200 whitespace-nowrap"
260260
target="_blank"
261261
>
262262
How it works
263263
</a>
264264
<Link
265265
href="/aibtc-charter"
266-
className="text-sm font-medium text-foreground/80 hover:text-foreground transition-colors duration-200"
266+
className="text-xs lg:text-sm font-medium text-foreground/80 hover:text-foreground transition-colors duration-200 whitespace-nowrap"
267267
>
268268
AIBTC Charter
269269
</Link>
270270
<Link
271271
href="/leaderboard"
272-
className="text-sm font-medium text-foreground/80 hover:text-foreground transition-colors duration-200"
272+
className="text-xs lg:text-sm font-medium text-foreground/80 hover:text-foreground transition-colors duration-200 whitespace-nowrap"
273273
>
274274
Leaderboard
275275
</Link>

src/components/auth/StacksAuth.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,13 @@ const StacksProvider = dynamic(
5454
}
5555
);
5656

57-
export default function StacksAuth({ redirectUrl }: { redirectUrl?: string }) {
57+
export default function StacksAuth({
58+
redirectUrl,
59+
buttonText = "Join AIBTC",
60+
}: {
61+
redirectUrl?: string;
62+
buttonText?: string;
63+
}) {
5864
const [mounted, setMounted] = useState(false);
5965
const [isLoading, setIsLoading] = useState(false);
6066
const [showTerms, setShowTerms] = useState(false);
@@ -342,7 +348,9 @@ export default function StacksAuth({ redirectUrl }: { redirectUrl?: string }) {
342348
</span>
343349
</>
344350
) : (
345-
<span className="font-inter font-bold tracking-wide">Join AIBTC</span>
351+
<span className="font-inter font-bold tracking-wide">
352+
{buttonText}
353+
</span>
346354
)}
347355
</Button>
348356

src/components/home/AuthButton.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,18 @@ const SignIn = dynamic(() => import("../auth/StacksAuth"), {
77

88
interface AuthButtonProps {
99
redirectUrl?: string;
10+
buttonText?: string;
1011
}
1112

12-
export default function AuthButton({ redirectUrl }: AuthButtonProps) {
13+
export default function AuthButton({
14+
redirectUrl,
15+
buttonText,
16+
}: AuthButtonProps) {
1317
return (
14-
<div className="flex items-center justify-center px-2 py-1 sm:px-4 sm:py-2 text-sm sm:text-base">
18+
<div>
1519
{/* Sign In Section */}
16-
<div className="w-auto">
17-
<SignIn redirectUrl={redirectUrl} />
20+
<div>
21+
<SignIn redirectUrl={redirectUrl} buttonText={buttonText} />
1822
</div>
1923
</div>
2024
);

src/components/proposals/ProposalSubmission.tsx

Lines changed: 86 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ import {
6767
getLinkedXProfile,
6868
type XProfile,
6969
} from "@/services/x-auth.service";
70+
import AuthButton from "@/components/home/AuthButton";
7071

7172
interface WebSocketTransactionMessage {
7273
tx_id: string;
@@ -1252,7 +1253,7 @@ export function ProposalSubmission({
12521253
</div>
12531254
<div>
12541255
<h3 className="text-xl font-bold mb-2">
1255-
Connect Wallet to unlock earning.
1256+
Connect your testnet Bitcoin Wallet.
12561257
</h3>
12571258
</div>
12581259
</div>
@@ -1683,88 +1684,91 @@ export function ProposalSubmission({
16831684

16841685
{/* Footer CTA */}
16851686
<div className="pt-6">
1686-
<div>
1687-
<Button
1688-
onClick={handleSubmit}
1689-
disabled={
1690-
!hasAccessToken ||
1691-
!twitterUrl.trim() ||
1692-
!isValidTwitterUrl ||
1693-
isSubmitting ||
1694-
isValidatingXUsername ||
1695-
!hasAgentAccount ||
1696-
// !hasDaoTokens ||
1697-
// !hasAgentDaoTokens ||
1698-
isLoadingExtensions ||
1699-
isLoadingAgents ||
1700-
// isLoadingBalance ||
1701-
isCheckingBitcoinBlock ||
1702-
hasProposalInCurrentBlock ||
1703-
needsXLink ||
1704-
isXLoading ||
1705-
isLoadingEmbed ||
1706-
!twitterEmbedData ||
1707-
!!xUsernameError ||
1708-
!canSubmitContribution
1709-
}
1710-
className="bg-primary hover:bg-primary/90 text-primary-foreground font-bold px-6 py-2 text-sm rounded-sm shadow-md hover:shadow-lg transition-all duration-200"
1711-
>
1712-
{isSubmitting ? (
1713-
<div className="flex items-center gap-2 text-center px-2">
1714-
<Loader />
1715-
<span className="break-words">
1716-
{submissionButtonText || "Processing..."}
1687+
{!hasAccessToken ? (
1688+
<AuthButton buttonText="Connect Wallet" />
1689+
) : (
1690+
<div>
1691+
<Button
1692+
onClick={handleSubmit}
1693+
disabled={
1694+
!twitterUrl.trim() ||
1695+
!isValidTwitterUrl ||
1696+
isSubmitting ||
1697+
isValidatingXUsername ||
1698+
!hasAgentAccount ||
1699+
// !hasDaoTokens ||
1700+
// !hasAgentDaoTokens ||
1701+
isLoadingExtensions ||
1702+
isLoadingAgents ||
1703+
// isLoadingBalance ||
1704+
isCheckingBitcoinBlock ||
1705+
hasProposalInCurrentBlock ||
1706+
needsXLink ||
1707+
isXLoading ||
1708+
isLoadingEmbed ||
1709+
!twitterEmbedData ||
1710+
!!xUsernameError ||
1711+
!canSubmitContribution
1712+
}
1713+
className="bg-primary hover:bg-primary/90 text-primary-foreground font-bold px-6 py-2 text-sm rounded-sm shadow-md hover:shadow-lg transition-all duration-200"
1714+
>
1715+
{isSubmitting ? (
1716+
<div className="flex items-center gap-2 text-center px-2">
1717+
<Loader />
1718+
<span className="break-words">
1719+
{submissionButtonText || "Processing..."}
1720+
</span>
1721+
</div>
1722+
) : needsXLink ? (
1723+
<span>Link X Account to Submit</span>
1724+
) : verificationStatus.status === "pending" ? (
1725+
<div className="flex items-center gap-2">
1726+
<Loader />
1727+
<span>X Verification Pending</span>
1728+
</div>
1729+
) : // : verificationStatus.status === "not_verified" ? (
1730+
// <div className="flex items-center gap-2">
1731+
// <Lock className="w-4 h-4" />
1732+
// <span>X Account Not Verified</span>
1733+
// </div>
1734+
// )
1735+
isValidatingXUsername ? (
1736+
<div className="flex items-center gap-2">
1737+
<Loader />
1738+
<span>Validating X Username...</span>
1739+
</div>
1740+
) : xUsernameError ? (
1741+
<span>Fix X Username to Submit</span>
1742+
) : !hasAgentAccount ? (
1743+
<span>Waiting for Agent Account</span>
1744+
) : // !hasAgentDaoTokens ? (
1745+
// <span>Join DAO to Submit</span>
1746+
// ) :
1747+
isCheckingBitcoinBlock ? (
1748+
<div className="flex items-center gap-2 text-center px-2">
1749+
<Loader />
1750+
<span className="break-words">
1751+
Checking Bitcoin Block...
1752+
</span>
1753+
</div>
1754+
) : hasProposalInCurrentBlock && currentBitcoinBlock ? (
1755+
<span>
1756+
Wait for Block {(currentBitcoinBlock + 1).toLocaleString()}
17171757
</span>
1718-
</div>
1719-
) : !hasAccessToken ? (
1720-
<span>Connect Wallet to Submit</span>
1721-
) : needsXLink ? (
1722-
<span>Link X Account to Submit</span>
1723-
) : verificationStatus.status === "pending" ? (
1724-
<div className="flex items-center gap-2">
1725-
<Loader />
1726-
<span>X Verification Pending</span>
1727-
</div>
1728-
) : // : verificationStatus.status === "not_verified" ? (
1729-
// <div className="flex items-center gap-2">
1730-
// <Lock className="w-4 h-4" />
1731-
// <span>X Account Not Verified</span>
1732-
// </div>
1733-
// )
1734-
isValidatingXUsername ? (
1735-
<div className="flex items-center gap-2">
1736-
<Loader />
1737-
<span>Validating X Username...</span>
1738-
</div>
1739-
) : xUsernameError ? (
1740-
<span>Fix X Username to Submit</span>
1741-
) : !hasAgentAccount ? (
1742-
<span>Waiting for Agent Account</span>
1743-
) : // !hasAgentDaoTokens ? (
1744-
// <span>Join DAO to Submit</span>
1745-
// ) :
1746-
isCheckingBitcoinBlock ? (
1747-
<div className="flex items-center gap-2 text-center px-2">
1748-
<Loader />
1749-
<span className="break-words">Checking Bitcoin Block...</span>
1750-
</div>
1751-
) : hasProposalInCurrentBlock && currentBitcoinBlock ? (
1752-
<span>
1753-
Wait for Block {(currentBitcoinBlock + 1).toLocaleString()}
1754-
</span>
1755-
) : isLoadingEmbed ? (
1756-
<div className="flex items-center gap-2 text-center px-2">
1757-
<Loader />
1758-
<span className="break-words">Loading Post Content...</span>
1759-
</div>
1760-
) : (
1761-
<div className="flex items-center gap-2">
1762-
<Send className="h-4 w-4" />
1763-
<span>Submit Contribution</span>
1764-
</div>
1765-
)}
1766-
</Button>
1767-
</div>
1758+
) : isLoadingEmbed ? (
1759+
<div className="flex items-center gap-2 text-center px-2">
1760+
<Loader />
1761+
<span className="break-words">Loading Post Content...</span>
1762+
</div>
1763+
) : (
1764+
<div className="flex items-center gap-2">
1765+
<Send className="h-4 w-4" />
1766+
<span>Submit Contribution</span>
1767+
</div>
1768+
)}
1769+
</Button>
1770+
</div>
1771+
)}
17681772
</div>
17691773
</div>
17701774

0 commit comments

Comments
 (0)