Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed issue Socials #2281 fix-missing-target-blank-in-footer #2560

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions workspaces/website/src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ const Root = ({ children, seo, ...rest }: RootProps) => {
aria-label="Discord"
icon={<SiDiscord fontSize="1.25rem" />}
size="small"
target="_blank"
marginRight="16px"
/>
<IconButton
Expand All @@ -170,6 +171,7 @@ const Root = ({ children, seo, ...rest }: RootProps) => {
aria-label="GitHub"
icon={<SiGithub fontSize="1.25rem" />}
size="small"
target="_blank"
marginRight="16px"
/>
<IconButton
Expand All @@ -178,13 +180,15 @@ const Root = ({ children, seo, ...rest }: RootProps) => {
aria-label="YouTube"
icon={<SiYoutube fontSize="1.25rem" />}
size="small"
target="_blank"
marginRight="16px"
/>
<IconButton
as="a"
href="https://twitter.com/Starknet"
aria-label="Twitter"
icon={<SiTwitter fontSize="1.25rem" />}
target="_blank"
size="small"
/>
</ButtonGroup>
Expand Down
11 changes: 7 additions & 4 deletions workspaces/website/src/components/IconButton/IconButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ export interface Props extends IconButtonProps {
href?: string;
size?: | "default" | "small";
variant?: 'outline' | 'primary';
target?: "_blank";
};

export const IconButton = forwardRef<HTMLButtonElement, Props>(({
href,
toId,
export const IconButton = forwardRef<HTMLButtonElement, Props>(({
href,
toId,
size,
variant = 'primary' as keyof typeof iconButtonTheme.variants,
...rest
target,
...rest
}, ref) => {
const paddingValue = size === "small" ? "0" : "11px";
const minWidthValue = size === "small" ? "auto" : "2.5rem";
Expand All @@ -33,6 +35,7 @@ export const IconButton = forwardRef<HTMLButtonElement, Props>(({
onClick={handleOnClick}
padding={paddingValue}
minWidth={minWidthValue}
target={target}
sx={iconButtonTheme?.variants?.[variant]}
{...rest}
/>
Expand Down