Browse Source

Merge 525a611db8 into becaabfa0f

pull/10495/merge
eliakuestner 1 day ago committed by GitHub
parent
commit
4b6efb0350
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 35
      packages/excalidraw/components/HelpButton.tsx
  2. 286
      packages/excalidraw/components/icons.tsx

35
packages/excalidraw/components/HelpButton.tsx

@ -1,6 +1,5 @@
import { t } from "../i18n"; import { t } from "../i18n";
import { HelpIcon, santaHatIcon } from "./icons";
import { HelpIcon } from "./icons";
type HelpButtonProps = { type HelpButtonProps = {
name?: string; name?: string;
@ -8,14 +7,24 @@ type HelpButtonProps = {
onClick?(): void; onClick?(): void;
}; };
export const HelpButton = (props: HelpButtonProps) => ( export const HelpButton = (props: HelpButtonProps) => {
<button const today = new Date();
className="help-icon" const month = today.getMonth(); // 0 = Januar, 11 = Dezember
onClick={props.onClick} const date = today.getDate();
type="button"
title={`${t("helpDialog.title")} — ?`} // nur vom 1.12 bis 26.12. anzeigen
aria-label={t("helpDialog.title")} const showSantaHat = month === 11 && date >= 1 && date <= 26;
>
{HelpIcon} return (
</button> <button
); className="help-icon"
onClick={props.onClick}
type="button"
title={`${t("helpDialog.title")} — ?`}
aria-label={t("helpDialog.title")}
>
{showSantaHat && santaHatIcon}
{HelpIcon}
</button>
);
};

286
packages/excalidraw/components/icons.tsx

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save