mirror of
https://github.com/bakhirev/assayo.git
synced 2024-11-16 08:11:40 +00:00
update
This commit is contained in:
parent
b3d02def19
commit
53d8fb5d27
File diff suppressed because one or more lines are too long
32
src/ts/components/ExternalLink/components/PR.tsx
Normal file
32
src/ts/components/ExternalLink/components/PR.tsx
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
import ExternalLink from '../index';
|
||||||
|
import userSettings from 'ts/store/UserSettings';
|
||||||
|
|
||||||
|
interface IPRLinkProps {
|
||||||
|
prId?: string,
|
||||||
|
text?: string,
|
||||||
|
className?: string,
|
||||||
|
}
|
||||||
|
|
||||||
|
function PRLink({ prId, text, className }: IPRLinkProps) {
|
||||||
|
if (!prId) return null;
|
||||||
|
|
||||||
|
const prefix = userSettings?.settings?.linksPrefix?.task || '/';
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ExternalLink
|
||||||
|
text={text || 'PR'}
|
||||||
|
link={`${prefix}${prId}`}
|
||||||
|
className={className}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
PRLink.defaultProps = {
|
||||||
|
prId: '',
|
||||||
|
text: '',
|
||||||
|
className: '',
|
||||||
|
};
|
||||||
|
|
||||||
|
export default PRLink;
|
33
src/ts/components/ExternalLink/components/Task.tsx
Normal file
33
src/ts/components/ExternalLink/components/Task.tsx
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
import ExternalLink from '../index';
|
||||||
|
import userSettings from 'ts/store/UserSettings';
|
||||||
|
|
||||||
|
interface ITaskLinkProps {
|
||||||
|
task?: string,
|
||||||
|
className?: string,
|
||||||
|
}
|
||||||
|
|
||||||
|
function TaskLink({ task, className }: ITaskLinkProps) {
|
||||||
|
if (!task) return null;
|
||||||
|
|
||||||
|
const prefix = userSettings?.settings?.linksPrefix?.task || '/';
|
||||||
|
const formattedTask = task?.[0] === '#'
|
||||||
|
? task.replace('#', '')
|
||||||
|
: task;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ExternalLink
|
||||||
|
text={task}
|
||||||
|
link={`${prefix}${formattedTask}`}
|
||||||
|
className={className}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
TaskLink.defaultProps = {
|
||||||
|
task: '',
|
||||||
|
className: '',
|
||||||
|
};
|
||||||
|
|
||||||
|
export default TaskLink;
|
Loading…
Reference in a new issue