Skip to content

Commit b2a464f

Browse files
fix: /providers 1193 extension providers[] visibility (#2518)
1 parent c9ee131 commit b2a464f

File tree

1 file changed

+28
-31
lines changed

1 file changed

+28
-31
lines changed

packages/example/src/pages/providers.tsx

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -135,37 +135,34 @@ export default function EthereumProviders() {
135135
) : (
136136
<p>No window.ethereum detected</p>
137137
)}
138-
{providerFlags.length > 0 && (
139-
<>
140-
<h2>eip-1193 providers[]</h2>
141-
<table style={tableStyle}>
142-
<thead>
143-
<tr>
144-
<th style={cellStyle}>#</th>
145-
<th style={cellStyle}>flag</th>
146-
<th style={cellStyle}>value</th>
147-
</tr>
148-
</thead>
149-
<tbody>
150-
{providerFlags.map((flags, idx) =>
151-
Object.entries(flags).map(([key, value], i) => (
152-
<tr key={`${idx}-${key}`}>
153-
{i === 0 && (
154-
<td
155-
style={cellStyle}
156-
rowSpan={Object.keys(flags).length}
157-
>
158-
{idx}
159-
</td>
160-
)}
161-
<td style={cellStyle}>{key}</td>
162-
<td style={cellStyle}>{String(value)}</td>
163-
</tr>
164-
)),
165-
)}
166-
</tbody>
167-
</table>
168-
</>
138+
<h2>eip-1193 providers[]</h2>
139+
{providerFlags.length > 0 ? (
140+
<table style={tableStyle}>
141+
<thead>
142+
<tr>
143+
<th style={cellStyle}>#</th>
144+
<th style={cellStyle}>flag</th>
145+
<th style={cellStyle}>value</th>
146+
</tr>
147+
</thead>
148+
<tbody>
149+
{providerFlags.map((flags, idx) =>
150+
Object.entries(flags).map(([key, value], i) => (
151+
<tr key={`${idx}-${key}`}>
152+
{i === 0 && (
153+
<td style={cellStyle} rowSpan={Object.keys(flags).length}>
154+
{idx}
155+
</td>
156+
)}
157+
<td style={cellStyle}>{key}</td>
158+
<td style={cellStyle}>{String(value)}</td>
159+
</tr>
160+
)),
161+
)}
162+
</tbody>
163+
</table>
164+
) : (
165+
<p>No providers detected</p>
169166
)}
170167
</section>
171168
<section>

0 commit comments

Comments
 (0)