Skip to content

Commit

Permalink
fix: remove unused constants and use latest favicon
Browse files Browse the repository at this point in the history
  • Loading branch information
spaenleh committed Jan 24, 2024
1 parent 6f881bf commit e8e61b6
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 115 deletions.
26 changes: 1 addition & 25 deletions public/graasp.svg → app/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 0 additions & 19 deletions cypress/e2e/myLists/myPublishments.cy.ts

This file was deleted.

Binary file removed public/defaultAvatar.png
Binary file not shown.
Binary file removed public/favicon.ico
Binary file not shown.
Binary file removed public/homePageIcon.png
Binary file not shown.
Binary file removed public/icon.png
Binary file not shown.
10 changes: 4 additions & 6 deletions src/components/collection/CopyButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import CircularProgress from '@mui/material/CircularProgress';
import IconButton from '@mui/material/IconButton';
import Tooltip from '@mui/material/Tooltip';

import { ROOT_ID } from '../../config/constants';
import { useLibraryTranslation } from '../../config/i18n';
import {
TREE_MODAL_MY_ITEMS_ID,
Expand Down Expand Up @@ -42,11 +41,10 @@ export const useCopyAction = (id?: string) => {
ids: [id],
};

payload.to = [
ROOT_ID,
TREE_MODAL_MY_ITEMS_ID,
TREE_MODAL_SHARED_ITEMS_ID,
].includes(to)
// if the location to copy the item is MyItems or SharedItems root, then set the payload.to argument to be undefined
payload.to = [TREE_MODAL_MY_ITEMS_ID, TREE_MODAL_SHARED_ITEMS_ID].includes(
to,
)
? undefined
: to;

Expand Down
9 changes: 3 additions & 6 deletions src/components/collection/summary/Summary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ import { Stack, Typography } from '@mui/material';
import Box from '@mui/material/Box';
import Container from '@mui/material/Container';

import { DiscriminatedItem, ItemPublished } from '@graasp/sdk';
import { DiscriminatedItem, ItemPublished, ItemType } from '@graasp/sdk';

import {
ITEM_TYPES,
MAX_COLLECTION_NAME_LENGTH,
} from '../../../config/constants';
import { MAX_COLLECTION_NAME_LENGTH } from '../../../config/constants';
import { useLibraryTranslation } from '../../../config/i18n';
import LIBRARY from '../../../langs/constants';
import { QueryClientContext } from '../../QueryClientContext';
Expand Down Expand Up @@ -88,7 +85,7 @@ const Summary = ({
truncatedName={truncatedName}
totalViews={totalViews}
/>
{collection?.type === ITEM_TYPES.FOLDER && (
{collection?.type === ItemType.FOLDER && (
<>
<Box sx={{ my: 4 }} />
<Container maxWidth="lg">
Expand Down
51 changes: 1 addition & 50 deletions src/config/constants.ts
Original file line number Diff line number Diff line change
@@ -1,57 +1,16 @@
import { CategoryType, ThumbnailSize } from '@graasp/sdk';

export const GRAASP_LOGO_HEADER_HEIGHT = 40;
import { CategoryType } from '@graasp/sdk';

export const APP_NAME = 'Graasp';
export const APP_KEYWORDS = ['graasp', 'library'];
export const APP_AUTHOR = 'Graasp';
export const DEFAULT_LANG = 'en';
export const DEFAULT_USER_NAME = 'Anonymous';
export const DEFAULT_THUMBNAIL_ALT_TEXT = 'Thumbnail';

export const MIN_CARD_WIDTH = 345;

// math
export const BLOCK_MATH_DIV = 'p';
export const INLINE_MATH_DIV = 'span';
export const BLOCK_MATH_INDICATOR = '\\[';
export const INLINE_MATH_INDICATOR = '\\(';
export const BLOCK_MATH_REGEX = /(\\\[(.*?)\\])/g;
export const INLINE_MATH_REGEX = /(\\\((.*?)\\\))/g;

export const ITEM_TYPES = {
FOLDER: 'folder',
};

export const MIME_TYPES = {
HTML: 'text/html',
TEXT: 'text/plain',
};

export const MEMBER_TYPES = {
OWNER: 'owner',
CONTRIBUTOR: 'contributor',
};

export const ROOT_ID = 'ROOT';
export const TREE_VIEW_HEIGHT = 300;
export const TREE_VIEW_MIN_WIDTH = 350;

export const TWITTER_MESSAGE_MAX_LENGTH = 270;
export const MAIL_BREAK_LINE = '%0D%0A';

export const LEFT_MENU_WIDTH = 300;

export const PICTURE_QUALITIES = {
LARGE: 'large',
MEDIUM: 'medium',
};
export const DEFAULT_PICTURE_QUALITY = PICTURE_QUALITIES.LARGE;
export const MAX_COLLECTION_NAME_LENGTH = 100;

export const CLIENT_ERROR_MESSAGE = 'Something went wrong!';
export const DEFAULT_ITEM_IMAGE_PATH = '/libraryDefault.svg';
// export const DEFAULT_MEMBER_THUMBNAIL = '/defaultAvatar.png';
export const DEFAULT_MEMBER_THUMBNAIL = `data:image/svg+xml,${encodeURIComponent(`
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 -2 24 22" stroke-width="1.5" stroke="none" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z" />
Expand All @@ -60,20 +19,12 @@ export const DEFAULT_MEMBER_THUMBNAIL = `data:image/svg+xml,${encodeURIComponent
export const SMALL_AVATAR_ICON_SIZE = 30;
export const MEMBER_AVATAR_ICON_SIZE = 40;

export const DEFAULT_THUMBNAIL_SIZE = ThumbnailSize.Medium;

export const UrlSearch = {
KeywordSearch: 's',
CategorySearch: 'category',
GACrossDomainKey: '_gl',
};

export const MY_LIST_TAB_NAMES = {
MY_LIKES: 'myLikes',
MY_FAVORITES: 'myFavorites',
MY_PUBLISHMENTS: 'myPublishments',
};

export const ENV = {
DEVELOPMENT: 'development',
PRODUCTION: 'production',
Expand Down
9 changes: 0 additions & 9 deletions src/utils/date.js

This file was deleted.

0 comments on commit e8e61b6

Please sign in to comment.