-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
76 lines (69 loc) · 3.05 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Товары Родовых поместий - React</title>
<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<!-- Не используйте это в production -->
<script src="https://unpkg.com/[email protected]/babel.min.js"></script>
<script src="https://unpkg.com/[email protected]/prop-types.js"></script>
</head>
<body>
<div id="root"></div>
<!--<script src="https://vk.com/js/api/openapi.js?162" type="text/javascript"></script>
<script type="text/javascript">
VK.init({
apiId: 7096616
});
</script>
<div id="vk_auth"></div>
<script type="text/javascript">
VK.Widgets.Auth('vk_auth', {});
</script> -->
<script type="text/babel">
class Login extends React.Component {
render() {
return (
<React.Fragment>
<p>Авторизируйтесь во Вконтакте для просмотра каталога:</p>
<p>
{/*<!-- Для локальной версии: http://localhost:8080/my/katalog.html -->*/}
{/*<!-- Для github версии: https://dimitrius-brest.github.io/tovary-rp/katalog.html -->*/}
<a href="https://oauth.vk.com/authorize?client_id=7096616&display=page&redirect_uri=http://localhost:8080/my/index.html&response_type=token&v=5.101&state=123456&scope=market">
{/*<!--<a href="https://oauth.vk.com/authorize?client_id=7096616&display=page&redirect_uri=https://dimitrius-brest.github.io/tovary-rp/index.html&response_type=token&v=5.101&state=123456&scope=market"> -->*/}
Войти
</a>
<button onClick={() => {this.props.getToken('ABVGD')}}>Получи токен</button>
</p>
</React.Fragment>
)
}
}
class App extends React.Component {
state = {
token: null
}
getToken = (value) => {
this.setState({ token: value })
}
render() {
return (
<React.Fragment>
<h3>Сайт товаров Родовых поместий</h3>
<p>Теперь и на React</p>
<Login getToken={this.getToken}/>
<p>
(Старую версию без React см. <a href="https://dimitrius-brest.github.io/tovary-rp/version-1-0">здесь</a>)
</p>
</React.Fragment>
)
}
}
ReactDOM.render(
<App />,
document.getElementById('root')
);
</script>
</body>
</html>