Skip to content

Commit

Permalink
Merge pull request BloomBooks#554 from BloomBooks/BL13639_NoDownloadF…
Browse files Browse the repository at this point in the history
…orEditMobile

Disable Download for Edit button on mobile (BL-13639) (BloomBooks#554)
  • Loading branch information
JohnThomson authored Jul 9, 2024
2 parents c35f583 + ed0dcb6 commit f30819a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/BookDetail/BookDetailHeaderGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ export const BookDetailHeaderGroup: React.FunctionComponent<{
ArtifactType.shellbook
);
const showTranslateButton =
!isEmbedded && // BL-8698, a this point, people embed BL to publish books, not encourage translation.
!isEmbedded && // BL-8698, at this point, people embed BL to publish books, not encourage translation.
shellBookSettings &&
shellBookSettings.decision && // it's OK to download and translate the book
!appHostedMode && // bloomDesktopAVailable would block this normally, but when simulating on a desktop this makes sure.
!appHostedMode && // bloomDesktopAvailable would block this normally, but when simulating on a desktop this makes sure.
bloomDesktopAvailable; // and this platform can run the software for doing it

const bloomReaderSettings = getArtifactVisibilitySettings(
Expand Down
6 changes: 5 additions & 1 deletion src/components/BookDetail/BookOwnerControlsBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import css from "@emotion/css/macro";
import { jsx } from "@emotion/core";
/** @jsx jsx */

import React, { Fragment, useEffect, useState } from "react";
import React, { Fragment, useContext, useEffect, useState } from "react";
import { Book } from "../../model/Book";
import { observer } from "mobx-react-lite";

Expand All @@ -24,13 +24,16 @@ import {
IUserBookPermissions,
useGetPermissions,
} from "../../connection/LibraryQueryHooks";
import { OSFeaturesContext } from "../OSFeaturesContext";

export const BookOwnerControlsBox: React.FunctionComponent<{
book: Book;
user: User;
showDownloadDialog: any; // pass down the ref
}> = observer((props) => {
const l10n = useIntl();
const { bloomDesktopAvailable } = useContext(OSFeaturesContext);

const [firebaseUser, setFirebaseUserUrl] = useState<firebase.User | null>(
null
);
Expand Down Expand Up @@ -230,6 +233,7 @@ export const BookOwnerControlsBox: React.FunctionComponent<{
align-self: flex-end;
margin-top: 5px;
`}
disabled={!bloomDesktopAvailable}
>
<FormattedMessage
id={"book.detail.editDownload"}
Expand Down

0 comments on commit f30819a

Please sign in to comment.