feat: fix language switcher visibility in dashboard header and align pagination buttons
This commit is contained in:
parent
01a6cab984
commit
f22bd51c5d
4 changed files with 16 additions and 7 deletions
|
|
@ -18,7 +18,7 @@ import {
|
|||
DialogTrigger,
|
||||
} from "@/components/ui/dialog"
|
||||
import { Label } from "@/components/ui/label"
|
||||
import { Plus, Search, Loader2, RefreshCw, Building2, CheckCircle, XCircle, Eye, EyeOff, Trash2, Pencil } from "lucide-react"
|
||||
import { Plus, Search, Loader2, RefreshCw, Building2, CheckCircle, XCircle, Eye, EyeOff, Trash2, Pencil, ChevronLeft, ChevronRight } from "lucide-react"
|
||||
import { Switch } from "@/components/ui/switch"
|
||||
import { adminCompaniesApi, type AdminCompany } from "@/lib/api"
|
||||
import { getCurrentUser, isAdminUser } from "@/lib/auth"
|
||||
|
|
@ -641,6 +641,7 @@ export default function AdminCompaniesPage() {
|
|||
onClick={() => loadCompanies(page - 1)}
|
||||
disabled={page <= 1 || loading}
|
||||
>
|
||||
<ChevronLeft className="h-4 w-4" />
|
||||
Previous
|
||||
</Button>
|
||||
<span>
|
||||
|
|
@ -653,6 +654,7 @@ export default function AdminCompaniesPage() {
|
|||
disabled={page >= totalPages || loading}
|
||||
>
|
||||
Next
|
||||
<ChevronRight className="h-4 w-4" />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import {
|
|||
} from "@/components/ui/dialog"
|
||||
import { Label } from "@/components/ui/label"
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"
|
||||
import { Plus, Search, Trash2, Loader2, RefreshCw, Pencil, Eye } from "lucide-react"
|
||||
import { Plus, Search, Trash2, Loader2, RefreshCw, Pencil, Eye, ChevronLeft, ChevronRight } from "lucide-react"
|
||||
import { usersApi, adminCompaniesApi, type ApiUser, type AdminCompany } from "@/lib/api"
|
||||
import { getCurrentUser, isAdminUser } from "@/lib/auth"
|
||||
import { toast } from "sonner"
|
||||
|
|
@ -643,6 +643,7 @@ export default function AdminUsersPage() {
|
|||
onClick={() => loadUsers(page - 1)}
|
||||
disabled={page <= 1 || loading}
|
||||
>
|
||||
<ChevronLeft className="h-4 w-4" />
|
||||
{t('admin.users.pagination.previous')}
|
||||
</Button>
|
||||
<span>
|
||||
|
|
@ -655,6 +656,7 @@ export default function AdminUsersPage() {
|
|||
disabled={page >= totalPages || loading}
|
||||
>
|
||||
{t('admin.users.pagination.next')}
|
||||
<ChevronRight className="h-4 w-4" />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -9,8 +9,13 @@ import {
|
|||
DropdownMenuTrigger,
|
||||
} from "@/components/ui/dropdown-menu";
|
||||
import { Globe } from "lucide-react";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
export function LanguageSwitcher() {
|
||||
interface LanguageSwitcherProps {
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export function LanguageSwitcher({ className }: LanguageSwitcherProps) {
|
||||
const { locale, setLocale } = useTranslation();
|
||||
|
||||
const locales = [
|
||||
|
|
@ -24,8 +29,8 @@ export function LanguageSwitcher() {
|
|||
return (
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button variant="ghost" size="sm" className="w-12 px-0 gap-2 focus-visible:ring-0 focus-visible:ring-offset-0 hover:bg-white/10">
|
||||
<Globe className="h-5 w-5 text-white/90 hover:text-white transition-colors" />
|
||||
<Button variant="ghost" size="sm" className={cn("w-12 px-0 gap-2 focus-visible:ring-0 focus-visible:ring-offset-0", className)}>
|
||||
<Globe className="h-5 w-5" />
|
||||
<span className="sr-only">Toggle language</span>
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ export function Navbar() {
|
|||
|
||||
{/* Desktop Auth Buttons */}
|
||||
<div className="hidden md:flex items-center gap-3">
|
||||
<LanguageSwitcher />
|
||||
<LanguageSwitcher className="text-white/90 hover:text-white hover:bg-white/10" />
|
||||
{user ? (
|
||||
<Link href="/dashboard">
|
||||
<Button variant="ghost" className="gap-2 text-white hover:text-primary transition-colors">
|
||||
|
|
@ -138,7 +138,7 @@ export function Navbar() {
|
|||
</>
|
||||
)}
|
||||
<div className="mt-4 flex justify-center">
|
||||
<LanguageSwitcher />
|
||||
<LanguageSwitcher className="text-white/90 hover:text-white hover:bg-white/10" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue