react-templates/playground/playground.rt

36 lines
1.2 KiB
Plaintext
Raw Normal View History

<!DOCTYPE rt CodeEditor="./aceEditor">
2014-11-16 16:20:04 +01:00
<div>
2014-11-17 12:27:57 +01:00
<div class="code-area">
2014-11-18 14:00:28 +01:00
<h2>Template:</h2>
2014-11-17 12:27:57 +01:00
<CodeEditor class="large-text-area" style="border: {this.validHTML? '1px solid black':'2px solid red'};"
value="{this.state.templateHTML}"
mode="html"
2014-11-17 12:27:57 +01:00
onChange="(evt) => this.setState({'templateHTML':evt.target.value})"
/>
2014-11-16 16:20:04 +01:00
<br/>
2014-11-18 14:00:28 +01:00
<h2>Class:</h2>
2014-11-17 12:27:57 +01:00
<CodeEditor class="large-text-area" style="border: {this.validProps? '1px solid black':'2px solid red'};"
value="{this.state.templateProps}"
mode="javascript"
onChange="(evt) => this.setState({'templateProps':evt.target.value})"
/>
</div>
2014-11-18 14:00:28 +01:00
<div key="result-area" class="result-area">
<h2>Generated code:</h2>
<CodeEditor class="large-text-area" style="border:1px solid black;"
value="{this.templateSource}"
mode="javascript"
readOnly="{true}"
/>
<br/>
<h2>Preview:</h2>
<div class="sample-view">
<this.sample key="sample">
</this.sample>
</div>
2014-11-17 12:27:57 +01:00
</div>
2014-11-16 16:20:04 +01:00
</div>