fix button color and duration time
parent
8cf67b1e02
commit
c1582768ec
24
src/App.js
24
src/App.js
|
@ -3,6 +3,7 @@ import {
|
|||
Button,
|
||||
Card,
|
||||
Col,
|
||||
ConfigProvider,
|
||||
Divider,
|
||||
Form,
|
||||
Grid,
|
||||
|
@ -43,6 +44,7 @@ function App() {
|
|||
const [distance, setDistance] = useState([20, 50]);
|
||||
const [acceleration, setAcceleration] = useState(0);
|
||||
const [direction, setDirection] = useState(0);
|
||||
const [durationUnit, setDurationUnit] = useState("seconds");
|
||||
|
||||
const remainingTimeRef = useRef(0);
|
||||
const [remainingTime, setRemainingTime] = useState(0);
|
||||
|
@ -115,7 +117,7 @@ function App() {
|
|||
distance: distance,
|
||||
acceleration: acceleration,
|
||||
direction: direction,
|
||||
duration: values.duration,
|
||||
duration: values.duration * (durationUnit === "seconds" ? 1 : 60),
|
||||
},
|
||||
showNotification: messageApi,
|
||||
})
|
||||
|
@ -241,10 +243,11 @@ function App() {
|
|||
max={Constants.DURATION.MAX}
|
||||
addonAfter={
|
||||
<Select
|
||||
defaultValue="seconds"
|
||||
style={{
|
||||
width: 120,
|
||||
}}
|
||||
value={durationUnit}
|
||||
onChange={(value) => setDurationUnit(value)}
|
||||
>
|
||||
<Select.Option value="seconds">Sekunden</Select.Option>
|
||||
<Select.Option value="minutes">Minuten</Select.Option>
|
||||
|
@ -336,14 +339,17 @@ function App() {
|
|||
</Col>
|
||||
|
||||
<Col span={12}>
|
||||
<Button
|
||||
type="primary"
|
||||
htmlType="submit"
|
||||
block
|
||||
style={{ backgroundColor: "#27ae60" }}
|
||||
<ConfigProvider
|
||||
theme={{
|
||||
token: {
|
||||
colorPrimary: "#27ae60",
|
||||
},
|
||||
}}
|
||||
>
|
||||
Start
|
||||
</Button>
|
||||
<Button type="primary" htmlType="submit" block>
|
||||
Start
|
||||
</Button>
|
||||
</ConfigProvider>
|
||||
</Col>
|
||||
</Row>
|
||||
</Form.Item>
|
||||
|
|
Loading…
Reference in New Issue