feat: Add Linear Project and Team icons
This commit is contained in:
@@ -2,6 +2,10 @@
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
- Add Linear Project and Team icons
|
||||
|
||||
## [0.1.3] - 2024-02-05
|
||||
|
||||
### Added
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "universal-inbox",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.3",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "universal-inbox",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.3",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@raycast/api": "^1.65.1",
|
||||
|
||||
@@ -15,7 +15,6 @@ export function getLinearUserAccessory(user?: LinearUser): List.Item.Accessory {
|
||||
|
||||
export function getLinearNotificationReasonAccessory(notification_type: string): List.Item.Accessory {
|
||||
const reason = match(notification_type)
|
||||
.with("")
|
||||
.with("issueAddedToTriage", () => "Added To Triage")
|
||||
.with("issueAddedToView", () => "Added To View")
|
||||
.with("issueAssignedToYou", () => "Assigned To You")
|
||||
|
||||
@@ -5,8 +5,8 @@ import { LinearIssuePreview } from "../preview/LinearIssuePreview";
|
||||
import { Notification } from "../../../notification";
|
||||
import { MutatePromise } from "@raycast/utils";
|
||||
import { Page } from "../../../types";
|
||||
import { match, P } from "ts-pattern";
|
||||
import { List } from "@raycast/api";
|
||||
import { match } from "ts-pattern";
|
||||
|
||||
interface LinearIssueNotificationListItemProps {
|
||||
notification: Notification;
|
||||
@@ -19,10 +19,18 @@ export function LinearIssueNotificationListItem({
|
||||
linearIssueNotification,
|
||||
mutate,
|
||||
}: LinearIssueNotificationListItemProps) {
|
||||
const projectSubtitle = linearIssueNotification.issue.project
|
||||
? `/ ${linearIssueNotification.issue.project.name} `
|
||||
: "";
|
||||
const subtitle = `${linearIssueNotification.issue.team.name} ${projectSubtitle}#${linearIssueNotification.issue.identifier}`;
|
||||
const projectSubtitle = match(linearIssueNotification.issue.project)
|
||||
.with({ name: P.select(), icon: P.nullish }, (project_name) => `/ ${project_name}`)
|
||||
.with(
|
||||
{ name: P.select("project_name"), icon: P.select("icon") },
|
||||
({ project_name, icon }) => `/ ${icon} ${project_name}`,
|
||||
)
|
||||
.otherwise(() => "");
|
||||
const teamSubtitle = match(linearIssueNotification.issue.team)
|
||||
.with({ name: P.select(), icon: P.nullish }, (team_name) => `${team_name}`)
|
||||
.with({ name: P.select("team_name"), icon: P.select("icon") }, ({ team_name, icon }) => `${icon} ${team_name}`)
|
||||
.otherwise(() => "");
|
||||
const subtitle = `${teamSubtitle} ${projectSubtitle} #${linearIssueNotification.issue.identifier}`;
|
||||
|
||||
const state = getLinearIssueStateAccessory(linearIssueNotification.issue.state);
|
||||
const assignee = getLinearUserAccessory(linearIssueNotification.issue.assignee);
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Notification } from "../../../notification";
|
||||
import { MutatePromise } from "@raycast/utils";
|
||||
import { List, Color } from "@raycast/api";
|
||||
import { Page } from "../../../types";
|
||||
import { match } from "ts-pattern";
|
||||
import { match, P } from "ts-pattern";
|
||||
|
||||
interface LinearProjectNotificationListItemProps {
|
||||
notification: Notification;
|
||||
@@ -19,7 +19,13 @@ export function LinearProjectNotificationListItem({
|
||||
linearProjectNotification,
|
||||
mutate,
|
||||
}: LinearProjectNotificationListItemProps) {
|
||||
const subtitle = linearProjectNotification.project.name;
|
||||
const subtitle = match(linearProjectNotification.project)
|
||||
.with({ name: P.select(), icon: P.nullish }, (project_name) => `${project_name}`)
|
||||
.with(
|
||||
{ name: P.select("project_name"), icon: P.select("icon") },
|
||||
({ project_name, icon }) => `${icon} ${project_name}`,
|
||||
)
|
||||
.otherwise(() => "");
|
||||
|
||||
const state = getLinearProjectStateAccessory(linearProjectNotification.project);
|
||||
const lead = getLinearUserAccessory(linearProjectNotification.project.lead);
|
||||
|
||||
Reference in New Issue
Block a user