Skip to content
Open
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ export default function MyDApp() {

---

| `theme` | `"dark" | "light"` | `"dark"` | Visual theme for the component |

## Advanced Usage

### Composable Steps
Expand Down
3 changes: 3 additions & 0 deletions src/components/TransactionBuilder/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export function TransactionBuilder({
onSubmitted,
className,
showSubmit = true,
theme = 'dark',
}: TransactionBuilderProps) {
const {
state,
Expand Down Expand Up @@ -97,6 +98,7 @@ export function TransactionBuilder({
const networkLabel = network.charAt(0).toUpperCase() + network.slice(1);

return (
<div className={`stx-root stx-theme-${theme} ${className ?? ''}`}>
<div
className={clsx(
"stellar-tx-builder",
Expand Down Expand Up @@ -220,5 +222,6 @@ export function TransactionBuilder({
)}
</div>
</div>
</div>
);
}
19 changes: 19 additions & 0 deletions src/styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,22 @@
.stellar-tx-builder ::-webkit-scrollbar-thumb:hover {
background: theme(colors.slate.600);
}

/* Light theme overrides */
.stx-theme-light {
--stx-bg: #ffffff;
--stx-bg-secondary: #f3f4f6;
--stx-text: #111827;
--stx-text-secondary: #4b5563;
--stx-border: #d1d5db;
--stx-accent: #2563eb;
}

.stx-theme-dark {
--stx-bg: #111827;
--stx-bg-secondary: #1f2937;
--stx-text: #f9fafb;
--stx-text-secondary: #9ca3af;
--stx-border: #374151;
--stx-accent: #3b82f6;
}
3 changes: 3 additions & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ export interface SubmitResult {
successful: boolean;
}

export type Theme = 'dark' | 'light';

export interface TransactionBuilderProps {
/** Stellar network to use */
network?: Network;
Expand All @@ -109,6 +111,7 @@ export interface TransactionBuilderProps {
allowManualSigning?: boolean;
/** Initial operations to pre-populate */
initialOperations?: Partial<Operation>[];
theme?: Theme;
}

export interface ThemeConfig {
Expand Down