fix(Wording): #1758 correct text for windows (#1768)

Signed-off-by: James <james@jan.ai>
Co-authored-by: James <james@jan.ai>
This commit is contained in:
NamH 2024-01-25 16:02:01 +07:00 committed by GitHub
parent 7f55c1bed1
commit acc774dc80
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 17 additions and 11 deletions

View File

@ -13,6 +13,8 @@ import { useClickOutside } from '@/hooks/useClickOutside'
import { usePath } from '@/hooks/usePath'
import { openFileTitle } from '@/utils/titleUtils'
import { activeThreadAtom } from '@/helpers/atoms/Thread.atom'
interface Props {
@ -36,13 +38,6 @@ export default function CardSidebar({
useClickOutside(() => setMore(false), null, [menu, toggle])
let openFolderTitle: string = 'Open Containing Folder'
if (isMac) {
openFolderTitle = 'Show in Finder'
} else if (isWindows) {
openFolderTitle = 'Show in File Explorer'
}
return (
<div
className={twMerge(
@ -110,7 +105,7 @@ export default function CardSidebar({
{title === 'Model' ? (
<div className="flex flex-col">
<span className="font-medium text-black dark:text-muted-foreground">
{openFolderTitle}
{openFileTitle()}
</span>
<span className="mt-1 text-muted-foreground">
Opens thread.json. Changes affect this thread only.
@ -118,7 +113,7 @@ export default function CardSidebar({
</div>
) : (
<span className="text-bold text-black dark:text-muted-foreground">
Show in Finder
{openFileTitle()}
</span>
)}
</>

View File

@ -27,6 +27,8 @@ import { usePath } from '@/hooks/usePath'
import { showRightSideBarAtom } from '@/screens/Chat/Sidebar'
import { openFileTitle } from '@/utils/titleUtils'
import { activeThreadAtom } from '@/helpers/atoms/Thread.atom'
const TopBar = () => {
@ -161,7 +163,7 @@ const TopBar = () => {
className="text-muted-foreground"
/>
<span className="font-medium text-black dark:text-muted-foreground">
Show in Finder
{openFileTitle()}
</span>
</div>
<div
@ -206,7 +208,7 @@ const TopBar = () => {
/>
<div className="flex flex-col">
<span className="font-medium text-black dark:text-muted-foreground">
Show in Finder
{openFileTitle()}
</span>
</div>
</div>

9
web/utils/titleUtils.ts Normal file
View File

@ -0,0 +1,9 @@
export const openFileTitle = (): string => {
if (isMac) {
return 'Show in Finder'
} else if (isWindows) {
return 'Show in File Explorer'
} else {
return 'Open Containing Folder'
}
}