-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from ConnorJamesLow/release/v0.6.1
v0.6.1
- Loading branch information
Showing
7 changed files
with
70 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import jsx from 'texsaur'; | ||
|
||
export const Counter: JSX.Component = () => { | ||
let clicks = 0; | ||
const getMessage = () => `I have been clicked ${clicks} time${clicks++ === 1 ? '' : 's'}.`; | ||
|
||
let display = <span>{getMessage()}</span>; | ||
return ( | ||
<div class="counter"> | ||
<button onclick={() => display.innerHTML = getMessage()}> | ||
{display} | ||
</button> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,28 @@ | ||
import jsx from 'texsaur'; | ||
import { Counter } from './counter'; | ||
import svgTest from './svg-test'; | ||
|
||
interface ExampleProps { | ||
onClick(ev: MouseEvent): any | ||
} | ||
|
||
const Example: JSX.Component<ExampleProps> = ({ onClick }, children) => ( | ||
<div class="example" onclick={onClick}>{children}</div> | ||
<div class="example" onclick={onClick} aria-label="Example">{children}</div> | ||
); | ||
|
||
|
||
const div = <div>Hello there.</div> as HTMLElement; | ||
const span = <span>Hello from inside the Example component!</span>; | ||
const content = <> | ||
{div} | ||
<Example onClick={() => alert('clicked!')}> | ||
Hello from inside the Example component! | ||
{span} | ||
</Example> | ||
<Example onClick={() => console.log(svgTest)}> | ||
{svgTest} | ||
</Example> | ||
<Counter /> | ||
</> as any as HTMLElement[]; | ||
|
||
|
||
export default <main>{content}</main>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import jsx from 'texsaur'; | ||
|
||
export default <> | ||
<svg viewBox="0 -20 100 50"> | ||
<switch> | ||
<text systemLanguage="ar">مرحبا</text> | ||
<text systemLanguage="de,nl">Hallo!</text> | ||
<text systemLanguage="en-us">Howdy!</text> | ||
<text systemLanguage="en-gb">Wotcha!</text> | ||
<text systemLanguage="en-au">G'day!</text> | ||
<text systemLanguage="en">Hello!</text> | ||
<text systemLanguage="es">Hola!</text> | ||
<text systemLanguage="fr">Bonjour!</text> | ||
<text systemLanguage="ja">こんにちは</text> | ||
<text systemLanguage="ru">Привет!</text> | ||
<text>☺</text> | ||
</switch> | ||
</svg> | ||
|
||
<svg viewBox="0 0 300 100" xmlns="http://www.w3.org/2000/svg" stroke="red" fill="grey"> | ||
<circle cx="50" cy="50" r="40" /> | ||
<circle cx="150" cy="50" r="4" /> | ||
|
||
<svg viewBox="0 0 10 10" x="200" width="100"> | ||
<circle cx="5" cy="5" r="4" /> | ||
</svg> | ||
</svg> | ||
</>; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters