Skip to content

Commit 55c99c9

Browse files
author
Pascal Wegner
committed
Counter layout with arc
1 parent 37ea285 commit 55c99c9

File tree

3 files changed

+35
-6
lines changed

3 files changed

+35
-6
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import * as React from 'react';
2+
3+
export function Arc(props: React.SVGProps<SVGSVGElement>) {
4+
return (
5+
<svg
6+
fill="none"
7+
xmlns="http://www.w3.org/2000/svg"
8+
viewBox="0 0 282 282"
9+
{...props}
10+
>
11+
<circle
12+
cx={141}
13+
cy={141}
14+
r={139}
15+
fill="#FBFCFE"
16+
stroke="#CDD9EE"
17+
strokeWidth={4}
18+
/>
19+
<path
20+
d="M280 141a138.998 138.998 0 01-237.288 98.288A139.01 139.01 0 012 141 138.997 138.997 0 01141 2a138.997 138.997 0 01139 139h0z"
21+
stroke="#0057FF"
22+
strokeWidth={4}
23+
/>
24+
</svg>
25+
);
26+
}

packages/pwa/src/components/Counter/Counter.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as React from 'react';
22

33
import { DurationInput } from '../DurationInput/DurationInput';
4+
import { Arc } from '../Arc/Arc';
45

56
type CounterProps = {
67
timeLeft: Date;
@@ -10,16 +11,18 @@ type CounterProps = {
1011

1112
export function Counter({ timeLeft, roundsLeft, rounds }: CounterProps) {
1213
return (
13-
<div className="flex flex-col items-center">
14-
<div className="flex flex-col items-center mb-20">
14+
<div>
15+
<div className="flex flex-col items-center mb-20 z-[1]">
1516
<span className="text-blue-600 text-lg font-bold">ROUND</span>
1617
<span className="text-4xl" data-testid={'round'}>{`${
1718
rounds - roundsLeft
1819
}/${rounds}`}</span>
1920
</div>
20-
<div className="">
21-
<div className=""></div>
22-
<DurationInput value={timeLeft} readOnly dataTestId={'time-left'} />
21+
<div className="flex flex-col justify-center items-center relative w-72 h-72">
22+
<Arc className="absolute" />
23+
<div className="z-[1]">
24+
<DurationInput value={timeLeft} readOnly dataTestId={'time-left'} />
25+
</div>
2326
</div>
2427
</div>
2528
);

packages/pwa/src/pages/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export default function Home() {
8080
<header />
8181
<main className="flex-1">
8282
<div className="h-full flex flex-col items-stretch bg-blue-600">
83-
<div className="flex flex-col justify-center flex-1 bg-white rounded-b-3xl">
83+
<div className="flex flex-col justify-center items-center flex-1 bg-white rounded-b-3xl">
8484
{state.value === timerStates.STOPPED ? (
8585
<FormFields
8686
rounds={rounds}

0 commit comments

Comments
 (0)