Skip to content

Commit 497d689

Browse files
authored
Merge pull request #290 from Ejirowebfi/feat/issue-238-trade-creation
Feat/issue 238 Trade Creation Interface
2 parents fa7a779 + 0678078 commit 497d689

3 files changed

Lines changed: 490 additions & 0 deletions

File tree

frontend/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ <h1 class="logo">
8181
<li role="none"><a href="#trade-dashboard" role="menuitem" class="nav-link" data-i18n="nav.tradeDashboard">My Trades</a></li>
8282
<li role="none"><a href="#events" role="menuitem" class="nav-link" data-i18n="nav.events">View Events</a></li>
8383
<li role="none"><a href="#search" role="menuitem" class="nav-link" data-i18n="nav.search">Search</a></li>
84+
<li role="none"><a href="#create-trade" role="menuitem" class="nav-link" data-i18n="nav.createTrade">Create Trade</a></li>
8485
<li role="none"><a href="#history" role="menuitem" class="nav-link" data-i18n="nav.history">History</a></li>
8586
<li role="none"><a href="#disputes" role="menuitem" class="nav-link" data-i18n="nav.disputes">Disputes</a></li>
8687
<li role="none"><a href="#arbitrator" role="menuitem" class="nav-link" data-i18n="nav.arbitrator">Arbitrator</a></li>
@@ -1111,6 +1112,16 @@ <h3>API Accessibility Features</h3>
11111112
</div>
11121113
</div>
11131114
</section>
1115+
<!-- Create Trade Section -->
1116+
<section id="create-trade" aria-labelledby="tc-heading" class="section">
1117+
<div class="container">
1118+
<h2 id="tc-heading" class="section-title">Create Trade</h2>
1119+
<div class="td-panel tc-panel-wrap">
1120+
<div id="tc-panel" role="region" aria-live="polite" aria-label="Trade creation form"></div>
1121+
</div>
1122+
</div>
1123+
</section>
1124+
11141125
<!-- Transaction History Section -->
11151126
<section id="history" aria-labelledby="hx-heading" class="section">
11161127
<div class="container">
@@ -1237,5 +1248,6 @@ <h2 id="error-modal-title" class="error-modal-title">Something went wrong</h2>
12371248
<script type="module" src="app.js"></script>
12381249
<script src="dashboard.js"></script>
12391250
<script src="history.js"></script>
1251+
<script src="trade-create.js"></script>
12401252
</body>
12411253
</html>

frontend/styles.css

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2959,3 +2959,96 @@ body.offline .offline-indicator {
29592959
.hx-timeline-item { flex-wrap: wrap; }
29602960
.hx-timeline-time { margin-left: 0; }
29612961
}
2962+
2963+
/* ============================================================
2964+
Trade Creation Interface (#238)
2965+
============================================================ */
2966+
2967+
.tc-panel-wrap { max-width: 560px; }
2968+
2969+
.tc-form { display: flex; flex-direction: column; gap: var(--space-md); }
2970+
2971+
.tc-field { display: flex; flex-direction: column; gap: var(--space-xs); }
2972+
2973+
.tc-label {
2974+
font-size: var(--font-size-sm);
2975+
font-weight: 500;
2976+
color: var(--color-text-secondary);
2977+
}
2978+
2979+
.tc-optional { color: var(--color-text-muted); font-weight: 400; }
2980+
2981+
.tc-addr-input { font-family: monospace; font-size: var(--font-size-sm); }
2982+
2983+
.tc-amount-row { flex-direction: row; align-items: flex-end; gap: var(--space-sm); }
2984+
.tc-amount-group { flex: 1; display: flex; flex-direction: column; gap: var(--space-xs); }
2985+
.tc-currency-group { display: flex; flex-direction: column; gap: var(--space-xs); }
2986+
2987+
.tc-arb-select { width: 100%; }
2988+
2989+
.tc-field-error {
2990+
font-size: var(--font-size-sm);
2991+
color: var(--color-error, #f87171);
2992+
}
2993+
2994+
.tc-input-error {
2995+
border-color: var(--color-error, #f87171) !important;
2996+
outline-color: var(--color-error, #f87171);
2997+
}
2998+
2999+
.tc-actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; margin-top: var(--space-sm); }
3000+
3001+
/* Preview */
3002+
.tc-preview-note {
3003+
color: var(--color-text-muted);
3004+
font-size: var(--font-size-sm);
3005+
margin-bottom: var(--space-md);
3006+
}
3007+
3008+
.tc-preview-grid { margin-bottom: var(--space-lg); }
3009+
3010+
.tc-fee-note { color: var(--color-text-secondary); }
3011+
.tc-fee-hint { font-size: var(--font-size-sm); color: var(--color-text-muted); }
3012+
3013+
/* State panels (submitting / success / error) */
3014+
.tc-state-panel {
3015+
display: flex;
3016+
flex-direction: column;
3017+
align-items: center;
3018+
text-align: center;
3019+
padding: var(--space-xl) var(--space-lg);
3020+
gap: var(--space-sm);
3021+
}
3022+
3023+
.tc-state-title { font-size: var(--font-size-lg); font-weight: 600; }
3024+
3025+
.tc-spinner {
3026+
display: inline-block;
3027+
width: 36px; height: 36px;
3028+
border: 3px solid var(--color-border);
3029+
border-top-color: var(--color-accent-primary);
3030+
border-radius: 50%;
3031+
animation: tc-spin 0.8s linear infinite;
3032+
}
3033+
@keyframes tc-spin { to { transform: rotate(360deg); } }
3034+
3035+
.tc-success-icon {
3036+
font-size: 2.5rem;
3037+
color: #22c55e;
3038+
line-height: 1;
3039+
}
3040+
3041+
.tc-error-icon {
3042+
font-size: 2.5rem;
3043+
color: var(--color-error, #f87171);
3044+
line-height: 1;
3045+
}
3046+
3047+
.tc-error-msg { color: var(--color-error, #f87171); max-width: 400px; }
3048+
3049+
.tc-tx-hash { font-size: var(--font-size-sm); color: var(--color-text-muted); word-break: break-all; }
3050+
3051+
@media (max-width: 640px) {
3052+
.tc-amount-row { flex-direction: column; }
3053+
.tc-panel-wrap { max-width: 100%; }
3054+
}

0 commit comments

Comments
 (0)