-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreact.html
More file actions
74 lines (71 loc) · 1.98 KB
/
react.html
File metadata and controls
74 lines (71 loc) · 1.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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Widget — React Component Test</title>
<script type="importmap">
{
"imports": {
"react": "https://esm.sh/react@19",
"react-dom": "https://esm.sh/react-dom@19",
"react-dom/client": "https://esm.sh/react-dom@19/client",
"react/jsx-runtime": "https://esm.sh/react@19/jsx-runtime"
}
}
</script>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: system-ui, sans-serif;
background: #f5f5f5;
padding: 2rem;
}
h1 {
margin-bottom: 1rem;
font-size: 1.5rem;
}
p {
margin-bottom: 1rem;
color: #666;
}
#widget-container {
position: relative;
width: 100%;
height: 600px;
border: 2px dashed #ccc;
border-radius: 8px;
}
</style>
</head>
<body>
<h1>React Component Test</h1>
<p>This page imports MarketrixWidget as a React component and renders it into the container below.</p>
<div id="widget-container"></div>
<script type="module">
import React from 'react';
import { createRoot } from 'react-dom/client';
import { MarketrixWidget } from '/src/index.tsx';
const container = document.getElementById('widget-container');
const root = createRoot(container);
// Render widget in preview mode with sample settings
root.render(
React.createElement(MarketrixWidget, {
settings: {
widget_enabled: true,
chat_enabled: true,
theme: 'light',
position: 'bottom-right',
primary_color: '#10b981',
greeting: 'Hello from React component mode!',
},
container: container,
}),
);
</script>
</body>
</html>