Skip to content

Commit

Permalink
+ channel list
Browse files Browse the repository at this point in the history
  • Loading branch information
BlowaterNostr committed Feb 21, 2024
1 parent 6065e81 commit db5d4b1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/UI/channel-list.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { h, render } from "https://esm.sh/preact@10.17.1";
import { ChannelList } from "./channel-list.tsx";

render(<ChannelList channels={["general", "games", "work"]}></ChannelList>, document.body);
21 changes: 21 additions & 0 deletions app/UI/channel-list.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Component, h } from "https://esm.sh/preact@10.17.1";

type Props = {
channels: string[];
};

type State = {};

export class ChannelList extends Component<Props, State> {
render() {
return (
<div>
{this.props.channels.map((c) => ChannelListItem(c))}
</div>
);
}
}

function ChannelListItem(name: string) {
return <div># {name}</div>;
}
5 changes: 4 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"compilerOptions": {
"checkJs": false
"checkJs": false,
"jsx": "react",
"jsxFactory": "h",
"jsxFragmentFactory": "Fragment"
},
"lint": {
"rules": {
Expand Down

0 comments on commit db5d4b1

Please sign in to comment.