Skip to content

Commit

Permalink
fix: remove copy button from library as currently broken (#603)
Browse files Browse the repository at this point in the history
  • Loading branch information
spaenleh authored Apr 19, 2024
1 parent 46e9c00 commit a5a7e8b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
7 changes: 3 additions & 4 deletions src/components/collection/ChildrenCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import { useLibraryTranslation } from '../../config/i18n';
import { buildCollectionRoute } from '../../config/routes';
import LIBRARY from '../../langs/constants';
import { QueryClientContext } from '../QueryClientContext';
import CopyButton from './CopyButton';
import CopyLinkButton from './CopyLinkButton';
import DownloadButton from './DownloadButton';

Expand Down Expand Up @@ -74,9 +73,9 @@ export const SubItemCard: React.FC<SubItemCardProps> = ({
thumbnail,
subtext,
}) => {
const { hooks } = useContext(QueryClientContext);
// const { hooks } = useContext(QueryClientContext);

const { data: member } = hooks.useCurrentMember();
// const { data: member } = hooks.useCurrentMember();

const { name, id } = item;

Expand All @@ -88,7 +87,7 @@ export const SubItemCard: React.FC<SubItemCardProps> = ({
href={link}
actions={
<>
{member?.id && <CopyButton id={id} />}
{/* {member?.id && <CopyButton id={id} />} */}
<CopyLinkButton itemId={item.id} />
<DownloadButton id={id} />
</>
Expand Down
5 changes: 2 additions & 3 deletions src/components/collection/CollectionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import { QueryClientContext } from '../QueryClientContext';
import CardMediaComponent from '../common/CardMediaComponent';
import { StyledCard } from '../common/StyledCard';
import ContentDescription from './ContentDescription';
import CopyButton from './CopyButton';
import CopyLinkButton from './CopyLinkButton';
import DownloadButton from './DownloadButton';

Expand Down Expand Up @@ -118,7 +117,7 @@ export const CollectionCard = ({ collection, showIsContentTag }: Props) => {
} = collection;
const { t } = useLibraryTranslation();
const { hooks } = useContext(QueryClientContext);
const { data: member } = hooks.useCurrentMember();
// const { data: member } = hooks.useCurrentMember();
const { data: authorAvatarUrl, isLoading: isLoadingAvatar } =
hooks.useAvatarUrl({
id: creator?.id,
Expand Down Expand Up @@ -205,7 +204,7 @@ export const CollectionCard = ({ collection, showIsContentTag }: Props) => {
</Stack>
<Box>
<DownloadButton id={id} />
{member?.id && <CopyButton id={id} />}
{/* {member?.id && <CopyButton id={id} />} */}
<CopyLinkButton itemId={collection.id} />
</Box>
</CardActions>
Expand Down
10 changes: 4 additions & 6 deletions src/components/collection/summary/SummaryActionButtons.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React, { useState } from 'react';

import { Code, CopyAll, Download, MoreVert } from '@mui/icons-material';
import { Code, Download, MoreVert } from '@mui/icons-material';
import PlayCircleOutlineIcon from '@mui/icons-material/PlayCircleOutline';
import {
Button,
ButtonGroup,
CircularProgress,
ClickAwayListener,
Grow,
Popper,
Expand Down Expand Up @@ -34,11 +33,10 @@ type SummaryActionButtonsProps = {

const SummaryActionButtons: React.FC<SummaryActionButtonsProps> = ({
item,
isLogged,
}) => {
const { t } = useLibraryTranslation();

const { isCopying, startCopy, treeModal } = useCopyAction(item?.id);
const { treeModal } = useCopyAction(item?.id);

const { startDownload } = useDownloadAction(item?.id);

Expand Down Expand Up @@ -127,7 +125,7 @@ const SummaryActionButtons: React.FC<SummaryActionButtonsProps> = ({
>
{t(LIBRARY.SUMMARY_ACTIONS_DOWNLOAD)}
</StyledButton>
{isLogged && (
{/* {isLogged && (
<StyledButton
color="secondary"
onClick={startCopy}
Expand All @@ -145,7 +143,7 @@ const SummaryActionButtons: React.FC<SummaryActionButtonsProps> = ({
>
{t(LIBRARY.SUMMARY_ACTIONS_COPY)}
</StyledButton>
)}
)} */}
<StyledButton
color="secondary"
onClick={startEmbed}
Expand Down

0 comments on commit a5a7e8b

Please sign in to comment.