new: usr: add more stats and a dialog for the recent battle that can be shareable #4
This commit is contained in:
18
assets/js/profile.jsx
Normal file
18
assets/js/profile.jsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import React from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import ProfileCharts from './components/ProfileCharts';
|
||||
import BattleDialog from './components/BattleDialog';
|
||||
|
||||
const chartsRoot = document.getElementById('profile-charts-root');
|
||||
if (chartsRoot) {
|
||||
createRoot(chartsRoot).render(
|
||||
<ProfileCharts chartData={JSON.parse(chartsRoot.dataset.chartData)} />,
|
||||
);
|
||||
}
|
||||
|
||||
const battleRoot = document.getElementById('profile-battle-root');
|
||||
if (battleRoot) {
|
||||
createRoot(battleRoot).render(
|
||||
<BattleDialog games={JSON.parse(battleRoot.dataset.games)} />,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user