feat: Add Todoist notification list item
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import { Action, useNavigation, ActionPanel, Form, Icon, getPreferenceValues, showToast, Toast } from "@raycast/api";
|
||||
import { MutatePromise, useForm, FormValidation, useFetch } from "@raycast/utils";
|
||||
import { Page, UniversalInboxPreferences } from "../types";
|
||||
import { default as dayjs, extend } from "dayjs";
|
||||
import { Notification } from "../notification";
|
||||
import { TaskPriority } from "../task";
|
||||
import { handleErrors } from "../api";
|
||||
import utc from "dayjs/plugin/utc";
|
||||
import { useState } from "react";
|
||||
import fetch from "node-fetch";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
dayjs.extend(utc);
|
||||
extend(utc);
|
||||
|
||||
interface CreateTaskFromNotificationProps {
|
||||
notification: Notification;
|
||||
|
||||
@@ -3,15 +3,15 @@ import { Action, ActionPanel, Icon, getPreferenceValues, showToast, Toast } from
|
||||
import { CreateTaskFromNotification } from "./CreateTaskFromNotification";
|
||||
import { LinkNotificationToTask } from "./LinkNotificationToTask";
|
||||
import { Page, UniversalInboxPreferences } from "../types";
|
||||
import { default as dayjs, extend } from "dayjs";
|
||||
import { MutatePromise } from "@raycast/utils";
|
||||
import { useMemo, ReactElement } from "react";
|
||||
import { handleErrors } from "../api";
|
||||
import { TaskStatus } from "../task";
|
||||
import utc from "dayjs/plugin/utc";
|
||||
import fetch from "node-fetch";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
dayjs.extend(utc);
|
||||
extend(utc);
|
||||
|
||||
interface NotificationActionsProps {
|
||||
notification: Notification;
|
||||
@@ -20,14 +20,13 @@ interface NotificationActionsProps {
|
||||
}
|
||||
|
||||
export function NotificationActions({ notification, detailsTarget, mutate }: NotificationActionsProps) {
|
||||
const notification_html_url = useMemo(() => {
|
||||
const notificationHtmlUrl = useMemo(() => {
|
||||
return getNotificationHtmlUrl(notification);
|
||||
}, [notification]);
|
||||
|
||||
console.log("notification_html_url", notification_html_url, notification);
|
||||
return (
|
||||
<ActionPanel>
|
||||
<Action.OpenInBrowser url={notification_html_url} />
|
||||
<Action.OpenInBrowser url={notificationHtmlUrl} />
|
||||
<Action.Push title="Show Details" target={detailsTarget} />
|
||||
<Action
|
||||
title="Delete Notification"
|
||||
|
||||
@@ -25,14 +25,15 @@ interface NotificationTaskActionsProps {
|
||||
detailsTarget: ReactElement;
|
||||
mutate: MutatePromise<Page<Notification> | undefined>;
|
||||
}
|
||||
|
||||
export function NotificationTaskActions({ notification, detailsTarget }: NotificationTaskActionsProps) {
|
||||
const notification_html_url = useMemo(() => {
|
||||
const notificationHtmlUrl = useMemo(() => {
|
||||
return getNotificationHtmlUrl(notification);
|
||||
}, [notification]);
|
||||
|
||||
return (
|
||||
<ActionPanel>
|
||||
<Action.OpenInBrowser url={notification_html_url} />
|
||||
<Action.OpenInBrowser url={notificationHtmlUrl} />
|
||||
<Action.Push title="Show Details" target={detailsTarget} />
|
||||
<Action
|
||||
title="Delete Notification"
|
||||
|
||||
Reference in New Issue
Block a user