Skip to content

Commit b8adaf8

Browse files
committed
button styled component
1 parent daa8bf5 commit b8adaf8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

client/modules/IDE/components/FloatingActionButton.jsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
11
import React from 'react';
22
import styled from 'styled-components';
3+
import classNames from 'classnames';
34
import { useDispatch, useSelector } from 'react-redux';
45
import PropTypes from 'prop-types';
56
import PlayIcon from '../../../images/triangle-arrow-right.svg';
67
import StopIcon from '../../../images/stop.svg';
78
import { prop, remSize } from '../../../theme';
89
import { startSketch, stopSketch } from '../actions/ide';
910

10-
const Button = styled.div`
11+
const Button = styled.button`
1112
position: fixed;
1213
right: ${remSize(20)};
1314
bottom: ${remSize(20)};
1415
height: ${remSize(60)};
1516
width: ${remSize(60)};
1617
z-index: 3;
17-
cursor: pointer;
18+
padding: 0;
1819
${prop('Button.secondary.default')};
1920
aspect-ratio: 1/1;
2021
border-radius: 99999px;
2122
display: flex;
2223
justify-content: center;
2324
align-items: center;
2425
box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
25-
&[data-behaviour='stop'] {
26+
&.stop {
2627
${prop('Button.primary.default')}
2728
g {
2829
fill: ${prop('Button.primary.default.foreground')};
@@ -43,7 +44,7 @@ const FloatingActionButton = (props) => {
4344

4445
return (
4546
<Button
46-
data-behaviour={isPlaying ? 'stop' : 'run'}
47+
className={classNames({ stop: isPlaying })}
4748
style={{ paddingLeft: isPlaying ? 0 : remSize(5) }}
4849
onClick={() => {
4950
if (!isPlaying) {

0 commit comments

Comments
 (0)