blob: b0b08121787fb4db5b704a2255e85ac595418df9 [file] [log] [blame]
simon26e79f72022-10-05 22:16:08 -04001/*
2 * Copyright (C) 2022 Savoir-faire Linux Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Affero General Public License as
6 * published by the Free Software Foundation; either version 3 of the
7 * License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Affero General Public License for more details.
13 *
14 * You should have received a copy of the GNU Affero General Public
15 * License along with this program. If not, see
16 * <https://www.gnu.org/licenses/>.
17 */
simond47ef9e2022-09-28 22:24:28 -040018import { Route, Routes } from 'react-router-dom';
Adrien Béraudab519ff2022-05-03 15:34:48 -040019
simon1170c322022-10-31 14:51:31 -040020import { RouteParams } from '../utils/hooks';
21import CallInterface from './CallInterface';
simonfe1de722022-10-02 00:21:43 -040022import Messenger from './Messenger';
Adrien Béraud6c934962021-06-07 10:13:26 -040023
simon5da8ca62022-11-09 15:21:25 -050024export type MessengerRouteParams = RouteParams<{ conversationId?: string; contactId?: string }, Record<string, never>>;
simon1170c322022-10-31 14:51:31 -040025export type CallRouteParams = RouteParams<{ conversationId: string }, { video?: 'true' }>;
26
simonfe1de722022-10-02 00:21:43 -040027export default function JamiMessenger() {
simond47ef9e2022-09-28 22:24:28 -040028 return (
29 <Routes>
30 <Route path="addContact/:contactId" element={<Messenger />} />
31 <Route path="conversation/:conversationId" element={<Messenger />} />
simon1170c322022-10-31 14:51:31 -040032 <Route path="call/:conversationId" element={<CallInterface />} />
simonfe1de722022-10-02 00:21:43 -040033 <Route path="*" element={<Messenger />} />
Adrien Béraudab519ff2022-05-03 15:34:48 -040034 </Routes>
simond47ef9e2022-09-28 22:24:28 -040035 );
Adrien Béraudab519ff2022-05-03 15:34:48 -040036}