Skip to content

Commit

Permalink
feat(chat): add navigation items
Browse files Browse the repository at this point in the history
  • Loading branch information
Mati365 committed Nov 10, 2024
1 parent 267b67b commit c6f0a86
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 2 deletions.
9 changes: 9 additions & 0 deletions apps/chat/src/i18n/packs/i18n-lang-en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ export const I18N_PACK_EN = deepmerge(I18N_FORWARDED_EN_PACK, {
loggedIn: {
logout: 'Logout',
},
search: {
placeholder: 'Search...',
button: 'Search',
},
notifications: {
title: 'Notifications',
empty: 'No new notifications',
},
github: 'View on GitHub',
},
breadcrumbs: {
routes: {
Expand Down
9 changes: 9 additions & 0 deletions apps/chat/src/i18n/packs/i18n-lang-pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ export const I18N_PACK_PL: I18nLangPack = deepmerge(I18N_FORWARDED_PL_PACK, {
loggedIn: {
logout: 'Wyloguj się',
},
search: {
placeholder: 'Szukaj...',
button: 'Szukaj',
},
notifications: {
title: 'Powiadomienia',
empty: 'Brak nowych powiadomień',
},
github: 'Zobacz na GitHub',
},
breadcrumbs: {
routes: {
Expand Down
36 changes: 35 additions & 1 deletion apps/chat/src/layouts/navigation/navigation.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { UkIcon } from '@llm/ui';
import { useI18n } from '~/i18n';
import { useSitemap } from '~/routes';

Expand All @@ -16,7 +17,7 @@ export function Navigation() {
<div className="flex flex-1 items-center gap-10">
<span className="font-semibold text-lg">DashHub</span>

<ul className="flex items-center gap-4">
<ul className="flex items-center gap-4 ml-5">
<NavigationItem path={sitemap.home} icon="message-square-text">
{t.links.home}
</NavigationItem>
Expand All @@ -41,7 +42,40 @@ export function Navigation() {

{/* Right side items */}
<div className="flex items-center gap-4">
<div className="relative group">
<input
type="text"
placeholder={t.search.placeholder}
className="focus:border-gray-200 bg-gray-100/80 focus:bg-white py-2 pr-4 pl-10 border border-transparent rounded-full focus:ring-0 w-44 focus:w-64 text-gray-800 text-sm transition-all duration-200 placeholder-gray-500 focus:outline-none"
/>
<UkIcon
icon="search"
size={18}
className="top-1/2 left-3 absolute text-gray-500 -translate-y-1/2"
/>
</div>

<button
type="button"
className="relative hover:bg-gray-100/80 p-3 rounded-full text-gray-800 hover:text-gray-900"
title={t.notifications.title}
>
<UkIcon icon="bell" size={20} className="relative top-[1px]" />
<span className="top-2 right-2 absolute bg-red-500 rounded-full w-2.5 h-2.5" />
</button>

<a
href="https://github.com/DashHub-ai/DashHub"
target="_blank"
rel="noopener noreferrer"
className="hover:bg-gray-100/80 p-3 rounded-full text-gray-800 hover:text-gray-900"
title={t.github}
>
<UkIcon icon="github" size={20} className="relative top-[1px]" />
</a>

<ChooseLanguageItem />

<LoggedInUserItem />
</div>
</nav>
Expand Down
7 changes: 6 additions & 1 deletion packages/ui/src/icons/uk-icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
type Props = {
className?: string;
icon: string;
size?: number;
};

export function UkIcon({ className, icon }: Props) {
export function UkIcon({ className, icon, size = 16 }: Props) {
return (
<uk-icon
class={className}
icon={icon}
width={size}
height={size}
/>
);
}
Expand All @@ -19,6 +22,8 @@ declare global {
'uk-icon': {
icon: string;
class?: string;
width?: number;
height?: number;
};
}
}
Expand Down

0 comments on commit c6f0a86

Please sign in to comment.