mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 18:00:15 +01:00
🚀 feat: Add Option to Disable Shared Links (#2986)
* feat: add option to disable shared links * chore: update languages --------- Co-authored-by: Danny Avila <danny@librechat.ai>
This commit is contained in:
parent
04502e9525
commit
8d8b17e7ed
26 changed files with 618 additions and 467 deletions
|
|
@ -8,7 +8,13 @@ import useLocalize from '~/hooks/useLocalize';
|
|||
import ExportButton from './ExportButton';
|
||||
import store from '~/store';
|
||||
|
||||
export default function ExportAndShareMenu({ className = '' }: { className?: string }) {
|
||||
export default function ExportAndShareMenu({
|
||||
isSharedButtonEnabled,
|
||||
className = '',
|
||||
}: {
|
||||
isSharedButtonEnabled: boolean;
|
||||
className?: string;
|
||||
}) {
|
||||
const localize = useLocalize();
|
||||
|
||||
const conversation = useRecoilValue(store.conversationByIndex(0));
|
||||
|
|
@ -41,13 +47,15 @@ export default function ExportAndShareMenu({ className = '' }: { className?: str
|
|||
{conversation && conversation.conversationId && (
|
||||
<>
|
||||
<ExportButton conversation={conversation} setPopoverActive={setIsPopoverActive} />
|
||||
<ShareButton
|
||||
conversationId={conversation.conversationId}
|
||||
title={conversation.title ?? ''}
|
||||
appendLabel={true}
|
||||
className="mb-[3.5px]"
|
||||
setPopoverActive={setIsPopoverActive}
|
||||
/>
|
||||
{isSharedButtonEnabled && (
|
||||
<ShareButton
|
||||
conversationId={conversation.conversationId}
|
||||
title={conversation.title ?? ''}
|
||||
appendLabel={true}
|
||||
className="mb-[3.5px]"
|
||||
setPopoverActive={setIsPopoverActive}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</DropDownMenu>
|
||||
|
|
|
|||
|
|
@ -30,9 +30,16 @@ export default function Header() {
|
|||
{modelSpecs?.length > 0 && <ModelSpecsMenu modelSpecs={modelSpecs} />}
|
||||
{<HeaderOptions interfaceConfig={interfaceConfig} />}
|
||||
{interfaceConfig.presets && <PresetsMenu />}
|
||||
{isSmallScreen && <ExportAndShareMenu className="pl-0" />}
|
||||
{isSmallScreen && (
|
||||
<ExportAndShareMenu
|
||||
isSharedButtonEnabled={startupConfig?.sharedLinksEnabled ?? false}
|
||||
className="pl-0"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
{!isSmallScreen && <ExportAndShareMenu />}
|
||||
{!isSmallScreen && (
|
||||
<ExportAndShareMenu isSharedButtonEnabled={startupConfig?.sharedLinksEnabled ?? false} />
|
||||
)}
|
||||
</div>
|
||||
{/* Empty div for spacing */}
|
||||
<div />
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { useRecoilValue } from 'recoil';
|
||||
import { useParams } from 'react-router-dom';
|
||||
import { useState, useRef, useMemo } from 'react';
|
||||
import { useGetEndpointsQuery } from 'librechat-data-provider/react-query';
|
||||
import { useGetEndpointsQuery, useGetStartupConfig } from 'librechat-data-provider/react-query';
|
||||
import type { MouseEvent, FocusEvent, KeyboardEvent } from 'react';
|
||||
import { useUpdateConversationMutation } from '~/data-provider';
|
||||
import EndpointIcon from '~/components/Endpoints/EndpointIcon';
|
||||
|
|
@ -27,9 +27,9 @@ export default function Conversation({ conversation, retainView, toggleNav, isLa
|
|||
const activeConvos = useRecoilValue(store.allConversationsSelector);
|
||||
const { data: endpointsConfig } = useGetEndpointsQuery();
|
||||
const { navigateWithLastTools } = useNavigateToConvo();
|
||||
const { data: startupConfig } = useGetStartupConfig();
|
||||
const { refreshConversations } = useConversations();
|
||||
const { showToast } = useToastContext();
|
||||
|
||||
const { conversationId, title } = conversation;
|
||||
const inputRef = useRef<HTMLInputElement | null>(null);
|
||||
const [titleInput, setTitleInput] = useState(title);
|
||||
|
|
@ -126,13 +126,15 @@ export default function Conversation({ conversation, retainView, toggleNav, isLa
|
|||
setIsPopoverActive={setIsPopoverActive}
|
||||
>
|
||||
<DropDownMenu>
|
||||
<ShareButton
|
||||
conversationId={conversationId}
|
||||
title={title}
|
||||
appendLabel={true}
|
||||
className="mb-[3.5px]"
|
||||
setPopoverActive={setIsPopoverActive}
|
||||
/>
|
||||
{startupConfig && startupConfig.sharedLinksEnabled && (
|
||||
<ShareButton
|
||||
conversationId={conversationId}
|
||||
title={title}
|
||||
appendLabel={true}
|
||||
className="mb-[3.5px]"
|
||||
setPopoverActive={setIsPopoverActive}
|
||||
/>
|
||||
)}
|
||||
|
||||
<RenameButton
|
||||
renaming={renaming}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue