Skip to content

Commit

Permalink
wrap html elements in fragment
Browse files Browse the repository at this point in the history
looks like in htm you have to do this inside a nested html() template

see developit/htm#175
  • Loading branch information
iandunn committed Jan 31, 2021
1 parent e6eaa8d commit 0412cc3
Showing 1 changed file with 30 additions and 28 deletions.
58 changes: 30 additions & 28 deletions source/components/passphrase-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WordPress dependencies
*/
const { Card, CardHeader, CardBody, Notice, RangeControl } = wp.components;
const { Component } = wp.element;
const { Component, Fragment } = wp.element;
const html = wp.html;
const { shuffle } = lodash;

Expand Down Expand Up @@ -56,33 +56,35 @@ export class PassphraseGenerator extends Component {
` }
${ dependenciesAvailable && html`
<p>
This will show a mix of imported ES and CommonJS modules (with dependencies), for additional testing.
</p>
<${ RangeControl }
label="Number of Words"
marks=${ true }
max=10
min=3
value=${ numberOfWords }
onChange=${ value => this.generate( value ) }
/>
<p>
<strong>Passphrase:</strong> ${ passphrase }
</p>
<p>
<strong>Strength:</strong> ${ ' ' }
<span className="passphrase-strength ${ strength.toLowerCase() }">
${ strength }
</span>
</p>
<p>
<strong>argon2 hash:</strong> <code>${ hash }</code>
</p>
<${ Fragment }>
<p>
This will show a mix of imported ES and CommonJS modules (with dependencies), for additional testing.
</p>
<${ RangeControl }
label="Number of Words"
marks=${ true }
max=10
min=3
value=${ numberOfWords }
onChange=${ value => this.generate( value ) }
/>
<p>
<strong>Passphrase:</strong> ${ passphrase }
</p>
<p>
<strong>Strength:</strong> ${ ' ' }
<span className="passphrase-strength ${ strength.toLowerCase() }">
${ strength }
</span>
</p>
<p>
<strong>argon2 hash:</strong> <code>${ hash }</code>
</p>
<//>
` }
<//>
<//>
Expand Down

0 comments on commit 0412cc3

Please sign in to comment.