Add terms of use translations, sync detection, and refactor book components
- Introduced new translations for terms of use in French and English locales. - Added sync status detection logic for books in `BookList` and `BookCard` components. - Refactored `BookCard` to handle additional props and improve layout flexibility. - Enhanced `TermsOfUse` component with complete localization support and refuse functionality. - Updated data decryption logic in Rust services to handle optional fields and additional metadata consistently. - Improved offline/online synchronization workflows with extended context properties.
This commit is contained in:
@@ -10,6 +10,7 @@ import {useTranslations} from '@/lib/i18n';
|
||||
import PulseLoader from '@/components/ui/PulseLoader';
|
||||
import InsetPanel from "@/components/ui/InsetPanel";
|
||||
import IconButton from "@/components/ui/IconButton";
|
||||
import OfflineContext, {OfflineContextType} from "@/context/OfflineContext";
|
||||
|
||||
// Lazy loaded Editor components
|
||||
const WorldEditor = lazy(function () {
|
||||
@@ -45,6 +46,7 @@ function PanelContent({currentPanelId}: PanelContentProps): React.JSX.Element {
|
||||
|
||||
export default function ComposerRightBar(): React.JSX.Element {
|
||||
const {book}: BookContextProps = useContext<BookContextProps>(BookContext);
|
||||
const {isCurrentlyOffline}: OfflineContextType = useContext<OfflineContextType>(OfflineContext);
|
||||
const t = useTranslations();
|
||||
|
||||
const [panelHidden, setPanelHidden] = useState<boolean>(false);
|
||||
@@ -169,6 +171,9 @@ export default function ComposerRightBar(): React.JSX.Element {
|
||||
)}
|
||||
<div className="bg-tertiary p-1 flex flex-col space-y-2">
|
||||
{book ? editorComponents.filter(function (component: PanelComponent): boolean {
|
||||
if ((isCurrentlyOffline() || book?.localBook) && component.id === 1) {
|
||||
return false;
|
||||
}
|
||||
if (component.id === 1 && book.quillsenseEnabled === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user