feat(settings): display app version, link

This commit is contained in:
ItzCrazyKns
2025-12-06 15:22:06 +05:30
parent 4fc810d976
commit 65ef299d72
2 changed files with 51 additions and 28 deletions

View File

@@ -1,3 +1,5 @@
import pkg from './package.json' with { type: 'json' };
/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */
const nextConfig = { const nextConfig = {
output: 'standalone', output: 'standalone',
@@ -9,6 +11,9 @@ const nextConfig = {
], ],
}, },
serverExternalPackages: ['pdf-parse'], serverExternalPackages: ['pdf-parse'],
env: {
NEXT_PUBLIC_VERSION: pkg.version,
},
}; };
export default nextConfig; export default nextConfig;

View File

@@ -3,6 +3,7 @@ import {
ArrowLeft, ArrowLeft,
BrainCog, BrainCog,
ChevronLeft, ChevronLeft,
ExternalLink,
Search, Search,
Sliders, Sliders,
ToggleRight, ToggleRight,
@@ -115,35 +116,52 @@ const SettingsDialogue = ({
</div> </div>
) : ( ) : (
<div className="flex flex-1 inset-0 h-full overflow-hidden"> <div className="flex flex-1 inset-0 h-full overflow-hidden">
<div className="hidden lg:flex flex-col w-[240px] border-r border-white-200 dark:border-dark-200 h-full px-3 pt-3 overflow-y-auto"> <div className="hidden lg:flex flex-col justify-between w-[240px] border-r border-white-200 dark:border-dark-200 h-full px-3 pt-3 overflow-y-auto">
<button <div className="flex flex-col">
onClick={() => setIsOpen(false)} <button
className="group flex flex-row items-center hover:bg-light-200 hover:dark:bg-dark-200 p-2 rounded-lg" onClick={() => setIsOpen(false)}
> className="group flex flex-row items-center hover:bg-light-200 hover:dark:bg-dark-200 p-2 rounded-lg"
<ChevronLeft >
size={18} <ChevronLeft
className="text-black/50 dark:text-white/50 group-hover:text-black/70 group-hover:dark:text-white/70" size={18}
/> className="text-black/50 dark:text-white/50 group-hover:text-black/70 group-hover:dark:text-white/70"
<p className="text-black/50 dark:text-white/50 group-hover:text-black/70 group-hover:dark:text-white/70 text-[14px]"> />
Back <p className="text-black/50 dark:text-white/50 group-hover:text-black/70 group-hover:dark:text-white/70 text-[14px]">
Back
</p>
</button>
<div className="flex flex-col items-start space-y-1 mt-8">
{sections.map((section) => (
<button
key={section.dataAdd}
className={cn(
`flex flex-row items-center space-x-2 px-2 py-1.5 rounded-lg w-full text-sm hover:bg-light-200 hover:dark:bg-dark-200 transition duration-200 active:scale-95`,
activeSection === section.key
? 'bg-light-200 dark:bg-dark-200 text-black/90 dark:text-white/90'
: ' text-black/70 dark:text-white/70',
)}
onClick={() => setActiveSection(section.key)}
>
<section.icon size={17} />
<p>{section.name}</p>
</button>
))}
</div>
</div>
<div className="flex flex-col space-y-1 py-[18px] px-2">
<p className="text-xs text-black/70 dark:text-white/70">
Version: {process.env.NEXT_PUBLIC_VERSION}
</p> </p>
</button> <a
<div className="flex flex-col items-start space-y-1 mt-8"> href="https://github.com/itzcrazykns/perplexica"
{sections.map((section) => ( target="_blank"
<button rel="noopener noreferrer"
key={section.dataAdd} className="text-xs text-black/70 dark:text-white/70 flex flex-row space-x-1 items-center transition duration-200 hover:text-black/90 hover:dark:text-white/90"
className={cn( >
`flex flex-row items-center space-x-2 px-2 py-1.5 rounded-lg w-full text-sm hover:bg-light-200 hover:dark:bg-dark-200 transition duration-200 active:scale-95`, <span>GitHub</span>
activeSection === section.key <ExternalLink size={12} />
? 'bg-light-200 dark:bg-dark-200 text-black/90 dark:text-white/90' </a>
: ' text-black/70 dark:text-white/70',
)}
onClick={() => setActiveSection(section.key)}
>
<section.icon size={17} />
<p>{section.name}</p>
</button>
))}
</div> </div>
</div> </div>
<div className="w-full flex flex-col overflow-hidden"> <div className="w-full flex flex-col overflow-hidden">