Skip to content

Commit

Permalink
feat: update sdk (#263)
Browse files Browse the repository at this point in the history
* feat: update sdk

* refactor: add graasp/stylis-plugin-rtl
  • Loading branch information
pyphilia authored Sep 18, 2024
1 parent da83995 commit 9a34e5e
Show file tree
Hide file tree
Showing 7 changed files with 229 additions and 299 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@graasp/query-client": "^3.22.2",
"@graasp/sdk": "^4.26.0",
"@graasp/sdk": "^4.29.0",
"@graasp/stylis-plugin-rtl": "^2.2.0",
"@graasp/translations": "^1.35.1",
"@graasp/ui": "^4.26.0",
"@graasp/ui": "^5.0.0",
"@mui/icons-material": "^5.16.7",
"@mui/lab": "^5.0.0-alpha.157",
"@mui/material": "^5.16.7",
Expand Down Expand Up @@ -91,6 +92,7 @@
"@emotion/styled": "^11.11.0",
"@graasp/query-client": "*",
"@graasp/sdk": "*",
"@graasp/stylis-plugin-rtl": "*",
"@graasp/translations": "*",
"@graasp/ui": "*",
"@mui/icons-material": "^5",
Expand Down
4 changes: 2 additions & 2 deletions src/components/Chatbox/Chatbox.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { StyledEngineProvider, styled } from '@mui/material';

import { Account, ChatMessage, CompleteMember } from '@graasp/sdk';
import { Account, ChatMessage, CurrentAccount } from '@graasp/sdk';

import { CONTAINER_HEIGHT_SAFETY_MARGIN } from '@/constants.js';
import { CurrentMemberContextProvider } from '@/context/CurrentMemberContext.js';
Expand Down Expand Up @@ -42,7 +42,7 @@ type Props = {
useAvatarUrl: AvatarHookType;
chatId: string;
showAdminTools?: boolean;
currentMember?: CompleteMember | null;
currentMember?: CurrentAccount | null;
members?: Account[];
};

Expand Down
7 changes: 3 additions & 4 deletions src/components/Chatbox/Message.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Box, Stack, Typography, styled } from '@mui/material';
import { colors } from '@mui/material';
import { Box, Stack, Typography, colors, styled } from '@mui/material';

import { Account, ChatMessage, CompleteMember } from '@graasp/sdk';
import { Account, ChatMessage, CurrentAccount } from '@graasp/sdk';
import { CHATBOX } from '@graasp/translations';
import { Avatar } from '@graasp/ui';

Expand Down Expand Up @@ -37,7 +36,7 @@ const TimeText = styled(Typography)({

type Props = {
message: ChatMessage;
currentMember?: CompleteMember | null;
currentMember?: CurrentAccount | null;
member?: Account;
};

Expand Down
4 changes: 2 additions & 2 deletions src/components/Chatbox/Messages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Fragment, useEffect, useRef } from 'react';

import { Box, styled } from '@mui/material';

import { ChatMessage, CompleteMember } from '@graasp/sdk';
import { ChatMessage, CurrentAccount } from '@graasp/sdk';

import { format } from 'date-fns';
import groupBy from 'lodash.groupby';
Expand Down Expand Up @@ -45,7 +45,7 @@ const SingleMessageContainer = styled(Box)({
});

type Props = {
currentMember?: CompleteMember | null;
currentMember?: CurrentAccount | null;
isAdmin?: boolean;
deleteMessageFunction?: DeleteMessageFunctionType;
};
Expand Down
2 changes: 1 addition & 1 deletion src/config/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const getDateLocale = (locale: string) => {
if (locale in dateLocales) {
return dateLocales[locale];
} else {
dateLocales.en;
return dateLocales.en;
}
};

Expand Down
6 changes: 3 additions & 3 deletions src/context/CurrentMemberContext.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React, { ReactNode } from 'react';

import { CompleteMember } from '@graasp/sdk';
import { CurrentAccount } from '@graasp/sdk';

export type CurrentMemberContextType = CompleteMember | null | undefined;
export type CurrentMemberContextType = CurrentAccount | null | undefined;

export const CurrentMemberContext =
React.createContext<CurrentMemberContextType>(null);

type Props = {
children: ReactNode;
currentMember?: CompleteMember | null;
currentMember?: CurrentAccount | null;
};

export const CurrentMemberContextProvider = ({
Expand Down
Loading

0 comments on commit 9a34e5e

Please sign in to comment.