feat: extract cursor component

This commit is contained in:
cudr
2019-10-14 00:49:28 +03:00
parent 0ceb38bbfd
commit 21a4a7d99a
14 changed files with 105 additions and 104 deletions

View File

@@ -19,9 +19,11 @@ class App extends Component<{}, { rooms: string[] }> {
return (
<Container>
<AddButton type="button" onClick={this.addRoom}>
Add Room
</AddButton>
<Panel>
<AddButton type="button" onClick={this.addRoom}>
Add Room
</AddButton>
</Panel>
{rooms.map(room => (
<Room key={room} slug={room} removeRoom={this.removeRoom(room)} />
))}
@@ -46,6 +48,10 @@ export default App
const Container = styled.div``
const Panel = styled.div`
display: flex;
`
const Button = styled.button`
padding: 6px 14px;
display: block;

View File

@@ -45,18 +45,10 @@ class Client extends Component<ClienProps> {
}
},
annotationDataMixin: {
name: this.props.name
name: this.props.name,
color,
alphaColor: color.slice(0, -2) + '0.2)'
},
cursorStyle: {
background: color
},
caretStyle: {
background: color
},
selectionStyle: {
background: color.slice(0, -2) + '0.2)'
},
renderCursor: data => data.get('name'),
// renderPreloader: () => <div>PRELOADER!!!!!!</div>,
onConnect: this.onConnect,
onDisconnect: this.onDisconnect