-
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.
feat: add node terms and conditions (#7)
* deps: upgrade front-core to 1.24.2 * deps: upgrade sdk * feat: add node terms and conditions
- Loading branch information
Showing
19 changed files
with
1,947 additions
and
946 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { memo } from 'react' | ||
import { StyledExternalLink } from './styles' | ||
import { ExternalLinkProps } from './types' | ||
import { Icon } from '@aleph-front/core' | ||
|
||
export const ExternalLink = ({ | ||
text, | ||
href, | ||
color, | ||
typo, | ||
underline, | ||
...props | ||
}: ExternalLinkProps) => { | ||
return ( | ||
<> | ||
<StyledExternalLink | ||
href={href} | ||
target="_blank" | ||
$color={color} | ||
$typo={typo} | ||
$underline={underline} | ||
{...props} | ||
> | ||
{text ? text : href} | ||
<Icon name="square-up-right" tw="ml-1.5" /> | ||
</StyledExternalLink> | ||
</> | ||
) | ||
} | ||
ExternalLink.displayName = 'ExternalLink' | ||
|
||
export default memo(ExternalLink) as typeof ExternalLink |
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,2 @@ | ||
export { default } from './cmp' | ||
export type { ExternalLinkProps } from './types' |
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,17 @@ | ||
import { CoreTheme, getTypoCss } from '@aleph-front/core' | ||
import styled from 'styled-components' | ||
import { css } from 'styled-components' | ||
|
||
export type StyledExternalLinkProps = { | ||
$color?: keyof CoreTheme['color'] | ||
$typo?: keyof CoreTheme['typo'] | ||
$underline?: boolean | ||
} | ||
|
||
export const StyledExternalLink = styled.a<StyledExternalLinkProps>` | ||
${({ theme, $color = 'white', $typo, $underline = false }) => css` | ||
color: ${theme.color[$color]}; | ||
text-decoration: ${$underline ? 'underline' : 'none'}; | ||
${$typo ? getTypoCss($typo) : ''} | ||
`} | ||
` |
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 { CoreTheme } from '@aleph-front/core' | ||
import { AnchorHTMLAttributes } from 'react' | ||
|
||
export type ExternalLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & { | ||
href: string | ||
text?: string | ||
color?: keyof CoreTheme['color'] | ||
typo?: keyof CoreTheme['typo'] | ||
underline?: boolean | ||
} |
Oops, something went wrong.