Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
OtavioStasiak committed Oct 18, 2024
1 parent f916332 commit 825b054
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Text, TouchableOpacity, View } from 'react-native';
import I18n from 'i18n-js';

import { themes } from '../../../../lib/constants';
import { TCertificatePicker } from '../../types';
import { TCertificatePicker } from '../../definitions';
import { isAndroid, isTablet } from '../../../../lib/methods/helpers';
import styles from './styles';

Expand Down
22 changes: 22 additions & 0 deletions app/views/NewServerView/definitions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { TSupportedThemes } from '../../theme';
import { IBaseScreen } from '../../definitions';
import { OutsideParamList } from '../../stacks/types';

export interface INewServerViewProps extends IBaseScreen<OutsideParamList, 'NewServerView'> {
connecting: boolean;
previousServer: string | null;
};

export interface ISubmitParams {
fromServerHistory?: boolean;
username?: string;
serverUrl?: string;
};

export interface TCertificatePicker {
previousServer: string | null;
certificate: string | null;
theme: TSupportedThemes;
handleRemove: () => void;
chooseCertificate: () => Promise<void>;
};
4 changes: 2 additions & 2 deletions app/views/NewServerView/hooks/useConnectServer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { serverRequest } from '../../../actions/server';
import { BASIC_AUTH_KEY, setBasicAuth } from '../../../lib/methods/helpers/fetch';
import { CERTIFICATE_KEY } from '../../../lib/constants';
import completeUrl from '../utils/completeUrl';
import { TSubmitParams } from '../types';
import { ISubmitParams } from '../definitions';

type TUseNewServerProps = {
text: string;
Expand Down Expand Up @@ -40,7 +40,7 @@ const useConnectServer = ({ text, certificate }: TUseNewServerProps) => {
dispatch(serverRequest('https://open.rocket.chat'));
};

const submit = ({ fromServerHistory = false, username, serverUrl }: TSubmitParams = {}) => {
const submit = ({ fromServerHistory = false, username, serverUrl }: ISubmitParams = {}) => {
logEvent(events.NS_CONNECT_TO_WORKSPACE);

setConnectingOpen(false);
Expand Down
2 changes: 1 addition & 1 deletion app/views/NewServerView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import useServersHistory from './hooks/useServersHistory';
import useCertificate from './hooks/useCertificate';
import useNewServer from './hooks/useConnectServer';
import completeUrl from './utils/completeUrl';
import { INewServerViewProps } from './types';
import { INewServerViewProps } from './definitions';
import styles from './styles';

const NewServerView = ({ navigation }: INewServerViewProps) => {
Expand Down
37 changes: 0 additions & 37 deletions app/views/NewServerView/types.ts

This file was deleted.

0 comments on commit 825b054

Please sign in to comment.