Skip to content

Commit 1e7b91b

Browse files
authored
refactor: component props (#2384)
Signed-off-by: Adam Setch <adam.setch@outlook.com>
1 parent cd0e615 commit 1e7b91b

31 files changed

+78
-73
lines changed

src/renderer/components/AllRead.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ import { AppContext } from '../context/App';
55
import { hasActiveFilters } from '../utils/notifications/filters/filter';
66
import { EmojiSplash } from './layout/EmojiSplash';
77

8-
interface IAllRead {
8+
interface AllReadProps {
99
fullHeight?: boolean;
1010
}
1111

12-
export const AllRead: FC<IAllRead> = ({ fullHeight = true }: IAllRead) => {
12+
export const AllRead: FC<AllReadProps> = ({
13+
fullHeight = true,
14+
}: AllReadProps) => {
1315
const { settings } = useContext(AppContext);
1416

1517
const hasFilters = hasActiveFilters(settings);

src/renderer/components/Oops.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ import type { GitifyError } from '../types';
44
import { Errors } from '../utils/errors';
55
import { EmojiSplash } from './layout/EmojiSplash';
66

7-
interface IOops {
7+
interface OopsProps {
88
error: GitifyError;
99
fullHeight?: boolean;
1010
}
1111

12-
export const Oops: FC<IOops> = ({ error, fullHeight = true }: IOops) => {
12+
export const Oops: FC<OopsProps> = ({
13+
error,
14+
fullHeight = true,
15+
}: OopsProps) => {
1316
const err = error ?? Errors.UNKNOWN;
1417

1518
const emoji = useMemo(

src/renderer/components/avatars/AvatarWithFallback.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import { fireEvent, render, screen } from '@testing-library/react';
33
import { type Link, Size } from '../../types';
44
import {
55
AvatarWithFallback,
6-
type IAvatarWithFallback,
6+
type AvatarWithFallbackProps,
77
} from './AvatarWithFallback';
88

99
describe('renderer/components/avatars/AvatarWithFallback.tsx', () => {
10-
const props: IAvatarWithFallback = {
10+
const props: AvatarWithFallbackProps = {
1111
src: 'https://avatars.githubusercontent.com/u/133795385?s=200&v=4' as Link,
1212
alt: 'gitify-app',
1313
name: '@gitify-app',

src/renderer/components/avatars/AvatarWithFallback.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ import type { UserType } from '../../typesGitHub';
88
import { getDefaultUserIcon } from '../../utils/icons';
99
import { isNonHumanUser } from '../../utils/notifications/filters/userType';
1010

11-
export interface IAvatarWithFallback {
11+
export interface AvatarWithFallbackProps {
1212
src?: Link;
1313
alt?: string;
1414
name?: string;
1515
size?: number;
1616
userType?: UserType;
1717
}
1818

19-
export const AvatarWithFallback: React.FC<IAvatarWithFallback> = ({
19+
export const AvatarWithFallback: React.FC<AvatarWithFallbackProps> = ({
2020
src,
2121
alt,
2222
name,

src/renderer/components/fields/Checkbox.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { render } from '@testing-library/react';
22

3-
import { Checkbox, type ICheckbox } from './Checkbox';
3+
import { Checkbox, type CheckboxProps } from './Checkbox';
44

55
describe('renderer/components/fields/Checkbox.tsx', () => {
6-
const props: ICheckbox = {
6+
const props: CheckboxProps = {
77
name: 'appearance',
88
label: 'Appearance',
99
checked: true,

src/renderer/components/fields/Checkbox.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { cn } from '../../utils/cn';
66
import { CustomCounter } from '../primitives/CustomCounter';
77
import { Tooltip } from './Tooltip';
88

9-
export interface ICheckbox {
9+
export interface CheckboxProps {
1010
name: string;
1111
label: string;
1212
counter?: number;
@@ -17,10 +17,10 @@ export interface ICheckbox {
1717
onChange: (evt: React.ChangeEvent<HTMLInputElement>) => void;
1818
}
1919

20-
export const Checkbox: FC<ICheckbox> = ({
20+
export const Checkbox: FC<CheckboxProps> = ({
2121
visible = true,
2222
...props
23-
}: ICheckbox) => {
23+
}: CheckboxProps) => {
2424
const counter = props?.counter === 0 ? '0' : props.counter;
2525

2626
return (

src/renderer/components/fields/FieldLabel.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { render } from '@testing-library/react';
22

3-
import { FieldLabel, type IFieldLabel } from './FieldLabel';
3+
import { FieldLabel, type FieldLabelProps } from './FieldLabel';
44

55
describe('renderer/components/fields/FieldLabel.tsx', () => {
6-
const props: IFieldLabel = {
6+
const props: FieldLabelProps = {
77
name: 'appearance',
88
label: 'Appearance',
99
};

src/renderer/components/fields/FieldLabel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import type { FC } from 'react';
22

3-
export interface IFieldLabel {
3+
export interface FieldLabelProps {
44
name: string;
55
label: string;
66
}
77

8-
export const FieldLabel: FC<IFieldLabel> = (props: IFieldLabel) => {
8+
export const FieldLabel: FC<FieldLabelProps> = (props: FieldLabelProps) => {
99
return (
1010
<label className={'mr-1 font-medium cursor-pointer'} htmlFor={props.name}>
1111
{props.label}

src/renderer/components/fields/RadioGroup.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { render } from '@testing-library/react';
22

3-
import { type IRadioGroup, RadioGroup } from './RadioGroup';
3+
import { RadioGroup, type RadioGroupProps } from './RadioGroup';
44

55
describe('renderer/components/fields/RadioGroup.tsx', () => {
6-
const props: IRadioGroup = {
6+
const props: RadioGroupProps = {
77
label: 'Appearance',
88
name: 'appearance',
99
options: [

src/renderer/components/fields/RadioGroup.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { RadioGroupItem } from '../../types';
66
import { FieldLabel } from './FieldLabel';
77
import { Tooltip } from './Tooltip';
88

9-
export interface IRadioGroup {
9+
export interface RadioGroupProps {
1010
name: string;
1111
label: string;
1212
options: RadioGroupItem[];
@@ -15,7 +15,7 @@ export interface IRadioGroup {
1515
tooltip?: ReactNode | string;
1616
}
1717

18-
export const RadioGroup: FC<IRadioGroup> = (props: IRadioGroup) => {
18+
export const RadioGroup: FC<RadioGroupProps> = (props: RadioGroupProps) => {
1919
return (
2020
<Stack
2121
align="center"

0 commit comments

Comments
 (0)