Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
# Unix-style newlines with a newline ending every file
end_of_line = lf
indent_style = space
insert_final_newline = true
charset = utf-8
indent_size = 4

[*.{js, ts, css}]
indent_size = 2
quote_type = single
4 changes: 2 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import React from 'react';
import './App.css';
import Luckysheet from './component/Luckysheet'

function App() {
const App = () => {
return (
<div className="App">
<header className="App-header">
<Luckysheet/>
<Luckysheet />
</header>
</div>
);
Expand Down
49 changes: 23 additions & 26 deletions src/component/Luckysheet.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
import React from 'react';
class Luckysheet extends React.Component {
import React, { useEffect } from 'react';

componentDidMount() {
const luckysheet = window.luckysheet;
luckysheet.create({
container: "luckysheet",
});
}
render() {
const luckyCss = {
margin: '0px',
padding: '0px',
position: 'absolute',
width: '100%',
height: '100%',
left: '0px',
top: '0px'
}
return (
<div
id="luckysheet"
style={luckyCss}
></div>
)
}
const Luckysheet = () => {
useEffect(() => {
const luckysheet = window.luckysheet;
luckysheet.create({
container: 'luckysheet',
});
}, []);

const luckyCss = {
margin: '0px',
padding: '0px',
position: 'absolute',
width: '100%',
height: '100%',
left: '0px',
top: '0px'
};

return (
<div id="luckysheet" style={luckyCss}></div>
);
}

export default Luckysheet
export default Luckysheet;