Skip to content

Commit 9e89662

Browse files
committed
* revamp work with ts
1 parent e04d5a1 commit 9e89662

33 files changed

+102
-121
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ GEM
523523
railties (>= 7.1.0)
524524
turbo_power (0.7.0)
525525
turbo-rails (>= 1.3.0)
526-
typelizer (0.4.1)
526+
typelizer (0.4.2)
527527
railties (>= 6.0.0)
528528
tzinfo (2.0.6)
529529
concurrent-ruby (~> 1.0)

app/frontend/components/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { usePage } from "@inertiajs/react";
33
import { Menu, X } from "lucide-react";
44
import { useState } from "react";
55

6-
import type { User } from "../serializers";
6+
import type { User } from "@/serializers";
77

88
import { Logo } from "./Logo";
99

app/frontend/components/Layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { usePage } from "@inertiajs/react";
22

3-
import type { User } from "../serializers";
3+
import type { User } from "@/serializers";
44

55
import { Footer } from "./Footer";
66
import { Header } from "./Header";

app/frontend/components/ReviewScores.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import type React from "react";
2-
31
interface ReviewScoresProps {
42
scores: Record<string, number> | undefined;
53
}
@@ -19,7 +17,7 @@ const scoreClass = (value: number) => {
1917
}
2018
};
2119

22-
const ReviewScores: React.FC<ReviewScoresProps> = ({ scores }) => {
20+
const ReviewScores = ({ scores }: ReviewScoresProps) => {
2321
if (!scores || Object.keys(scores).length === 0) {
2422
return null;
2523
}

app/frontend/components/Select.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type React from "react";
1+
import type {ChangeEvent} from "react";
22

33
interface SelectOption {
44
value: string;
@@ -8,20 +8,20 @@ interface SelectOption {
88
interface SelectProps {
99
id: string;
1010
value: string;
11-
onChange: (e: React.ChangeEvent<HTMLSelectElement>) => void;
11+
onChange: (e: ChangeEvent<HTMLSelectElement>) => void;
1212
options: SelectOption[];
1313
required?: boolean;
1414
placeholder?: string;
1515
}
1616

17-
const Select: React.FC<SelectProps> = ({
17+
const Select = ({
1818
id,
1919
value,
2020
onChange,
2121
options,
2222
required,
2323
placeholder,
24-
}) => {
24+
}: SelectProps) => {
2525
return (
2626
<div className="relative">
2727
<select

app/frontend/components/StarRating.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Star } from "lucide-react";
2-
import type React from "react";
32
import { useState } from "react";
43

54
interface StarRatingProps {
@@ -11,14 +10,14 @@ interface StarRatingProps {
1110
readonly?: boolean;
1211
}
1312

14-
const StarRating: React.FC<StarRatingProps> = ({
13+
const StarRating = ({
1514
value,
1615
name,
1716
onChange,
1817
label,
1918
required,
2019
readonly,
21-
}) => {
20+
}: StarRatingProps) => {
2221
const [hoverRating, setHoverRating] = useState(0);
2322

2423
const handleStarClick = (rating: number) => {

app/frontend/components/StatusBadge.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import type React from "react";
2-
31
type ProposalStatus =
42
| "draft"
53
| "submitted"
@@ -14,7 +12,7 @@ interface StatusBadgeProps {
1412
status: ProposalStatus;
1513
}
1614

17-
const StatusBadge: React.FC<StatusBadgeProps> = ({ status }) => {
15+
const StatusBadge = ({ status }: StatusBadgeProps) => {
1816
let badgeClasses = "badge ";
1917
let statusText = "";
2018

app/frontend/components/TextAreaWithCounter.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type React from "react";
1+
import type {ChangeEvent} from "react";
22

33
interface TextAreaWithCounterProps {
44
id: string;
@@ -9,21 +9,21 @@ interface TextAreaWithCounterProps {
99
required?: boolean;
1010
}
1111

12-
const TextAreaWithCounter: React.FC<TextAreaWithCounterProps> = ({
12+
const TextAreaWithCounter = ({
1313
id,
1414
value,
1515
onChange,
1616
maxLength,
1717
placeholder,
1818
required,
19-
}) => {
19+
}: TextAreaWithCounterProps) => {
2020
// Count line breaks as \r\n (2 characters) to match Ruby/Rails backend
2121
const lineBreaks = (value.match(/\n/g) ?? []).length;
2222
const characterCount = value.length + lineBreaks;
2323
const isNearLimit = characterCount >= maxLength * 0.8;
2424
const isAtLimit = characterCount >= maxLength;
2525

26-
const handleChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
26+
const handleChange = (e: ChangeEvent<HTMLTextAreaElement>) => {
2727
const newValue = e.target.value;
2828
const newLineBreaks = (newValue.match(/\n/g) ?? []).length;
2929
const newCharacterCount = newValue.length + newLineBreaks;

app/frontend/icons/Google.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import type React from "react";
2-
3-
const GoogleIcon: React.FC<{ className?: string }> = ({
1+
const GoogleIcon = ({
42
className = "h-5 w-5",
5-
}) => (
3+
}: { className?: string }) => (
64
<svg className={className} viewBox="0 0 24 24" fill="currentColor">
75
<path
86
d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"

app/frontend/pages/evaluations/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { router, usePage } from "@inertiajs/react";
22

3-
import Layout from "../../components/Layout";
4-
import type { Evaluation } from "../../serializers";
5-
import { formatDeadline } from "../../utils/dateHelpers";
3+
import Layout from "@/components/Layout";
4+
import type { Evaluation } from "@/serializers";
5+
import { formatDeadline } from "@/utils/dateHelpers";
66

77
interface IndexProps {
88
evaluations: Evaluation[];

0 commit comments

Comments
 (0)