-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: further break code down into components
- Loading branch information
1 parent
82e0d20
commit d425ec5
Showing
5 changed files
with
97 additions
and
50 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
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,8 @@ | ||
import * as Mithril from 'mithril'; | ||
import Component from 'flarum/common/Component'; | ||
|
||
export default class PollImage extends Component { | ||
view(): Mithril.Children { | ||
return; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import * as Mithril from 'mithril'; | ||
import Component from 'flarum/common/Component'; | ||
import PollOption from './PollOption'; | ||
import listItems from 'flarum/common/helpers/listItems'; | ||
import ItemList from 'flarum/common/utils/ItemList'; | ||
|
||
export default class PollOptions extends Component { | ||
view(): Mithril.Children { | ||
return ( | ||
<div className="aaa"> | ||
<label className="ba bbb"> | ||
<input | ||
type="radio" | ||
name="privacy-setting" | ||
value="Public access" | ||
className="ccc" | ||
aria-labelledby="privacy-setting-0-label" | ||
aria-describedby="privacy-setting-0-description" | ||
/> | ||
<span className="ddd"> | ||
<span id="privacy-setting-0-label" className="fff"> | ||
Public access | ||
</span> | ||
<span id="privacy-setting-0-description" className="ggg"> | ||
This project would be available to anyone who has the link | ||
</span> | ||
</span> | ||
</label> | ||
{this.pollOptions().toArray()} | ||
<label className="bba bbb"> | ||
<input | ||
type="radio" | ||
name="privacy-setting" | ||
value="Private to you" | ||
className="ccc" | ||
aria-labelledby="privacy-setting-2-label" | ||
aria-describedby="privacy-setting-2-description" | ||
/> | ||
<span className="ddd"> | ||
<span id="privacy-setting-2-label" className="fff"> | ||
Private to you | ||
</span> | ||
<span id="privacy-setting-2-description" className="ggg"> | ||
You are the only one able to access this project | ||
</span> | ||
</span> | ||
</label> | ||
</div> | ||
); | ||
} | ||
|
||
pollOptions(): ItemList<Mithril.Children> { | ||
const items = new ItemList<Mithril.Children>(); | ||
|
||
items.add('test', <PollOption />); | ||
|
||
return items; | ||
} | ||
} |
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