From f6c1a18bef53d8d7e734e5552cbc2a39bf43060d Mon Sep 17 00:00:00 2001 From: charludo Date: Wed, 5 Oct 2022 09:18:14 +0200 Subject: [PATCH] LUN-433: adjust naming of PropsType --- src/components/AddElement.tsx | 4 ++-- src/components/DeletionModal.tsx | 4 ++-- src/components/DocumentImageSection.tsx | 4 ++-- src/components/FavoriteButton.tsx | 4 ++-- src/components/ListEmpty.tsx | 4 ++-- src/components/Modal.tsx | 4 ++-- src/components/ModalSkeleton.tsx | 4 ++-- src/components/NavigationHeaderLeft.tsx | 4 ++-- src/components/PressableOpacity.tsx | 10 ++++++++-- src/components/RouteWrapper.tsx | 4 ++-- src/components/SearchBar.tsx | 4 ++-- src/components/VocabularyDetail.tsx | 4 ++-- src/components/__tests__/Modal.spec.tsx | 4 ++-- src/routes/UserVocabularyOverviewScreen.tsx | 4 ++-- src/routes/VocabularyDetailScreen.tsx | 4 ++-- .../components/NotAuthorisedView.tsx | 4 ++-- .../components/QRCodeReaderOverlay.tsx | 4 ++-- src/routes/dictionary/DictionaryScreen.tsx | 4 ++-- src/routes/dictionary/components/DictionaryItem.tsx | 4 ++-- .../exercise-finished/ExerciseFinishedScreen.tsx | 4 ++-- .../exercise-finished/components/ShareButton.tsx | 4 ++-- .../exercise-finished/components/ShareSection.tsx | 4 ++-- src/routes/exercises/components/LockingLane.tsx | 4 ++-- src/routes/home/components/AddCustomDiscipline.tsx | 4 ++-- src/routes/home/components/Card.tsx | 4 ++-- src/routes/home/components/CustomDisciplineDetails.tsx | 4 ++-- src/routes/home/components/DisciplineCard.tsx | 4 ++-- src/routes/home/components/HomeScreenHeader.tsx | 4 ++-- src/routes/home/components/NextExerciseCard.tsx | 10 ++++++++-- src/routes/home/components/ProfessionDetails.tsx | 4 ++-- .../manage-selections/ManageSelectionsScreen.tsx | 4 ++-- .../manage-selections/components/SelectionItem.tsx | 4 ++-- src/routes/settings/components/DebugModal.tsx | 4 ++-- src/routes/settings/components/VersionPressable.tsx | 4 ++-- .../user-vocabulary-list/UserVocabularyListScreen.tsx | 4 ++-- .../components/ListEmptyContent.tsx | 4 ++-- .../user-vocabulary-list/components/ListItem.tsx | 4 ++-- .../components/AlternativeWordsSection.tsx | 4 ++-- 38 files changed, 88 insertions(+), 76 deletions(-) diff --git a/src/components/AddElement.tsx b/src/components/AddElement.tsx index 5d6e83381..2fd1be521 100644 --- a/src/components/AddElement.tsx +++ b/src/components/AddElement.tsx @@ -26,13 +26,13 @@ const FlexRow = styled.View` align-items: center; ` -interface Props { +interface AddElementProps { onPress: () => void label: string explanation?: string } -const AddElement = ({ onPress, label, explanation }: Props): ReactElement => ( +const AddElement = ({ onPress, label, explanation }: AddElementProps): ReactElement => ( <> diff --git a/src/components/DeletionModal.tsx b/src/components/DeletionModal.tsx index 3fcadf051..ec0f22da3 100644 --- a/src/components/DeletionModal.tsx +++ b/src/components/DeletionModal.tsx @@ -5,7 +5,7 @@ import { getLabels } from '../services/helpers' import Modal from './Modal' import { ContentSecondary } from './text/Content' -interface PropsType { +interface DeletionModalProps { isVisible: boolean onConfirm: () => void onClose: () => void @@ -16,7 +16,7 @@ const Explanation = styled(ContentSecondary)` text-align: center; ` -const DeletionModal = ({ isVisible, onConfirm, onClose }: PropsType): JSX.Element => { +const DeletionModal = ({ isVisible, onConfirm, onClose }: DeletionModalProps): JSX.Element => { const { confirmationQuestion, confirm, explanation } = getLabels().manageSelection.deleteModal return ( props.theme.spacings.md}; ` -interface Props { +interface DocumentImageSectionProps { document: Document audioDisabled?: boolean minimized?: boolean @@ -34,7 +34,7 @@ const DocumentImageSection = ({ audioDisabled = false, minimized = false, submittedAlternative, -}: Props): ReactElement => ( +}: DocumentImageSectionProps): ReactElement => ( diff --git a/src/components/FavoriteButton.tsx b/src/components/FavoriteButton.tsx index e50f95233..12f1b5a9e 100644 --- a/src/components/FavoriteButton.tsx +++ b/src/components/FavoriteButton.tsx @@ -28,12 +28,12 @@ const Button = styled(PressableOpacity)` border-radius: 20px; ` -interface Props { +interface FavoriteButtonProps { document: Document onFavoritesChanged?: () => void } -const FavoriteButton = ({ document, onFavoritesChanged }: Props): ReactElement | null => { +const FavoriteButton = ({ document, onFavoritesChanged }: FavoriteButtonProps): ReactElement | null => { const { data: isFavorite, refresh } = useLoadAsync(getIsFavorite, document.id) useFocusEffect(refresh) diff --git a/src/components/ListEmpty.tsx b/src/components/ListEmpty.tsx index b0f37e3d9..ab3cf96d1 100644 --- a/src/components/ListEmpty.tsx +++ b/src/components/ListEmpty.tsx @@ -13,11 +13,11 @@ const StyledSadSmileyIcon = styled(SadSmileyIcon)` padding: ${props => props.theme.spacings.md} 0; ` -interface Props { +interface ListEmptyProps { label: string } -const ListEmpty = ({ label }: Props): ReactElement => ( +const ListEmpty = ({ label }: ListEmptyProps): ReactElement => ( {label} diff --git a/src/components/Modal.tsx b/src/components/Modal.tsx index 6eb62f056..0df67c5cf 100644 --- a/src/components/Modal.tsx +++ b/src/components/Modal.tsx @@ -15,7 +15,7 @@ const Message = styled(HeadingText)` text-align: center; ` -export interface Props { +export interface ModalProps { visible: boolean onClose: () => void text: string @@ -27,7 +27,7 @@ export interface Props { testID?: string } -const Modal = (props: Props): JSX.Element => { +const Modal = (props: ModalProps): JSX.Element => { const { visible, text, diff --git a/src/components/ModalSkeleton.tsx b/src/components/ModalSkeleton.tsx index 1d1b72a7e..23abb5548 100644 --- a/src/components/ModalSkeleton.tsx +++ b/src/components/ModalSkeleton.tsx @@ -37,14 +37,14 @@ const StyledPressable = styled(Pressable)` flex: 1; ` -interface PropsType { +interface ModalSkeletonProps { visible: boolean onClose: () => void testID?: string children: ReactNode } -const ModalSkeleton = ({ visible, onClose, testID, children }: PropsType): ReactElement => { +const ModalSkeleton = ({ visible, onClose, testID, children }: ModalSkeletonProps): ReactElement => { const { keyboardHeight, isKeyboardVisible } = useKeyboard() const screenHeight = useScreenHeight() const onCloseKeyboard = () => isKeyboardVisible && Keyboard.dismiss() diff --git a/src/components/NavigationHeaderLeft.tsx b/src/components/NavigationHeaderLeft.tsx index bae737b3d..e42c59eb5 100644 --- a/src/components/NavigationHeaderLeft.tsx +++ b/src/components/NavigationHeaderLeft.tsx @@ -16,13 +16,13 @@ const Container = styled.Pressable` align-items: center; ` -interface Props { +interface NavigationHeaderLeftProps { title: string onPress: () => void isCloseButton: boolean } -const NavigationHeaderLeft = ({ onPress, title, isCloseButton }: Props): ReactElement => { +const NavigationHeaderLeft = ({ onPress, title, isCloseButton }: NavigationHeaderLeftProps): ReactElement => { const [pressed, setPressed] = useState(false) const closeIcon = pressed ? CloseCircleIconBlue : CloseCircleIconWhite diff --git a/src/components/PressableOpacity.tsx b/src/components/PressableOpacity.tsx index 008d017b9..4a9b8b18b 100644 --- a/src/components/PressableOpacity.tsx +++ b/src/components/PressableOpacity.tsx @@ -2,7 +2,7 @@ import React, { ReactElement, ReactNode, useState } from 'react' import { StyleProp, ViewStyle } from 'react-native' import styled from 'styled-components/native' -interface Props { +interface PressableOpacityProps { children: ReactNode onPress: () => void style?: StyleProp @@ -15,7 +15,13 @@ const PressableContainer = styled.Pressable<{ isPressed: boolean }>` opacity: ${props => (props.isPressed ? props.theme.styles.pressOpacity.min : props.theme.styles.pressOpacity.max)}; ` -const PressableOpacity = ({ children, onPress, style, testID, disabled = false }: Props): ReactElement => { +const PressableOpacity = ({ + children, + onPress, + style, + testID, + disabled = false, +}: PressableOpacityProps): ReactElement => { const [isPressed, setIsPressed] = useState(false) return ( diff --git a/src/components/RouteWrapper.tsx b/src/components/RouteWrapper.tsx index 2ac53f8fb..0eed85cfe 100644 --- a/src/components/RouteWrapper.tsx +++ b/src/components/RouteWrapper.tsx @@ -4,7 +4,7 @@ import styled from 'styled-components/native' import theme from '../constants/theme' -interface Props { +interface RouteWrapperProps { backgroundColor?: string lightStatusBarContent?: boolean children: ReactNode @@ -22,7 +22,7 @@ const RouteWrapper = ({ lightStatusBarContent = false, children, bottomBackgroundColor, -}: Props): ReactElement => ( +}: RouteWrapperProps): ReactElement => ( <> void } -const SearchBar = ({ query, setQuery }: Props): ReactElement => ( +const SearchBar = ({ query, setQuery }: SearchBarProps): ReactElement => ( ( +const VocabularyDetail = ({ document }: VocabularyDetailProps): ReactElement => ( <> diff --git a/src/components/__tests__/Modal.spec.tsx b/src/components/__tests__/Modal.spec.tsx index 0c3276612..c6eb02aa3 100644 --- a/src/components/__tests__/Modal.spec.tsx +++ b/src/components/__tests__/Modal.spec.tsx @@ -3,14 +3,14 @@ import React from 'react' import { Text } from 'react-native' import render from '../../testing/render' -import Modal, { Props } from '../Modal' +import Modal, { ModalProps } from '../Modal' describe('Modal', () => { const onClose = jest.fn() const confirmationAction = jest.fn() const childText = 'Children' - const defaultProps: Props = { + const defaultProps: ModalProps = { visible: false, onClose, text: 'Are you sure?', diff --git a/src/routes/UserVocabularyOverviewScreen.tsx b/src/routes/UserVocabularyOverviewScreen.tsx index 341a6ea5a..9edc0ea40 100644 --- a/src/routes/UserVocabularyOverviewScreen.tsx +++ b/src/routes/UserVocabularyOverviewScreen.tsx @@ -13,11 +13,11 @@ const Root = styled.View` padding: ${props => props.theme.spacings.md}; ` -interface PropsType { +interface UserVocabularyOverviewScreenProps { navigation: StackNavigationProp } -const UserVocabularyOverviewScreen = ({ navigation }: PropsType): JSX.Element => { +const UserVocabularyOverviewScreen = ({ navigation }: UserVocabularyOverviewScreenProps): JSX.Element => { const { myWords } = getLabels().userVocabulary const { list, create, practice } = getLabels().userVocabulary.overview return ( diff --git a/src/routes/VocabularyDetailScreen.tsx b/src/routes/VocabularyDetailScreen.tsx index da9c7dfc4..49f8452e9 100644 --- a/src/routes/VocabularyDetailScreen.tsx +++ b/src/routes/VocabularyDetailScreen.tsx @@ -5,11 +5,11 @@ import RouteWrapper from '../components/RouteWrapper' import VocabularyDetail from '../components/VocabularyDetail' import { RoutesParams } from '../navigation/NavigationTypes' -interface Props { +interface VocabularyDetailScreenProps { route: RouteProp } -const VocabularyDetailScreen = ({ route }: Props): ReactElement => { +const VocabularyDetailScreen = ({ route }: VocabularyDetailScreenProps): ReactElement => { const { document } = route.params return ( diff --git a/src/routes/add-custom-discipline/components/NotAuthorisedView.tsx b/src/routes/add-custom-discipline/components/NotAuthorisedView.tsx index 1d1047a84..312513871 100644 --- a/src/routes/add-custom-discipline/components/NotAuthorisedView.tsx +++ b/src/routes/add-custom-discipline/components/NotAuthorisedView.tsx @@ -20,11 +20,11 @@ const Description = styled(ContentSecondary)` text-align: center; ` -interface Props { +interface NotAuthorizedViewProps { setVisible: (visible: boolean) => void } -const NotAuthorisedView = ({ setVisible }: Props): ReactElement => { +const NotAuthorisedView = ({ setVisible }: NotAuthorizedViewProps): ReactElement => { const openSettings = () => { Linking.openSettings().catch(reportError) } diff --git a/src/routes/add-custom-discipline/components/QRCodeReaderOverlay.tsx b/src/routes/add-custom-discipline/components/QRCodeReaderOverlay.tsx index 85952eb2f..7f4b973c2 100644 --- a/src/routes/add-custom-discipline/components/QRCodeReaderOverlay.tsx +++ b/src/routes/add-custom-discipline/components/QRCodeReaderOverlay.tsx @@ -26,12 +26,12 @@ const Camera = styled(RNCamera)` position: relative; ` -interface Props { +interface AddCustomDisciplineScreenProps { setVisible: (visible: boolean) => void setCode: (code: string) => void } -const AddCustomDisciplineScreen = ({ setVisible, setCode }: Props): ReactElement => { +const AddCustomDisciplineScreen = ({ setVisible, setCode }: AddCustomDisciplineScreenProps): ReactElement => { const appState = useRef(AppState.currentState) const [isPressed, setIsPressed] = useState(false) diff --git a/src/routes/dictionary/DictionaryScreen.tsx b/src/routes/dictionary/DictionaryScreen.tsx index e9dedd3fe..404747b1c 100644 --- a/src/routes/dictionary/DictionaryScreen.tsx +++ b/src/routes/dictionary/DictionaryScreen.tsx @@ -22,11 +22,11 @@ const Header = styled.View` padding-bottom: ${props => props.theme.spacings.md}; ` -interface Props { +interface DictionaryScreenProps { navigation: StackNavigationProp } -const DictionaryScreen = ({ navigation }: Props): ReactElement => { +const DictionaryScreen = ({ navigation }: DictionaryScreenProps): ReactElement => { const documents = useLoadAllDocuments() const [searchString, setSearchString] = useState('') diff --git a/src/routes/dictionary/components/DictionaryItem.tsx b/src/routes/dictionary/components/DictionaryItem.tsx index d76f6fee3..686ff1d6a 100644 --- a/src/routes/dictionary/components/DictionaryItem.tsx +++ b/src/routes/dictionary/components/DictionaryItem.tsx @@ -14,13 +14,13 @@ const AlternativeWords = styled(ContentSecondary)` font-style: italic; ` -interface Props { +interface DictionaryItemProps { document: Document showAlternatives: boolean navigateToDetail: (document: Document) => void } -class DictionaryItem extends PureComponent { +class DictionaryItem extends PureComponent { render(): ReactElement { const { document, navigateToDetail, showAlternatives } = this.props diff --git a/src/routes/exercise-finished/ExerciseFinishedScreen.tsx b/src/routes/exercise-finished/ExerciseFinishedScreen.tsx index 75feb66c7..00aaadb57 100644 --- a/src/routes/exercise-finished/ExerciseFinishedScreen.tsx +++ b/src/routes/exercise-finished/ExerciseFinishedScreen.tsx @@ -53,12 +53,12 @@ const Results = styled(Content)<{ color: Color }>` padding: ${props => props.theme.spacings.md} 0 ${props => props.theme.spacings.xs}; ` -interface Props { +interface ExerciseFinishedScreenProps { route: RouteProp navigation: StackNavigationProp } -const ExerciseFinishedScreen = ({ navigation, route }: Props): ReactElement => { +const ExerciseFinishedScreen = ({ navigation, route }: ExerciseFinishedScreenProps): ReactElement => { const { exercise, results, disciplineTitle, disciplineId, documents, closeExerciseAction, unlockedNextExercise } = route.params const correctResults = results.filter(doc => doc.result === 'correct') diff --git a/src/routes/exercise-finished/components/ShareButton.tsx b/src/routes/exercise-finished/components/ShareButton.tsx index 6ab25c538..0a6a14236 100644 --- a/src/routes/exercise-finished/components/ShareButton.tsx +++ b/src/routes/exercise-finished/components/ShareButton.tsx @@ -7,12 +7,12 @@ import { BUTTONS_THEME } from '../../../constants/data' import { DocumentResult } from '../../../navigation/NavigationTypes' import { getLabels } from '../../../services/helpers' -interface Props { +interface ShareButtonProps { disciplineTitle: string results: DocumentResult[] } -const ShareButton = ({ disciplineTitle, results }: Props): ReactElement => { +const ShareButton = ({ disciplineTitle, results }: ShareButtonProps): ReactElement => { const share = async () => { const correctWords = results.filter(doc => doc.result === 'correct').length const xOfAllWords = `${correctWords} ${getLabels().results.of} ${results.length}` diff --git a/src/routes/exercise-finished/components/ShareSection.tsx b/src/routes/exercise-finished/components/ShareSection.tsx index 332a5aff9..19ab326af 100644 --- a/src/routes/exercise-finished/components/ShareSection.tsx +++ b/src/routes/exercise-finished/components/ShareSection.tsx @@ -26,12 +26,12 @@ const Description = styled.Text` padding-bottom: ${props => props.theme.spacings.sm}; ` -interface Props { +interface ShareSectionProps { disciplineTitle: string results: DocumentResult[] } -const ShareSection = ({ disciplineTitle, results }: Props): ReactElement => ( +const ShareSection = ({ disciplineTitle, results }: ShareSectionProps): ReactElement => ( {getLabels().results.share.description} diff --git a/src/routes/exercises/components/LockingLane.tsx b/src/routes/exercises/components/LockingLane.tsx index 5b9f9f9a9..9b90513c1 100644 --- a/src/routes/exercises/components/LockingLane.tsx +++ b/src/routes/exercises/components/LockingLane.tsx @@ -19,12 +19,12 @@ const Line = styled.View<{ color: string }>` margin: ${props => props.theme.spacings.xs} 10px; ` -interface PropsType { +interface LockingLaneProps { nextExercise: Exercise | null index: number } -const LockingLane = ({ nextExercise, index }: PropsType): ReactElement => { +const LockingLane = ({ nextExercise, index }: LockingLaneProps): ReactElement => { let Icon if (nextExercise && nextExercise.level < index) { Icon = LockIcon diff --git a/src/routes/home/components/AddCustomDiscipline.tsx b/src/routes/home/components/AddCustomDiscipline.tsx index 533c108ac..e50364d01 100644 --- a/src/routes/home/components/AddCustomDiscipline.tsx +++ b/src/routes/home/components/AddCustomDiscipline.tsx @@ -11,11 +11,11 @@ const Explanation = styled(ContentSecondary)` padding: ${props => props.theme.spacings.xs}; ` -interface Props { +interface AddCustomDisciplineProps { navigate: () => void } -const AddCustomDiscipline = ({ navigate }: Props): ReactElement => ( +const AddCustomDiscipline = ({ navigate }: AddCustomDisciplineProps): ReactElement => ( }> {getLabels().home.customDisciplineExplanation} diff --git a/src/routes/home/components/Card.tsx b/src/routes/home/components/Card.tsx index 14de0d690..a80dc7ba9 100644 --- a/src/routes/home/components/Card.tsx +++ b/src/routes/home/components/Card.tsx @@ -36,14 +36,14 @@ const IconContainer = styled.View` padding-right: ${props => props.theme.spacings.sm}; ` -interface PropsType { +interface CardProps { heading?: string icon?: string | ReactElement onPress?: () => void children: ReactNode } -const Card = (props: PropsType): ReactElement => { +const Card = (props: CardProps): ReactElement => { const { heading, icon, onPress, children } = props return ( diff --git a/src/routes/home/components/CustomDisciplineDetails.tsx b/src/routes/home/components/CustomDisciplineDetails.tsx index 8ad65d9dc..7cc3a01b7 100644 --- a/src/routes/home/components/CustomDisciplineDetails.tsx +++ b/src/routes/home/components/CustomDisciplineDetails.tsx @@ -14,12 +14,12 @@ const TextContainer = styled.View` padding: ${props => props.theme.spacings.sm} 0 ${props => props.theme.spacings.xs}; ` -interface PropsType { +interface CustomDisciplineDetailsProps { discipline: Discipline navigateToDiscipline: (discipline: Discipline) => void } -const CustomDisciplineDetails = ({ discipline, navigateToDiscipline }: PropsType): JSX.Element => ( +const CustomDisciplineDetails = ({ discipline, navigateToDiscipline }: CustomDisciplineDetailsProps): JSX.Element => ( <> {discipline.numberOfChildren} diff --git a/src/routes/home/components/DisciplineCard.tsx b/src/routes/home/components/DisciplineCard.tsx index 24d1149b6..7cd5e88f5 100644 --- a/src/routes/home/components/DisciplineCard.tsx +++ b/src/routes/home/components/DisciplineCard.tsx @@ -41,7 +41,7 @@ export const ButtonContainer = styled.View` margin: ${props => props.theme.spacings.xxs} auto; ` -interface PropsType { +interface DisciplineCardProps { identifier: RequestParams refresh?: () => void navigateToDiscipline: (discipline: Discipline) => void @@ -53,7 +53,7 @@ const DisciplineCard = ({ refresh: refreshHome, navigateToDiscipline, navigateToNextExercise, -}: PropsType): JSX.Element | null => { +}: DisciplineCardProps): JSX.Element | null => { const { data: discipline, loading, error, refresh } = useLoadDiscipline(identifier) const [isModalVisible, setIsModalVisible] = useState(false) diff --git a/src/routes/home/components/HomeScreenHeader.tsx b/src/routes/home/components/HomeScreenHeader.tsx index 9805b16a6..1e980c836 100644 --- a/src/routes/home/components/HomeScreenHeader.tsx +++ b/src/routes/home/components/HomeScreenHeader.tsx @@ -37,11 +37,11 @@ const MenuIconWhite = styled(MenuIcon)` color: ${props => props.theme.colors.backgroundAccent}; ` -interface Props { +interface HomeScreenHeaderProps { navigation: StackNavigationProp } -const HomeScreenHeader = ({ navigation }: Props): JSX.Element => ( +const HomeScreenHeader = ({ navigation }: HomeScreenHeaderProps): JSX.Element => ( diff --git a/src/routes/home/components/NextExerciseCard.tsx b/src/routes/home/components/NextExerciseCard.tsx index f53a1d9a1..2d39c3c7c 100644 --- a/src/routes/home/components/NextExerciseCard.tsx +++ b/src/routes/home/components/NextExerciseCard.tsx @@ -51,7 +51,7 @@ const Subheading = styled(ContentTextLight)` font-size: ${props => props.theme.fonts.smallFontSize}; ` -interface PropsType { +interface NextExerciseCardProps { thumbnail: string heading: string subheading: string @@ -59,7 +59,13 @@ interface PropsType { onPress: () => void } -const NextExerciseCard = ({ thumbnail, onPress, heading, subheading, buttonLabel }: PropsType): ReactElement => ( +const NextExerciseCard = ({ + thumbnail, + onPress, + heading, + subheading, + buttonLabel, +}: NextExerciseCardProps): ReactElement => ( diff --git a/src/routes/home/components/ProfessionDetails.tsx b/src/routes/home/components/ProfessionDetails.tsx index 671be7b6e..44c05153f 100644 --- a/src/routes/home/components/ProfessionDetails.tsx +++ b/src/routes/home/components/ProfessionDetails.tsx @@ -20,7 +20,7 @@ const ProgressContainer = styled.View` padding: ${props => props.theme.spacings.sm} 0 ${props => props.theme.spacings.xs}; ` -interface PropsType { +interface ProfessionDetailsProps { discipline: Discipline navigateToDiscipline: (discipline: Discipline) => void navigateToNextExercise: (nextExerciseData: NextExerciseData) => void @@ -30,7 +30,7 @@ const ProfessionDetails = ({ discipline, navigateToDiscipline, navigateToNextExercise, -}: PropsType): ReactElement | null => { +}: ProfessionDetailsProps): ReactElement | null => { const { data: progress, refresh: refreshProgress } = useReadProgress(discipline) const { data: nextExerciseData, refresh: refreshNextExercise } = useLoadNextExercise(discipline) diff --git a/src/routes/manage-selections/ManageSelectionsScreen.tsx b/src/routes/manage-selections/ManageSelectionsScreen.tsx index 63e54d9f5..b01961e0d 100644 --- a/src/routes/manage-selections/ManageSelectionsScreen.tsx +++ b/src/routes/manage-selections/ManageSelectionsScreen.tsx @@ -30,11 +30,11 @@ const Padding = styled.View` padding-bottom: ${props => props.theme.spacings.xxl}; ` -interface Props { +interface ManageSelectionScreenProps { navigation: StackNavigationProp } -const ManageSelectionsScreen = ({ navigation }: Props): ReactElement => { +const ManageSelectionsScreen = ({ navigation }: ManageSelectionScreenProps): ReactElement => { const { data: selectedProfessions, refresh: refreshSelectedProfessions } = useReadSelectedProfessions() const { data: customDisciplines, refresh: refreshCustomDisciplines } = useReadCustomDisciplines() diff --git a/src/routes/manage-selections/components/SelectionItem.tsx b/src/routes/manage-selections/components/SelectionItem.tsx index 73fc930c3..49534b813 100644 --- a/src/routes/manage-selections/components/SelectionItem.tsx +++ b/src/routes/manage-selections/components/SelectionItem.tsx @@ -11,7 +11,7 @@ import { isTypeLoadProtected } from '../../../hooks/helpers' import { RequestParams, useLoadDiscipline } from '../../../hooks/useLoadDiscipline' import { getLabels } from '../../../services/helpers' -interface PropsType { +interface SelectionItemProps { identifier: RequestParams deleteItem: () => void } @@ -24,7 +24,7 @@ const LoadingContainer = styled(View)` height: 0px; ` -const SelectionItem = ({ identifier, deleteItem }: PropsType): JSX.Element => { +const SelectionItem = ({ identifier, deleteItem }: SelectionItemProps): JSX.Element => { const { data, loading, error } = useLoadDiscipline(identifier) const [isModalVisible, setIsModalVisible] = useState(false) diff --git a/src/routes/settings/components/DebugModal.tsx b/src/routes/settings/components/DebugModal.tsx index 920dc6994..b4f1ef373 100644 --- a/src/routes/settings/components/DebugModal.tsx +++ b/src/routes/settings/components/DebugModal.tsx @@ -24,12 +24,12 @@ const CodeInput = styled.TextInput` margin: ${props => props.theme.spacings.md}; ` -interface PropsType { +interface DebugModalProps { visible: boolean onClose: () => void } -const DebugModal = (props: PropsType): JSX.Element => { +const DebugModal = (props: DebugModalProps): JSX.Element => { const { visible, onClose } = props const [inputText, setInputText] = useState('') const [baseURL, setBaseURL] = useState('') diff --git a/src/routes/settings/components/VersionPressable.tsx b/src/routes/settings/components/VersionPressable.tsx index 95ff08b1d..88890091f 100644 --- a/src/routes/settings/components/VersionPressable.tsx +++ b/src/routes/settings/components/VersionPressable.tsx @@ -11,13 +11,13 @@ const Version = styled.Pressable` padding: ${props => props.theme.spacings.xl} ${props => props.theme.spacings.md}; ` -interface PropsType { +interface VersionPressableProps { onClickThresholdReached: () => void } export const CLICK_THRESHOLD = 10 -const VersionPressable = ({ onClickThresholdReached }: PropsType): JSX.Element => { +const VersionPressable = ({ onClickThresholdReached }: VersionPressableProps): JSX.Element => { const [counter, setCounter] = useState(0) const onPress = () => { diff --git a/src/routes/user-vocabulary-list/UserVocabularyListScreen.tsx b/src/routes/user-vocabulary-list/UserVocabularyListScreen.tsx index 8b0f6b2e6..2e2348a52 100644 --- a/src/routes/user-vocabulary-list/UserVocabularyListScreen.tsx +++ b/src/routes/user-vocabulary-list/UserVocabularyListScreen.tsx @@ -37,11 +37,11 @@ const ButtonContainer = styled.View` bottom: 0px; ` -interface Props { +interface UserVocabularyListScreenProps { navigation: StackNavigationProp } -const UserVocabularyListScreen = ({ navigation }: Props): ReactElement => { +const UserVocabularyListScreen = ({ navigation }: UserVocabularyListScreenProps): ReactElement => { const documents = useReadUserVocabulary() const [searchString, setSearchString] = useState('') const [editModeEnabled, setEditModeEnabled] = useState(false) diff --git a/src/routes/user-vocabulary-list/components/ListEmptyContent.tsx b/src/routes/user-vocabulary-list/components/ListEmptyContent.tsx index eb1ef8b6b..e76ed6d94 100644 --- a/src/routes/user-vocabulary-list/components/ListEmptyContent.tsx +++ b/src/routes/user-vocabulary-list/components/ListEmptyContent.tsx @@ -12,11 +12,11 @@ const EmptyContainer = styled.View` height: ${wp('20%')}px; ` -interface Props { +interface ListEmptyContentProps { documents: Return } -const ListEmptyContent = ({ documents }: Props): ReactElement => { +const ListEmptyContent = ({ documents }: ListEmptyContentProps): ReactElement => { if (documents.loading) { return ( diff --git a/src/routes/user-vocabulary-list/components/ListItem.tsx b/src/routes/user-vocabulary-list/components/ListItem.tsx index 4981d72d6..ef25cc2c7 100644 --- a/src/routes/user-vocabulary-list/components/ListItem.tsx +++ b/src/routes/user-vocabulary-list/components/ListItem.tsx @@ -16,7 +16,7 @@ const IconContainer = styled.View` ${props => props.theme.spacings.xxs}; ` -interface Props { +interface ListItemProps { document: Document navigateToDetailScreen: () => void navigateToEditScreen: () => void @@ -30,7 +30,7 @@ const ListItem = ({ navigateToEditScreen, editModeEnabled, deleteItem, -}: Props): ReactElement => ( +}: ListItemProps): ReactElement => ( {editModeEnabled && ( diff --git a/src/routes/vocabulary-detail/components/AlternativeWordsSection.tsx b/src/routes/vocabulary-detail/components/AlternativeWordsSection.tsx index a875737ad..357036b49 100644 --- a/src/routes/vocabulary-detail/components/AlternativeWordsSection.tsx +++ b/src/routes/vocabulary-detail/components/AlternativeWordsSection.tsx @@ -38,11 +38,11 @@ const Label = styled(ContentTextBold)` text-transform: uppercase; ` -interface Props { +interface AlternativeWordsSectionProps { document: Document } -const AlternativeWordsSection = ({ document }: Props): JSX.Element => { +const AlternativeWordsSection = ({ document }: AlternativeWordsSectionProps): JSX.Element => { const [isFeedbackModalVisible, setIsFeedbackModalVisible] = useState(false) return (