Skip to content

Commit bb7eedc

Browse files
fix: fixed incorrect % parsing in parseDuration
1 parent 95d8f8a commit bb7eedc

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

packages/react/src/demo.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ const NewComponentUsage = () => (
7575
muted: true,
7676
loop: true
7777
}}
78-
duration={1}
78+
duration='1%'
7979
resize={{
8080
height: 200,
81-
width: 200,
81+
width: 200
8282
}}
8383
videoCodec={{
8484
use: 'h264',
@@ -92,7 +92,6 @@ const NewComponentUsage = () => (
9292
]}
9393
roundCorners={100}
9494
rotate={50}
95-
startOffset={1}
9695
/>
9796
</div>
9897
</>
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
import { Duration } from '../transformationTypes/duration';
22

3-
// FIXME verify whether duration du_ accepts `%` and not only `p`
4-
export const parseDuration = (duration: Duration): `du_${string}` => `du_${duration}`;
3+
export const parseDuration = (duration: Duration) => `du_${String(duration).replace('%', 'p')}`;

0 commit comments

Comments
 (0)