-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathApp.jsx
More file actions
84 lines (79 loc) · 2.98 KB
/
App.jsx
File metadata and controls
84 lines (79 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import React from 'react';
import {SearchButtons} from './SearchButtons';
import {SearchInput} from './SearchInput';
import '../../index.css';
/**
* Cvičení:
* Vidíme, že ve výsledcích vyhledávání se již hodně v kódu opakujeme. Proto:
*
* - vytvořte komponentu <ResultItem /> a použijte jí místo <div> tagů
* - předejte komponentě ResultItem tři propsy - link, title a description
*
* - vytvořte komponentu <Results />, zabalte do ní v hlavní komponentě
* komponenty <ResultItem /> a přidejte jí propsu searchQuery tak, aby výsledná
* struktura vypadala takto:
*
* <Results searchQuery="abc">
* <ResultItem link="..." title="..." description="" />
* <ResultItem link="..." title="..." description="" />
* <ResultItem link="..." title="..." description="" />
* </Results>
*
* */
export class App extends React.Component {
render() {
return (
<div className="App">
<header>
<img alt="Logo" />
<span>Gmail</span>
</header>
<div>
<div>
<div className="logo"></div>
<SearchInput />
<SearchButtons />
</div>
</div>
<div className="results">
<h2>
Results for <span id="search-text-results">abc</span>
</h2>
<div className="results__list">
<div className="results__list-item">
<a href="/Result-1">
<h3 className="results__list-title">Czech Magazine for Youth</h3>
</a>
<div className="results__list-description">
ABC is a favorite Czech magazine for children that focuses on science and
technology. It's purpose is to both educate children as well as get
them excited about science and nature.
</div>
</div>
<div className="results__list-item">
<a href="/Result-2">
<h3 className="results__list-title">TV Station</h3>
</a>
<div className="results__list-description">
ABC is an American Broadcasting Company, a flagship property of Walt
Disney Television, a subsidiary of the Disney Media Networks division of
The Walt Disney Company. It has headquarter in Burbank, California.
</div>
</div>
<div className="results__list-item">
<a href="/Result-3">
<h3 className="results__list-title">First Letters of Alphabet</h3>
</a>
<div className="results__list-description">
ABC are first letters of the alphabet. English alphabet consists of 26
letters and it originated around the 7th century from the Latin script.
The word alphabet is a compound of first two letters of greek alphabet -
alpha and beta.
</div>
</div>
</div>
</div>
</div>
);
}
}