Lucas/t 369 on comment drawer i can reply to a comment thread and it (#206)
* Added prisma to suggested extension in container * Added comments and authors on drawer with proper resolving * Fix lint * Fix console log * Fixed generated front graphql from rebase * Fixed right drawer width and shared in theme * Added date packages and tooltip * Added date utils and tests * Added comment thread components * Fixed comment chip * wip * wip 2 * - Added string typing for DateTime scalar - Refactored user in a recoil state and workspace using it - Added comment creation * Prepared EditableCell refactor * Fixed line height and tooltip * Fix lint
This commit is contained in:
14
front/src/providers/AppThemeProvider.tsx
Normal file
14
front/src/providers/AppThemeProvider.tsx
Normal file
@ -0,0 +1,14 @@
|
||||
import { ThemeProvider } from '@emotion/react';
|
||||
|
||||
import { darkTheme, lightTheme } from '@/ui/layout/styles/themes';
|
||||
import { browserPrefersDarkMode } from '@/utils/utils';
|
||||
|
||||
type OwnProps = {
|
||||
children: JSX.Element;
|
||||
};
|
||||
|
||||
export function AppThemeProvider({ children }: OwnProps) {
|
||||
const selectedTheme = browserPrefersDarkMode() ? darkTheme : lightTheme;
|
||||
|
||||
return <ThemeProvider theme={selectedTheme}>{children}</ThemeProvider>;
|
||||
}
|
||||
29
front/src/providers/AuthProvider.tsx
Normal file
29
front/src/providers/AuthProvider.tsx
Normal file
@ -0,0 +1,29 @@
|
||||
import { useEffect } from 'react';
|
||||
import { useRecoilState } from 'recoil';
|
||||
|
||||
import { getUserIdFromToken } from '@/auth/services/AuthService';
|
||||
import { currentUserState } from '@/auth/states/currentUserState';
|
||||
import { isAuthenticatingState } from '@/auth/states/isAuthenticatingState';
|
||||
import { mapToUser } from '@/users/interfaces/user.interface';
|
||||
import { useGetCurrentUserQuery } from '@/users/services';
|
||||
|
||||
type OwnProps = {
|
||||
children: JSX.Element;
|
||||
};
|
||||
|
||||
export function AuthProvider({ children }: OwnProps) {
|
||||
const [, setCurrentUser] = useRecoilState(currentUserState);
|
||||
const [, setIsAuthenticating] = useRecoilState(isAuthenticatingState);
|
||||
|
||||
const userIdFromToken = getUserIdFromToken();
|
||||
const { data } = useGetCurrentUserQuery(userIdFromToken);
|
||||
|
||||
useEffect(() => {
|
||||
if (data?.users[0]) {
|
||||
setCurrentUser(mapToUser(data?.users?.[0]));
|
||||
setIsAuthenticating(false);
|
||||
}
|
||||
}, [data, setCurrentUser, setIsAuthenticating]);
|
||||
|
||||
return <>{children}</>;
|
||||
}
|
||||
Reference in New Issue
Block a user