Skip to content

Commit

Permalink
And some prettifying
Browse files Browse the repository at this point in the history
  • Loading branch information
mudrila committed May 7, 2024
1 parent cb94e76 commit 8e45356
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
19 changes: 15 additions & 4 deletions src/components/ui/links/ExternalLink.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { Link, LinkProps } from '@chakra-ui/react';
import { Ref, forwardRef } from 'react'
import { Ref, forwardRef } from 'react';

export default function ExternalLink({ children, internalRef, ...rest }: LinkProps & { internalRef?: Ref<any>}) {
export default function ExternalLink({
children,
internalRef,
...rest
}: LinkProps & { internalRef?: Ref<any> }) {
return (
<Link
color="celery-0"
Expand All @@ -23,5 +27,12 @@ export default function ExternalLink({ children, internalRef, ...rest }: LinkPro
);
}

export const ExtrernalLinkWrappable = forwardRef(({ children, ...props}: LinkProps, ref) => <ExternalLink {...props} internalRef={ref} >{children}</ExternalLink>);
ExtrernalLinkWrappable.displayName = 'ExtrernalLinkWrappable';
export const ExtrernalLinkWrappable = forwardRef(({ children, ...props }: LinkProps, ref) => (
<ExternalLink
{...props}
internalRef={ref}
>
{children}
</ExternalLink>
));
ExtrernalLinkWrappable.displayName = 'ExtrernalLinkWrappable';
4 changes: 3 additions & 1 deletion src/components/ui/page/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ export function Footer() {
placement="top"
label={t('currentBuild', { hash: commitHash })}
>
<ExtrernalLinkWrappable href={`https://github.com/decentdao/decent-interface/commit/${commitHash}`}>
<ExtrernalLinkWrappable
href={`https://github.com/decentdao/decent-interface/commit/${commitHash}`}
>
{commitHash.substring(0, 7)}
</ExtrernalLinkWrappable>
</Tooltip>
Expand Down

0 comments on commit 8e45356

Please sign in to comment.