Skip to content

Commit

Permalink
Merge pull request #61 from xi-effect/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
unknownproperty authored May 7, 2024
2 parents 06060dc + 1a50f3a commit c8bd88d
Show file tree
Hide file tree
Showing 38 changed files with 1,350 additions and 97 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ export default function VideoConferenceInCommunity({ params }: { params: { vid:
const token = useMainSt((state) => state.token);

React.useEffect(() => {
getToken(params.vid);
getToken(params['[channel-id]']);
}, []);

return (
<div className="w-full md:w-[calc(100vw-350px)] md:min-h-screen md:h-screen md:overflow-auto">
{token === null ? (
<>
<h1 className="text-3xl font-bold"> Видеоконференция </h1>
<h3 className="text-xl font-bold">{`id: ${params.vid}`}</h3>
<h3 className="text-xl font-bold">{`id: ${params['[channel-id]']}`}</h3>
</>
) : (
<VideoConference token={token} />
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion apps/xi.front/app/invite/[iid]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default function InvitePage({ params }: { params: { iid: string } }) {
const date = useRef(new Date());

const onSubmit = () => {
redirect('/community/1/home');
redirect('/communities/1/home');
};

return (
Expand Down
51 changes: 49 additions & 2 deletions apps/xi.front/app/providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { redirect, usePathname } from 'next/navigation';
import { ReactNode, useEffect } from 'react';
import { Toaster } from 'sonner';
import { useMainSt } from 'pkg.stores';
// import { useSocketIO } from 'pkg.utils';
import Load from './load';

const mapsOfPathsWithoutRedirect = ['/', '/signin', '/signup', '/reset-password'];
Expand All @@ -28,6 +29,49 @@ type AuthProviderT = {
children: ReactNode;
};

// const SocketProvider = ({ children }: { children: ReactNode }) => {
// const socket = useSocketIO();
// const isLogin = useMainSt((state) => state.isLogin);

// useEffect(() => {
// if (!socket.connected && isLogin) {
// socket.connect();
// }

// socket?.on('connect', () => {
// console.info('SIO connect', socket?.id);
// });

// socket?.on('disconnect', () => {
// console.info('SIO disconnect', socket?.id);
// });

// socket?.on('error', () => {
// toast('Ошибка вебсокета');
// });

// socket?.on('connect_error', (error) => {
// if (socket.active) {
// toast('Ошибка вебсокета, автоматическое переподключение');
// // temporary failure, the socket will automatically try to reconnect
// } else {
// toast('Ошибка вебсокета, переподключение');
// socket.connect();
// // the connection was denied by the server
// // in that case, `socket.connect()` must be manually called in order to reconnect
// console.log(error.message);
// }
// });

// return () => {
// socket?.off();
// socket?.disconnect();
// };
// }, []);

// return children;
// };

const AuthProvider = ({ children }: AuthProviderT) => {
const pathname = usePathname();

Expand Down Expand Up @@ -57,7 +101,7 @@ const AuthProvider = ({ children }: AuthProviderT) => {
onboardingStage === 'completed' &&
welcomePagesPaths.includes(pathname)
) {
redirect('/community/1/home');
redirect('/communities/1/home');
}

if (
Expand Down Expand Up @@ -87,7 +131,10 @@ export const Providers = ({ children }: ProvidersT) => {
return (
<ThemeProvider defaultTheme="light" themes={['light', 'dark']} attribute="data-theme">
<Toaster />
<AuthProvider>{children}</AuthProvider>
<AuthProvider>
{/* <SocketProvider>{children}</SocketProvider> */}
{children}
</AuthProvider>
</ThemeProvider>
);
};
4 changes: 2 additions & 2 deletions apps/xi.front/app/welcome/final/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function WelcomeFinal() {

const handleNext = () => {
updateUser({ onboardingStage: 'completed' });
router.push('/community/1/home');
router.push('/communities/1/home');
};

return (
Expand All @@ -39,7 +39,7 @@ export default function WelcomeFinal() {
Добро пожаловать!
</div>
<Link
href="/community/1/home/?show-tour=true"
href="/communities/1/home/?show-tour=true"
className="mt-8 border-solid border-gray-20 flex flex-col justify-center p-4 gap-1 w-full items-start border rounded-2xl cursor-pointer"
>
<div className="text-xl font-medium leading-[28px] text-gray-80">
Expand Down
3 changes: 3 additions & 0 deletions apps/xi.front/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ const nextConfig = {
'@xipkg/label',
'@xipkg/tabs',
'@xipkg/toggle',
'@xipkg/datepicker',
'@xipkg/popover',
'@xipkg/calendar',
],
compiler: {
removeConsole: process.env.NODE_ENV !== 'development',
Expand Down
2 changes: 1 addition & 1 deletion apps/xi.front/public/sw.js

Large diffs are not rendered by default.

Loading

0 comments on commit c8bd88d

Please sign in to comment.