@@ -13,15 +13,19 @@ class App {
13
13
*/
14
14
async initialize ( url ) {
15
15
const root = document . getElementById ( 'root' ) ;
16
- const header = Util . createAndAppend ( 'div' , root , { id : 'header' } ) ;
17
- Util . createAndAppend ( 'img' , header , { src : './hyf.png' , alt : 'HackYourFuture logo' } ) ;
16
+ const header = Util . createAndAppend ( 'header' , root , { id : 'header' } ) ;
17
+ const figure = Util . createAndAppend ( 'figure' , header , {
18
+ src : './hyf.png' ,
19
+ alt : 'HackYourFuture logo' ,
20
+ } ) ;
21
+ Util . createAndAppend ( 'img' , figure , { src : './hyf.png' , alt : 'HackYourFuture logo' } ) ;
18
22
Util . createAndAppend ( 'h1' , header , { text : 'HackYourFuture Github Repositories' } ) ;
19
- const choice = Util . createAndAppend ( 'div ' , root , { id : 'choice' } ) ;
23
+ const choice = Util . createAndAppend ( 'section ' , root , { id : 'choice' } ) ;
20
24
Util . createAndAppend ( 'h3' , choice , { text : 'Please Select a Repository Below' } ) ;
21
- const selection = Util . createAndAppend ( 'div ' , choice , { id : 'selection' } ) ;
25
+ const selection = Util . createAndAppend ( 'section ' , choice , { id : 'selection' } ) ;
22
26
Util . createAndAppend ( 'p' , selection , { text : 'HYF Repositories: ' } ) ;
23
27
const opt = Util . createAndAppend ( 'select' , selection , { id : 'select' } ) ;
24
- Util . createAndAppend ( 'div ' , root , { id : 'content' } ) ;
28
+ Util . createAndAppend ( 'section ' , root , { id : 'content' } ) ;
25
29
try {
26
30
const repositories = await Util . fetchJSON ( url ) ;
27
31
this . repository = repositories . map ( repository => new Repository ( repository ) ) ;
@@ -60,10 +64,10 @@ class App {
60
64
const contributors = await repositories . fetchContributors ( ) ;
61
65
const container = document . getElementById ( 'content' ) ;
62
66
App . clearContainer ( container ) ;
63
- const leftDiv = Util . createAndAppend ( 'div ' , container , { id : 'left-side' } ) ;
64
- const rightDiv = Util . createAndAppend ( 'div ' , container , { id : 'right-side' } ) ;
67
+ const leftDiv = Util . createAndAppend ( 'article ' , container , { id : 'left-side' } ) ;
68
+ const rightDiv = Util . createAndAppend ( 'article ' , container , { id : 'right-side' } ) ;
65
69
Util . createAndAppend ( 'h3' , rightDiv , { text : 'Contributors' } ) ;
66
- const contributorList = Util . createAndAppend ( 'div ' , rightDiv ) ;
70
+ const contributorList = Util . createAndAppend ( 'article ' , rightDiv ) ;
67
71
repositories . render ( leftDiv ) ;
68
72
contributors
69
73
. map ( contributor => new Contributor ( contributor ) )
@@ -79,10 +83,7 @@ class App {
79
83
*/
80
84
renderError ( error ) {
81
85
const root = document . getElementById ( 'root' ) ;
82
- Util . createAndAppend ( 'div' , root , {
83
- text : error . message ,
84
- class : 'alert-error' ,
85
- } ) ;
86
+ Util . createAndAppend ( 'section' , root , { text : error . message , class : 'alert-error' } ) ;
86
87
}
87
88
}
88
89
0 commit comments