Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Commit

Permalink
Mark the props of the component as read-only.
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Dec 18, 2023
1 parent 26ecc47 commit 8198a82
Show file tree
Hide file tree
Showing 47 changed files with 49 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface Props {
onActionItemDeletion(): void;
}

function DeleteMultipleActionItemsConfirmation(props: Props) {
function DeleteMultipleActionItemsConfirmation(props: Readonly<Props>) {
const { actionItemIds, onActionItemDeletion } = props;

const team = useRecoilValue(TeamState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface Props {
onActionItemDeletion(): void;
}

function DeleteSingleActionItemConfirmation(props: Props) {
function DeleteSingleActionItemConfirmation(props: Readonly<Props>) {
const { actionItemId, onActionItemDeletion } = props;

const team = useRecoilValue(TeamState);
Expand Down
2 changes: 1 addition & 1 deletion ui/src/App/Team/Archives/Pagination/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ interface Props {
onPageChange(pageIndex: number): void;
}

function Pagination(props: Props) {
function Pagination(props: Readonly<Props>) {
const { pageCount, onPageChange } = props;

return pageCount > 1 ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ interface Props {
isSelected: boolean;
}

function ArchivedBoardTile(props: Props): React.ReactElement {
function ArchivedBoardTile(props: Readonly<Props>): React.ReactElement {
const { board, onBoardDeletion, onBoardCheckboxClick, isSelected } = props;

const setModalContents = useSetRecoilState(ModalContentsState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ interface Props {
areAllSelected?: boolean;
}

function ArchivedBoardListHeader(props: Props) {
function ArchivedBoardListHeader(props: Readonly<Props>) {
const { onDateClick, onSelectAllClick, areAllSelected = false } = props;

const [sortOrder, setSortOrder] = useState<SortOrder>(SortOrder.DESC);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface Props {
onBoardDeletion(): void;
}

function DeleteBoardConfirmation(props: Props) {
function DeleteBoardConfirmation(props: Readonly<Props>) {
const { boardId, onBoardDeletion } = props;

const team = useRecoilValue(TeamState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface Props {
onBoardDeletion(): void;
}

function DeleteBoardsConfirmation(props: Props) {
function DeleteBoardsConfirmation(props: Readonly<Props>) {
const { boardIds, onBoardDeletion } = props;

const team = useRecoilValue(TeamState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ interface Props {
actionItemId: number;
}

function ActionItem(props: Props) {
function ActionItem(props: Readonly<Props>) {
const { actionItemId } = props;

const actionItem = useRecoilValue(ActionItemByIdState(actionItemId));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ interface Props {
setActionItemMinHeight: (height: number | undefined) => void;
}

function DefaultActionItemView(props: Props) {
function DefaultActionItemView(props: Readonly<Props>) {
const { actionItem, setViewState, setActionItemMinHeight } = props;

const team = useRecoilValue(TeamState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ interface Props {
height: number | undefined;
}

function DeleteActionItemView(props: Props) {
function DeleteActionItemView(props: Readonly<Props>) {
const { actionItemId, setViewState, height } = props;

const setModalContents = useSetRecoilState(ModalContentsState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ interface Props {
setViewState: (viewState: ActionItemViewState) => void;
}

function EditActionItemView(props: Props) {
function EditActionItemView(props: Readonly<Props>) {
const { actionItem, setViewState } = props;

const team = useRecoilValue(TeamState);
Expand Down
2 changes: 1 addition & 1 deletion ui/src/App/Team/Retro/MobileColumnNav/MobileColumnNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface Props {
setSelectedIndex(index: number): void;
}

function MobileColumnNav(props: Props): React.ReactElement {
function MobileColumnNav(props: Readonly<Props>): React.ReactElement {
const { columns = [], selectedIndex, setSelectedIndex } = props;

const isSelectedIndex = (index: number): boolean => index === selectedIndex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface Props extends ButtonHTMLAttributes<HTMLButtonElement> {
fontAwesomeIconClasses?: string;
}

function SubheaderButton(props: Props) {
function SubheaderButton(props: Readonly<Props>) {
const { fontAwesomeIconClasses, className, children, ...buttonProps } = props;

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface Props {
index: number;
}

const DraggableRetroItem = (props: Props): React.ReactElement => {
const DraggableRetroItem = (props: Readonly<Props>): React.ReactElement => {
const { thought, topic, index } = props;
const disableDraggable = useRecoilValue(DisableDraggableState);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ interface Props {
setThoughtItemHeight: (height: number | undefined) => void;
}

function DefaultThoughtItemView(props: Props) {
function DefaultThoughtItemView(props: Readonly<Props>) {
const {
thought,
type,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ interface Props {
thoughtId: number;
}

function DeleteThoughtView(props: Props) {
function DeleteThoughtView(props: Readonly<Props>) {
const { setViewState, height, thoughtId } = props;
const team = useRecoilValue(TeamState);
const setModalContents = useSetRecoilState(ModalContentsState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ interface Props {
setViewState: (viewState: ThoughtItemViewState) => void;
}

function EditThoughtView(props: Props) {
function EditThoughtView(props: Readonly<Props>) {
const { thought, setViewState } = props;
const team = useRecoilValue(TeamState);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ interface Props {
disableButtons?: boolean;
}

function ThoughtItem(props: Props) {
function ThoughtItem(props: Readonly<Props>) {
const { thoughtId, type, disableButtons = false } = props;

const thought = useRecoilValue(ThoughtByIdState(thoughtId));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ interface Props {
thoughtId: number;
}

function ThoughtItemWithAddAction(props: Props) {
function ThoughtItemWithAddAction(props: Readonly<Props>) {
const { type, thoughtId } = props;

const [showAddActionItemCard, setShowAddActionItemCard] = useState(false);
Expand Down
2 changes: 1 addition & 1 deletion ui/src/App/Team/Retro/ThoughtsColumn/ThoughtsColumn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ interface Props {
column: Column;
}

function ThoughtsColumn(props: Props) {
function ThoughtsColumn(props: Readonly<Props>) {
const { column } = props;

const team = useRecoilValue(TeamState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ interface Props {
accountTabData?: AddBoardOwnersFormProps;
}

function AccountTab(props: Props): React.ReactElement {
function AccountTab(props: Readonly<Props>): React.ReactElement {
const { accountTabData } = props;

const team = useRecoilValue(TeamState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ interface Props {
email2?: string;
}

function AddBoardOwnersConfirmationForm(props: Props) {
function AddBoardOwnersConfirmationForm(props: Readonly<Props>) {
const { email1, email2 = '' } = props;

const team = useRecoilValue(TeamState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ interface Props {
paragraph1: string;
}

function EmailSentConfirmation(props: Props) {
function EmailSentConfirmation(props: Readonly<Props>) {
const { paragraph1 } = props;

const setModalContents = useSetRecoilState(ModalContentsState);
Expand Down
2 changes: 1 addition & 1 deletion ui/src/App/Team/TeamHeader/Settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ interface Props {
accountTabData?: AddBoardOwnersFormProps;
}

export function Settings(props: Props) {
export function Settings(props: Readonly<Props>) {
const { activeTab = SettingsTabs.STYLES, accountTabData } = props;

const environmentConfig = useRecoilValue(EnvironmentConfigState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface Props {
end?: boolean;
}

function TeamHeaderNavLink(props: Props) {
function TeamHeaderNavLink(props: Readonly<Props>) {
const { to, children, end } = props;

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface Props {
actionItem: Action;
}

function ActionItemDisplayOnly(props: Props) {
function ActionItemDisplayOnly(props: Readonly<Props>) {
const { actionItem } = props;

return (
Expand Down
2 changes: 1 addition & 1 deletion ui/src/Common/ArchivedActionItem/ArchivedActionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ interface Props {
onActionItemCheckboxClick?(actionItemId: number, isChecked: boolean): void;
}

function ArchivedActionItem(props: Props) {
function ArchivedActionItem(props: Readonly<Props>) {
const {
actionItem,
isSelected = false,
Expand Down
2 changes: 1 addition & 1 deletion ui/src/Common/AssigneeInput/AssigneeInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface Props {
readOnly?: boolean;
}

function AssigneeInput(props: Props) {
function AssigneeInput(props: Readonly<Props>) {
const { assignee = '', onAssign, disabled, readOnly } = props;
const assigneeInputRef = useRef<HTMLInputElement>(null);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface Props {
paragraph2: string;
}

function CheckYourMailConfirmationPage(props: Props) {
function CheckYourMailConfirmationPage(props: Readonly<Props>) {
const { paragraph1, paragraph2 } = props;

return (
Expand Down
2 changes: 1 addition & 1 deletion ui/src/Common/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface Props {
onChange(checked: boolean): void;
}

function Checkbox(props: Props) {
function Checkbox(props: Readonly<Props>) {
const { id, label, value, className, onChange } = props;
const [isChecked, setIsChecked] = useState<boolean>(false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ interface Props {
setEditing(editing: boolean): void;
}

function ColumnHeaderInput(props: Props) {
function ColumnHeaderInput(props: Readonly<Props>) {
const { initialTitle, updateTitle, setEditing } = props;

const [value, setValue] = useState(initialTitle);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ interface Props {
onClick(): void;
}

function EditColumnButton(props: Props) {
function EditColumnButton(props: Readonly<Props>) {
const { title, onClick } = props;

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface Props {
onClick?(sortedState: boolean): void;
}

function SortColumnButton(props: Props) {
function SortColumnButton(props: Readonly<Props>) {
const { title, onClick } = props;
const [sorted, setSorted] = useState(false);

Expand Down
2 changes: 1 addition & 1 deletion ui/src/Common/ColumnItem/EditColumnItem/EditColumnItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ interface Props {
className?: string;
}

function EditColumnItem(props: Props) {
function EditColumnItem(props: Readonly<Props>) {
const {
onConfirm,
onCancel,
Expand Down
2 changes: 1 addition & 1 deletion ui/src/Common/ConfirmationModal/ConfirmationModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ interface Props {
submitButtonText: string;
}

function ConfirmationModal(props: Props) {
function ConfirmationModal(props: Readonly<Props>) {
const {
testId,
className,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface Props {

const MAX_CHARACTER_COUNT = 255;

function CreateColumnItemInput(props: Props): React.ReactElement {
function CreateColumnItemInput(props: Readonly<Props>): React.ReactElement {
const { placeholder, type, handleSubmission, ...labelProps } = props;

const [value, setValue] = useState('');
Expand Down
2 changes: 1 addition & 1 deletion ui/src/Common/Dropdown/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ interface Props {
onChange: (value: string) => void;
}

function Dropdown(props: Props) {
function Dropdown(props: Readonly<Props>) {
const { label, options, defaultValue, onChange } = props;

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ interface Props {
charsAreRunningOutThreshold?: number;
}

export default function FloatingCharacterCountdown(props: Props): ReactElement {
export default function FloatingCharacterCountdown(
props: Readonly<Props>
): ReactElement {
const {
maxCharacterCount = 255,
charsAreRunningOutThreshold = 20,
Expand Down
2 changes: 1 addition & 1 deletion ui/src/Common/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface Props {
children?: ReactNode;
}

function Header(props: Props) {
function Header(props: Readonly<Props>) {
const { name, children } = props;

const retroquestLogo =
Expand Down
2 changes: 1 addition & 1 deletion ui/src/Common/Input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type Props = ComponentPropsWithoutRef<'input'> & {
validationMessage?: string;
};

export default function Input(props: Props): React.ReactElement {
export default function Input(props: Readonly<Props>): React.ReactElement {
const {
id,
label,
Expand Down
2 changes: 1 addition & 1 deletion ui/src/Common/InputEmail/InputEmail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ interface Props {

const EMAIL_REGEX = /^.+@[^@]+$/;

function InputEmail(props: Props) {
function InputEmail(props: Readonly<Props>) {
const {
value = '',
required = true,
Expand Down
2 changes: 1 addition & 1 deletion ui/src/Common/InputPassword/InputPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function validatePasswordString(password: string): boolean {
);
}

function InputPassword(props: Props) {
function InputPassword(props: Readonly<Props>) {
const {
label = 'Password',
password,
Expand Down
2 changes: 1 addition & 1 deletion ui/src/Common/InputTeamName/InputTeamName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ interface Props {

const TEAM_NAME_REGEX = /^[\w\s]+$/;

function InputTeamName(props: Props) {
function InputTeamName(props: Readonly<Props>) {
const {
value = '',
required,
Expand Down
2 changes: 1 addition & 1 deletion ui/src/Common/NotFoundSection/NotFoundSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface Props {
paragraph: ReactElement;
}

function NotFoundSection(props: Props): React.ReactElement {
function NotFoundSection(props: Readonly<Props>): React.ReactElement {
const { paragraph, subHeader = 'No archives were found.' } = props;

return (
Expand Down
Loading

0 comments on commit 8198a82

Please sign in to comment.