-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
62 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import XIcon from "@mui/icons-material/X"; | ||
import { useTranslation } from "react-i18next"; | ||
import { SocialButton } from "./SocialButton"; | ||
|
||
interface XButtonProps { | ||
disableSpacing?: boolean; | ||
url: string; | ||
} | ||
|
||
export function XButton(props: XButtonProps) { | ||
const { t } = useTranslation(); | ||
return <SocialButton label={t("literal:x")} icon={<XIcon />} disableSpacing={props.disableSpacing} url={props.url} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { render } from "@testing-library/react"; | ||
import { XButton } from "../XButton"; | ||
import { usingTestingI18nContext } from "../../../jest/TestContextWrapper"; | ||
|
||
describe("XButton", () => { | ||
it("should match the snapshot", () => { | ||
const { getByTestId } = render(usingTestingI18nContext(<XButton url="" />).wrapper); | ||
expect(getByTestId("x-button")).toMatchSnapshot(); | ||
}); | ||
}); |
28 changes: 28 additions & 0 deletions
28
src/components/button/__tests__/__snapshots__/XButton.test.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`XButton should match the snapshot 1`] = ` | ||
<button | ||
aria-label="Open x" | ||
class="MuiButtonBase-root MuiIconButton-root MuiIconButton-sizeMedium css-1l55se7-MuiButtonBase-root-MuiIconButton-root" | ||
data-mui-internal-clone-element="true" | ||
data-testid="x-button" | ||
id="x-button" | ||
tabindex="0" | ||
type="button" | ||
> | ||
<svg | ||
aria-hidden="true" | ||
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-i4bv87-MuiSvgIcon-root" | ||
data-testid="XIcon" | ||
focusable="false" | ||
viewBox="0 0 24 24" | ||
> | ||
<path | ||
d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" | ||
/> | ||
</svg> | ||
<span | ||
class="MuiTouchRipple-root css-8je8zh-MuiTouchRipple-root" | ||
/> | ||
</button> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,5 +136,6 @@ | |
"vsCodeExtension": "VS Code Extension", | ||
"watch": "Watch", | ||
"webApp": "Web App", | ||
"x": "X", | ||
"xmpp": "XMPP" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,5 +136,6 @@ | |
"vsCodeExtension": "VS Code Extension", | ||
"watch": "Ver", | ||
"webApp": "Web App", | ||
"x": "X", | ||
"xmpp": "XMPP" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,5 +136,6 @@ | |
"vsCodeExtension": "VS Code Extension", | ||
"watch": "Assistir", | ||
"webApp": "Web App", | ||
"x": "X", | ||
"xmpp": "XMPP" | ||
} |