diff --git a/components/LocationMenu.tsx b/components/LocationMenu.tsx index 9e6499fa..0c9b40d7 100644 --- a/components/LocationMenu.tsx +++ b/components/LocationMenu.tsx @@ -14,29 +14,59 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -import BrSelect from "./brickroom/BrSelect"; +import { Text } from "@bbtgnn/polaris-interfacer"; import { useRouter } from "next/router"; +import { ChildrenProp } from "./brickroom/types"; +import TopbarPopover from "./partials/topbar/TopbarPopover"; const LocationMenu = ({ className }: { className?: string }) => { const router = useRouter(); const { pathname, asPath, query, locale } = router; - const handleSelect = (e: any) => { - e.preventDefault(); - router.push({ pathname, query }, asPath, { locale: e.target.value }); + const handleSelect = (loc: string) => { + router.push({ pathname, query }, asPath, { locale: loc }); }; + //locales with flag + const locales = [ + { label: "en", flag: "🇬🇧" }, + { label: "fr", flag: "🇫🇷" }, + { label: "it", flag: "🇮🇹" }, + { label: "de", flag: "🇩🇪" }, + ]; + return ( - + + {locales.find(l => l.label === locale)?.flag} + + } + > +
+
+ {locales.map(loc => ( + handleSelect(loc.label)} key={loc.label}> + + {loc.flag} + + + ))} +
+
+
); }; export default LocationMenu; + +function MenuLink(props: { onclick: () => void } & ChildrenProp) { + const { onclick, children } = props; + return ( + + ); +} diff --git a/components/SearchBar.tsx b/components/SearchBar.tsx index fa90cb90..4fdec95c 100644 --- a/components/SearchBar.tsx +++ b/components/SearchBar.tsx @@ -14,9 +14,9 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -import React, { useEffect, useState } from "react"; -import { useRouter } from "next/router"; import { useTranslation } from "next-i18next"; +import { useRouter } from "next/router"; +import React, { useState } from "react"; const SearchBar = () => { const router = useRouter(); @@ -34,7 +34,7 @@ const SearchBar = () => { setSearchString(e.target.value)} /> diff --git a/components/brickroom/BrSelect.tsx b/components/brickroom/BrSelect.tsx deleted file mode 100644 index d2d18105..00000000 --- a/components/brickroom/BrSelect.tsx +++ /dev/null @@ -1,73 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// Copyright (C) 2022-2023 Dyne.org foundation . -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -import React, { ChangeEventHandler } from "react"; -import { ExclamationIcon } from "@heroicons/react/solid"; - -type BrSelectProps = { - array: Array<{ id: string; name: string }>; - placeholder?: string; - label?: string; - value?: string | Array; - handleSelect: ChangeEventHandler; - hint?: string; - error?: string; - className?: string; - roundedLG?: boolean; - multiple?: boolean; -}; - -const BrSelect = (props: BrSelectProps) => { - const selectClass = props.roundedLG ? "select select-bordered rounded-full" : "select select-bordered"; - - return ( - <> -
- - - -
- - ); -}; - -export default BrSelect; diff --git a/components/brickroom/IfSidebarItem.tsx b/components/brickroom/IfSidebarItem.tsx index aef552dd..62a06c2b 100644 --- a/components/brickroom/IfSidebarItem.tsx +++ b/components/brickroom/IfSidebarItem.tsx @@ -30,10 +30,10 @@ const IfSidebarItem = ({ text, tag, leftIcon, rightIcon, disabled = false, activ const classes = classNames({ // Base styles "flex flex-row justify-between": true, - "btn btn-ghost font-medium normal-case rounded-lg border-2": true, + "font-medium normal-case rounded-lg border-2 p-4": true, // Disabled styles "text-primary hover:bg-amber-200": !disabled, - "btn-disabled text-gray-400 border-0": disabled, + "text-gray-400 border-0": disabled, // Active styles "border-none": !active, "border-amber-200": active, diff --git a/components/layout/WithFilterLayout.tsx b/components/layout/WithFilterLayout.tsx index 77c5e7cd..1baa4462 100644 --- a/components/layout/WithFilterLayout.tsx +++ b/components/layout/WithFilterLayout.tsx @@ -1,5 +1,5 @@ +import { Button } from "@bbtgnn/polaris-interfacer"; import { AdjustmentsIcon } from "@heroicons/react/outline"; -import cn from "classnames"; import PTitleCounter from "components/polaris/PTitleCounter"; import ProjectsFilters from "components/ProjectsFilters"; import { useTranslation } from "next-i18next"; @@ -31,15 +31,14 @@ const WithFilterLayout = ({
{header ? :
} {!hideFilters && ( - + {t("Filter by")} + )}
diff --git a/components/partials/topbar/Topbar.tsx b/components/partials/topbar/Topbar.tsx index 26951feb..48e21a71 100644 --- a/components/partials/topbar/Topbar.tsx +++ b/components/partials/topbar/Topbar.tsx @@ -43,7 +43,11 @@ function Topbar({ search = true, children, userMenu = true, cta, burger = true }
{children} {burger && ( -