scinote-web/app/javascript/packs/settings/app.jsx

34 lines
883 B
React
Raw Normal View History

2017-08-02 23:27:05 +08:00
import React from "react";
import ReactDOM from "react-dom";
import Navigation from "../shared/navigation";
import { Provider } from "react-redux";
import { IntlProvider } from "react-intl";
import { addLocaleData } from "react-intl";
import enLocaleData from "react-intl/locale-data/en";
import { flattenMessages } from "../locales/utils";
import store from "../app/store";
import messages from "../locales/messages";
2017-07-12 22:41:55 +08:00
2017-08-02 23:27:05 +08:00
addLocaleData([...enLocaleData]);
let locale = "en-US";
2017-07-12 22:41:55 +08:00
2017-08-02 23:27:05 +08:00
const SettingsPage = () =>
<div>
2017-08-02 23:27:05 +08:00
<Navigation page="Settings" />
....
2017-08-02 23:27:05 +08:00
</div>;
2017-07-12 22:41:55 +08:00
2017-08-02 23:27:05 +08:00
document.addEventListener("DOMContentLoaded", () => {
2017-07-12 22:41:55 +08:00
ReactDOM.render(
2017-08-02 23:27:05 +08:00
<Provider store={store}>
<IntlProvider
locale={locale}
messages={flattenMessages(messages[locale])}
>
<SettingsPage />
</IntlProvider>
</Provider>,
document.getElementById("root")
);
});