-
Notifications
You must be signed in to change notification settings - Fork 76
Closed
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave programtippingCrypto tipping feature using StellarCrypto tipping feature using Stellar
Description
Description
After a tip transaction is submitted, users need clear feedback about whether the transaction succeeded or failed. We need to create a TipConfirmation component that displays transaction results with appropriate actions.
Current State
- TipModal component handles the transaction flow
- No dedicated UI for showing transaction success/error states
- Users need visual confirmation and next steps after tipping
What Needs to Happen
- Create a new
TipConfirmationcomponent atcomponents/tipping/TipConfirmation.tsx - Implement success state UI:
- Success icon/animation (checkmark, confetti, etc.)
- Success message ("Tip sent successfully!")
- Amount sent display
- Recipient username
- Transaction hash with link to Stellar Explorer
- "Send Another Tip" button
- "Close" button
- Implement error state UI:
- Error icon
- Error message display (user-friendly error text)
- Technical error details (collapsible/expandable)
- "Try Again" button
- "Close" button
- Handle different error types:
- Wallet signature rejected
- Insufficient balance
- Network errors
- Invalid transaction
- Timeout errors
- Add transaction hash link generation:
- Testnet:
https://stellar.expert/explorer/testnet/tx/{hash} - Mainnet:
https://stellar.expert/explorer/public/tx/{hash}
- Testnet:
- Create TypeScript interfaces for props
- Add animations for state transitions
Code Structure
// components/tipping/TipConfirmation.tsx
import { getStellarExplorerUrl } from '@/lib/stellar/config';
interface TipConfirmationProps {
state: 'success' | 'error';
amount?: string;
recipientUsername?: string;
txHash?: string;
error?: {
message: string;
details?: string;
code?: string;
};
onClose: () => void;
onRetry?: () => void;
onSendAnother?: () => void;
}
export function TipConfirmation({
state,
amount,
recipientUsername,
txHash,
error,
onClose,
onRetry,
onSendAnother
}: TipConfirmationProps) {
const explorerUrl = txHash ? getStellarExplorerUrl('tx', txHash) : null;
if (state === 'success') {
return (
// Success UI with:
// - Success icon/animation
// - Amount and recipient
// - Transaction hash link
// - "Send Another Tip" and "Close" buttons
);
}
return (
// Error UI with:
// - Error icon
// - Error message
// - Technical details (expandable)
// - "Try Again" and "Close" buttons
);
}Files Affected
components/tipping/TipConfirmation.tsx(NEW)components/tipping/index.ts(UPDATE) - Add exportlib/stellar/config.ts(UPDATE) - AddgetStellarExplorerUrl()helper function
Acceptance Criteria
- TipConfirmation component created with TypeScript
- Success state displays:
- Success icon/animation
- Amount sent and recipient username
- Transaction hash with clickable link to Stellar Explorer
- "Send Another Tip" and "Close" buttons
- Error state displays:
- Error icon
- User-friendly error message
- Expandable technical error details
- "Try Again" and "Close" buttons
- Different error types handled with specific messages
- Stellar Explorer links work correctly for both testnet and mainnet
-
getStellarExplorerUrl()helper added tolib/stellar/config.ts - Component has smooth transitions/animations
- Component is accessible (ARIA attributes, keyboard navigation)
- Component is responsive on mobile and desktop
- Loom video submitted showing both success and error states with different error scenarios
Useful Resources
- Stellar Expert Explorer: https://stellar.expert/
- Framer Motion (for animations): https://www.framer.com/motion/
- Lucide React (for icons): https://lucide.dev/
- Stellar Error Codes: https://developers.stellar.org/docs/data/horizon/api-reference/errors
Notes
- Make error messages user-friendly, not technical jargon
- Consider adding a "Share" button to share successful tips on social media
- Success animation should be celebratory but not overwhelming
- Ensure transaction hash is copyable (click to copy functionality)
- Error details should help users troubleshoot (e.g., "Check your wallet balance")
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave programtippingCrypto tipping feature using StellarCrypto tipping feature using Stellar