mirror of
https://github.com/outline/outline.git
synced 2026-11-21 05:24:03 +03:00
* chore: Move plugin-specific integration code into plugins Core no longer imports from or names the settings of individual plugins. Plugins now register mention providers, issue status icons, instance URLs, settings keys, settings and import schemas, and OAuth clients through hooks. * fix: Recompute embed instance URLs after plugins load and match legacy issue icons by URL * fix: Skip logo upload jobs queued without a settings path * chore: Choose issue status icons from the unfurl state
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import * as React from "react";
|
|
import styled from "styled-components";
|
|
import type { UnfurlResourceType, UnfurlResponse } from "../../types";
|
|
import { DefaultIssueStatusIcon } from "./DefaultIssueStatusIcon";
|
|
import { WorkflowStatusIcon } from "./WorkflowStatusIcon";
|
|
|
|
export type BaseIconProps = {
|
|
state: UnfurlResponse[UnfurlResourceType.Issue]["state"];
|
|
className?: string;
|
|
size?: number;
|
|
};
|
|
|
|
/**
|
|
* Renders the status icon of an issue. Issues with a workflow state type show
|
|
* its progress, others show whether they are open or closed.
|
|
*
|
|
* @param props the issue state and display options.
|
|
* @returns the icon.
|
|
*/
|
|
export function IssueStatusIcon(props: BaseIconProps) {
|
|
return (
|
|
<Icon size={props.size} className={props.className}>
|
|
{props.state.type ? (
|
|
<WorkflowStatusIcon {...props} />
|
|
) : (
|
|
<DefaultIssueStatusIcon {...props} />
|
|
)}
|
|
</Icon>
|
|
);
|
|
}
|
|
|
|
const Icon = styled.span<{ size?: number }>`
|
|
display: inline-flex;
|
|
flex-shrink: 0;
|
|
width: ${(props) => props.size ?? 24}px;
|
|
height: ${(props) => props.size ?? 24}px;
|
|
align-items: center;
|
|
justify-content: center;
|
|
`;
|