Skip to content

Commit

Permalink
feat: update X brand logo & tweak labels (excalidraw#7518)
Browse files Browse the repository at this point in the history
  • Loading branch information
dwelle committed Jan 4, 2024
1 parent 8b50418 commit aecf608
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 47 deletions.
7 changes: 4 additions & 3 deletions packages/excalidraw/components/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -485,10 +485,11 @@ export const DiscordIcon = createIcon(
modifiedTablerIconProps,
);

export const TwitterIcon = createIcon(
export const XBrandIcon = createIcon(
<g strokeWidth="1.25">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M22 4.01c-1 .49 -1.98 .689 -3 .99c-1.121 -1.265 -2.783 -1.335 -4.38 -.737s-2.643 2.06 -2.62 3.737v1c-3.245 .083 -6.135 -1.395 -8 -4c0 0 -4.182 7.433 4 11c-1.872 1.247 -3.739 2.088 -6 2c3.308 1.803 6.913 2.423 10.034 1.517c3.58 -1.04 6.522 -3.723 7.651 -7.742a13.84 13.84 0 0 0 .497 -3.753c-.002 -.249 1.51 -2.772 1.818 -4.013z"></path>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M4 4l11.733 16h4.267l-11.733 -16z" />
<path d="M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772" />
</g>,
tablerIconProps,
);
Expand Down
56 changes: 30 additions & 26 deletions packages/excalidraw/components/main-menu/DefaultItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
TrashIcon,
usersIcon,
} from "../icons";
import { GithubIcon, DiscordIcon, TwitterIcon } from "../icons";
import { GithubIcon, DiscordIcon, XBrandIcon } from "../icons";
import DropdownMenuItem from "../dropdownMenu/DropdownMenuItem";
import DropdownMenuItemLink from "../dropdownMenu/DropdownMenuItemLink";
import {
Expand Down Expand Up @@ -249,31 +249,35 @@ export const Export = () => {
};
Export.displayName = "Export";

export const Socials = () => (
<>
<DropdownMenuItemLink
icon={GithubIcon}
href="https://github.com/excalidraw/excalidraw"
aria-label="GitHub"
>
GitHub
</DropdownMenuItemLink>
<DropdownMenuItemLink
icon={DiscordIcon}
href="https://discord.gg/UexuTaE"
aria-label="Discord"
>
Discord
</DropdownMenuItemLink>
<DropdownMenuItemLink
icon={TwitterIcon}
href="https://twitter.com/excalidraw"
aria-label="Twitter"
>
Twitter
</DropdownMenuItemLink>
</>
);
export const Socials = () => {
const { t } = useI18n();

return (
<>
<DropdownMenuItemLink
icon={GithubIcon}
href="https://github.com/excalidraw/excalidraw"
aria-label="GitHub"
>
GitHub
</DropdownMenuItemLink>
<DropdownMenuItemLink
icon={XBrandIcon}
href="https://x.com/excalidraw"
aria-label="X"
>
{t("labels.followUs")}
</DropdownMenuItemLink>
<DropdownMenuItemLink
icon={DiscordIcon}
href="https://discord.gg/UexuTaE"
aria-label="Discord"
>
{t("labels.discordChat")}
</DropdownMenuItemLink>
</>
);
};
Socials.displayName = "Socials";

export const LiveCollaborationTrigger = ({
Expand Down
4 changes: 3 additions & 1 deletion packages/excalidraw/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@
"removeAllElementsFromFrame": "Remove all elements from frame",
"eyeDropper": "Pick color from canvas",
"textToDiagram": "Text to diagram",
"prompt": "Prompt"
"prompt": "Prompt",
"followUs": "Follow us",
"discordChat": "Discord chat"
},
"library": {
"noItems": "No items added yet...",
Expand Down
37 changes: 20 additions & 17 deletions packages/excalidraw/tests/__snapshots__/excalidraw.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -387,12 +387,12 @@ exports[`<Excalidraw/> > Test UIOptions prop > Test canvasActions > should rende
</div>
</a>
<a
aria-label="Discord"
aria-label="X"
class="dropdown-menu-item dropdown-menu-item-base"
href="https://discord.gg/UexuTaE"
href="https://x.com/excalidraw"
rel="noreferrer"
target="_blank"
title="Discord"
title="X"
>
<div
class="dropdown-menu-item__icon"
Expand All @@ -406,33 +406,39 @@ exports[`<Excalidraw/> > Test UIOptions prop > Test canvasActions > should rende
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
viewBox="0 0 20 20"
stroke-width="2"
viewBox="0 0 24 24"
>
<g
stroke-width="1.25"
>
<path
d="M7.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM12.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM6.25 6.25c2.917-.833 4.583-.833 7.5 0M5.833 13.75c2.917.833 5.417.833 8.334 0"
d="M0 0h24v24H0z"
fill="none"
stroke="none"
/>
<path
d="M12.917 14.167c0 .833 1.25 2.5 1.666 2.5 1.25 0 2.361-1.39 2.917-2.5.556-1.39.417-4.861-1.25-9.584-1.214-.846-2.5-1.116-3.75-1.25l-.833 2.084M7.083 14.167c0 .833-1.13 2.5-1.526 2.5-1.191 0-2.249-1.39-2.778-2.5-.529-1.39-.397-4.861 1.19-9.584 1.157-.846 2.318-1.116 3.531-1.25l.833 2.084"
d="M4 4l11.733 16h4.267l-11.733 -16z"
/>
<path
d="M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772"
/>
</g>
</svg>
</div>
<div
class="dropdown-menu-item__text"
>
Discord
Follow us
</div>
</a>
<a
aria-label="Twitter"
aria-label="Discord"
class="dropdown-menu-item dropdown-menu-item-base"
href="https://twitter.com/excalidraw"
href="https://discord.gg/UexuTaE"
rel="noreferrer"
target="_blank"
title="Twitter"
title="Discord"
>
<div
class="dropdown-menu-item__icon"
Expand All @@ -446,27 +452,24 @@ exports[`<Excalidraw/> > Test UIOptions prop > Test canvasActions > should rende
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
viewBox="0 0 24 24"
viewBox="0 0 20 20"
>
<g
stroke-width="1.25"
>
<path
d="M0 0h24v24H0z"
fill="none"
stroke="none"
d="M7.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM12.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM6.25 6.25c2.917-.833 4.583-.833 7.5 0M5.833 13.75c2.917.833 5.417.833 8.334 0"
/>
<path
d="M22 4.01c-1 .49 -1.98 .689 -3 .99c-1.121 -1.265 -2.783 -1.335 -4.38 -.737s-2.643 2.06 -2.62 3.737v1c-3.245 .083 -6.135 -1.395 -8 -4c0 0 -4.182 7.433 4 11c-1.872 1.247 -3.739 2.088 -6 2c3.308 1.803 6.913 2.423 10.034 1.517c3.58 -1.04 6.522 -3.723 7.651 -7.742a13.84 13.84 0 0 0 .497 -3.753c-.002 -.249 1.51 -2.772 1.818 -4.013z"
d="M12.917 14.167c0 .833 1.25 2.5 1.666 2.5 1.25 0 2.361-1.39 2.917-2.5.556-1.39.417-4.861-1.25-9.584-1.214-.846-2.5-1.116-3.75-1.25l-.833 2.084M7.083 14.167c0 .833-1.13 2.5-1.526 2.5-1.191 0-2.249-1.39-2.778-2.5-.529-1.39-.397-4.861 1.19-9.584 1.157-.846 2.318-1.116 3.531-1.25l.833 2.084"
/>
</g>
</svg>
</div>
<div
class="dropdown-menu-item__text"
>
Twitter
Discord chat
</div>
</a>
</div>
Expand Down

0 comments on commit aecf608

Please sign in to comment.