|
|
@@ -1,20 +1,24 @@ |
|
|
|
import { h, FunctionalComponent } from "preact"; |
|
|
|
import { Button, Layout } from "teenyui"; |
|
|
|
import { Button, layout } from "teenyui"; |
|
|
|
|
|
|
|
import { timeout } from "./utils"; |
|
|
|
|
|
|
|
const Main: FunctionalComponent = () => ( |
|
|
|
<Layout> |
|
|
|
<Button onClick={() => alert("You clicked me!")}>Hello World!</Button> |
|
|
|
<Button |
|
|
|
onClick={async () => { |
|
|
|
await timeout(5000); |
|
|
|
alert("You clicked me!"); |
|
|
|
}} |
|
|
|
> |
|
|
|
Delayed Hello! |
|
|
|
</Button> |
|
|
|
</Layout> |
|
|
|
); |
|
|
|
const { Container, Grid } = layout; |
|
|
|
|
|
|
|
export default Main; |
|
|
|
export const Main: FunctionalComponent = () => ( |
|
|
|
<Container> |
|
|
|
<Grid size={4} mobileSize={12} desktopSize={2}> |
|
|
|
<Button onClick={() => alert("You clicked me!")}>Hello World!</Button> |
|
|
|
</Grid> |
|
|
|
<Grid size={8} mobileSize={12} desktopSize={10}> |
|
|
|
<Button |
|
|
|
onClick={async () => { |
|
|
|
await timeout(5000); |
|
|
|
alert("You clicked me!"); |
|
|
|
}} |
|
|
|
> |
|
|
|
Delayed Hello! |
|
|
|
</Button> |
|
|
|
</Grid> |
|
|
|
</Container> |
|
|
|
); |