@rileybathurst/paddle 0.0.15 → 0.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rileybathurst/paddle",
3
3
  "private": false,
4
- "version": "0.0.15",
4
+ "version": "0.0.17",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -1,5 +1,7 @@
1
1
  // import * as React from "react"
2
2
 
3
+ import { en } from "@faker-js/faker";
4
+
3
5
  interface TimeTypes {
4
6
  start?: string | null;
5
7
  finish?: string | null;
@@ -14,8 +16,10 @@ export const PaddleTime = ({ start, finish, duration, timeframe }: TimeTypes) =>
14
16
 
15
17
  if (timeframe) {
16
18
  return {
17
- key: timeframe,
18
- unit: 'timeframe'
19
+ // key: timeframe, cant return key its a react special prop
20
+ // https://react.dev/warnings/special-props
21
+ entry: timeframe,
22
+ value: 'timeframe'
19
23
  }
20
24
  }
21
25
 
@@ -31,6 +35,8 @@ export const PaddleTime = ({ start, finish, duration, timeframe }: TimeTypes) =>
31
35
  startHoursInt = startHoursInt - 12;
32
36
  }
33
37
 
38
+ console.log(startMinsInt);
39
+
34
40
  const finishHours = finish.split(':')[0];
35
41
  let finishHoursInt: number = Number.parseInt(finishHours);
36
42
  const finishMins = finish.split(':')[1];
@@ -42,10 +48,10 @@ export const PaddleTime = ({ start, finish, duration, timeframe }: TimeTypes) =>
42
48
  }
43
49
 
44
50
  return {
45
- key: `${startHoursInt}${startMinsInt > 0 ? `:${startMinsInt}:${hairSpace}` : ''}${hairSpace}${startAmpm}
46
- -
47
- ${finishHoursInt}${finishMinsInt > 0 ? `:${finishMinsInt}${hairSpace}` : ''}${hairSpace}${finishAmpm}`,
48
- unit: "time"
51
+ entry: startHours === '12' ? 'noon' : `${startHoursInt}${startMinsInt > 0 ? `:${startMinsInt}${hairSpace}` : ''}${startAmpm}
52
+ -
53
+ ${finishHours === '12' ? 'noon' : `${finishHoursInt}${finishMinsInt > 0 ? `:${finishMinsInt}${hairSpace}` : ''}${hairSpace}${finishAmpm}`}`,
54
+ value: "time"
49
55
  }
50
56
  }
51
57
 
@@ -55,19 +61,19 @@ export const PaddleTime = ({ start, finish, duration, timeframe }: TimeTypes) =>
55
61
  const mins = duration % 60;
56
62
 
57
63
  return {
58
- key: `${hours}${hairSpace}hrs ${mins > 0 ? `${mins}${hairSpace}mins` : ''}`,
59
- unit: "duration"
64
+ entry: `${hours}${hairSpace}hrs ${mins > 0 ? `${mins}${hairSpace}mins` : ''} `,
65
+ value: "duration"
60
66
  }
61
67
  }
62
68
 
63
69
  return {
64
- key: `${duration}${hairSpace}mins`,
65
- unit: "duration"
70
+ entry: `${duration}${hairSpace} mins`,
71
+ value: "duration"
66
72
  }
67
73
  }
68
74
 
69
75
  return {
70
- key: null,
71
- unit: null
76
+ entry: null,
77
+ value: null
72
78
  }
73
79
  }
@@ -5,15 +5,7 @@ import { Link } from 'react-aria-components';
5
5
  import { faker } from '@faker-js/faker';
6
6
  import { PaddleTime } from '../PaddleTime';
7
7
 
8
- interface TicketProps {
9
- primary?: boolean;
10
- onClick?: () => void;
11
- }
12
-
13
- export const Ticket = ({
14
- primary = false,
15
- ...props
16
- }: TicketProps) => {
8
+ export const Ticket = () => {
17
9
 
18
10
  const time = PaddleTime({
19
11
  timeframe: faker.datatype.boolean() ? faker.helpers.arrayElement(['sunset', 'overnight']) : null,
@@ -34,7 +26,7 @@ export const Ticket = ({
34
26
  </Link>
35
27
  </h4>
36
28
  <div className="card__specs">
37
- <h4>{time.key}</h4>
29
+ <h4>{time.entry}</h4>
38
30
  {faker.datatype.boolean() ? <h4 className="capitalize">{faker.helpers.arrayElement(['easy', 'medium', 'hard'])} <span>Fitness</span></h4> : null}
39
31
  </div>
40
32
  <hr />