sendou.ink/app/components/layout/TopRightButtons.tsx
Kalle 68aa12414a
New front page (#1938)
* Initial

* Progress

* Recent winners

* Add button

* Progress

* Mobile nav initial

* UI tweaks

* Overflow

* AnythingAdder links to places

* Remove color for tournament showcase

* Adjust SQ top banner based on if season is on right or not

* Tournament participant count fixed

* Log out

* todo

* Progress

* Nav complete

* Done?

* Fix lint

* Translate settings
2024-10-20 09:01:22 +03:00

48 lines
1.1 KiB
TypeScript

import * as React from "react";
import { useTranslation } from "react-i18next";
import { SUPPORT_PAGE } from "~/utils/urls";
import { LinkButton } from "../Button";
import { HamburgerIcon } from "../icons/Hamburger";
import { HeartIcon } from "../icons/Heart";
import { AnythingAdder } from "./AnythingAdder";
import { UserItem } from "./UserItem";
export function _TopRightButtons({
showSupport,
isErrored,
openNavDialog,
}: {
showSupport: boolean;
isErrored: boolean;
openNavDialog: () => void;
}) {
const { t } = useTranslation(["common"]);
return (
<div className="layout__header__right-container">
{showSupport ? (
<LinkButton
to={SUPPORT_PAGE}
size="tiny"
icon={<HeartIcon />}
variant="outlined"
>
{t("common:pages.support")}
</LinkButton>
) : null}
<AnythingAdder />
<button
aria-label="Open navigation"
onClick={openNavDialog}
className="layout__header__button"
type="button"
>
<HamburgerIcon className="layout__header__button__icon" />
</button>
{!isErrored ? <UserItem /> : null}
</div>
);
}
export const TopRightButtons = React.memo(_TopRightButtons);