mirror of
https://github.com/SomboChea/ui
synced 2026-01-19 01:25:51 +07:00
initial commit
This commit is contained in:
16
src/components/Link/index.js
Normal file
16
src/components/Link/index.js
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* @prettier
|
||||
* @flow
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import type { Node } from 'react';
|
||||
import { IProps } from './types';
|
||||
|
||||
const Link = ({ children, to = '#', blank = false, ...props }: IProps): Node => (
|
||||
<a href={to} target={blank ? '_blank' : '_self'} {...props}>
|
||||
{children}
|
||||
</a>
|
||||
);
|
||||
|
||||
export default Link;
|
||||
12
src/components/Link/types.js
Normal file
12
src/components/Link/types.js
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* @prettier
|
||||
* @flow
|
||||
*/
|
||||
|
||||
import type { Node } from 'react';
|
||||
|
||||
export interface IProps {
|
||||
children?: Node;
|
||||
to?: string;
|
||||
blank?: boolean;
|
||||
}
|
||||
Reference in New Issue
Block a user