惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
Google DeepMind News
Google DeepMind News
云风的 BLOG
云风的 BLOG
WordPress大学
WordPress大学
Vercel News
Vercel News
Apple Machine Learning Research
Apple Machine Learning Research
T
Tailwind CSS Blog
I
InfoQ
小众软件
小众软件
Recent Announcements
Recent Announcements
博客园 - 【当耐特】
The GitHub Blog
The GitHub Blog
大猫的无限游戏
大猫的无限游戏
美团技术团队
T
The Blog of Author Tim Ferriss
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
酷 壳 – CoolShell
酷 壳 – CoolShell
MongoDB | Blog
MongoDB | Blog
V
V2EX
J
Java Code Geeks
有赞技术团队
有赞技术团队
博客园 - 聂微东
B
Blog RSS Feed
博客园 - 司徒正美

RSS Minima activity

Commits · main · Dan Wolff / RSS Minima · GitLab Simplify focusability check - just use CSS selector (54a793c2) · Commits · Dan Wolff / RSS Minima · GitLab Add options for wraparound; remove "singleton" version: use more constants (9645e697) · Commits · Dan Wolff / RSS Minima · GitLab Keyboard nav: Extract constants (bbbc3736) · Commits · Dan Wolff / RSS Minima · GitLab Keyboard nav: Refactor (1c3d583a) · Commits · Dan Wolff / RSS Minima · GitLab Refactor keyboard nav (b7f4c485) · Commits · Dan Wolff / RSS Minima · GitLab 89b30bd99cd47db3f069b1afa1dab30ae768e80f to af96dfe02ba2e1bb1f8e305ec418e1dff4b4ef11 · Dan Wolff / RSS Minima · GitLab Support specifying a copy format, e.g. a yt-dlp command (89b30bd9) · Commits · Dan Wolff / RSS Minima · GitLab a28898e0b013a75a7f103049894ecab36ae3f990 to 46ac7df8d6b151c6c6f1eede52fdb75a5dca4ce4 · Dan Wolff / RSS Minima · GitLab ef463f06d6b3e3850441482fba774d61a91ab477 to a28898e0b013a75a7f103049894ecab36ae3f990 · Dan Wolff / RSS Minima · GitLab 339ccf9ac2206fdd123a9a38b5c9b05c426392e7 to ef463f06d6b3e3850441482fba774d61a91ab477 · Dan Wolff / RSS Minima · GitLab Support enabling and disabling feeds (339ccf9a) · Commits · Dan Wolff / RSS Minima · GitLab 3dcfae9d95512e48127a97effc2cc5071b60ecdd to 085fced8c32f6a71b9b256fa44828d016dd5fc9b · Dan Wolff / RSS Minima · GitLab 6346d59cd010c1513ac9b7d4bf0a67424eb2d3b0 to 1df02a1b329902ab0e56fd1976851b8c0f715e65 · Dan Wolff / RSS Minima · GitLab c4da933b50794d649c07324c051c8b60ed45a770 to 6346d59cd010c1513ac9b7d4bf0a67424eb2d3b0 · Dan Wolff / RSS Minima · GitLab e21d4054912d86e30be16c105f916d35661ccb6f to c4da933b50794d649c07324c051c8b60ed45a770 · Dan Wolff / RSS Minima · GitLab Update readme (e21d4054) · Commits · Dan Wolff / RSS Minima · GitLab f6bc674460abacff785466f41feba4f73d3140d6 to fe6633a595231107eeb35f03b1d202fe1bd67626 · Dan Wolff / RSS Minima · GitLab Dan Wolff / RSS Minima · GitLab
Show the add feed form in the 'highlight' area (3dcfae9d)...
Dan Wolff · 2023-01-22 · via RSS Minima activity
Commit 3dcfae9d authored by Dan Wolff's avatar Dan Wolff
Browse files

Show the add feed form in the 'highlight' area

Original line number Diff line number Diff line
import { FunctionComponent } from "preact";
import { useEffect } from "preact/hooks";
import { addFeed } from "../state/operations.ts";
import useAppState from "../state/useAppState.ts";
import Button from "./Button.tsx";
@@ -7,6 +6,7 @@ import TextField from "./TextField.tsx";
import { useSignal } from "@preact/signals";
import Alert from "../components/Alert.tsx";
import CopyButton from "./CopyButton.tsx";
import Typography from "./Typography.tsx";

async function rss() {
  const div = document.createElement("div");
@@ -71,8 +71,11 @@ const AddFeedForm: FunctionComponent = function () {
        e.preventDefault();
        dispatch(addFeed, url.value);
      }}
      class="border p-4 mb-4"
    >
      <Typography variant="h3" class="mb-2">
        Add feed
      </Typography>

      <TextField
        label="URL"
        value={url.value}
@@ -90,7 +93,7 @@ const AddFeedForm: FunctionComponent = function () {
          {error instanceof Error ? error.message : JSON.stringify(error)}
        </Alert>
      )}
      <hr class="my-4" />
      <hr class="my-4 border-gray-500" />
      <div class="flex gap-4">
        <CopyButton
          title="Copy script to find URL from a webpage"
Original line number Diff line number Diff line
@@ -28,12 +28,7 @@ const listDisplayOptions: { value: string; label: string }[] = [
];

const App: FunctionComponent = function () {
  const {
    addFeed: { show: showAddFeed },
    listDisplay,
    nextFeedRefresh,
    dispatch,
  } = useAppState();
  const { listDisplay, nextFeedRefresh, dispatch } = useAppState();

  useEffect(() => {
    const nextRefresh = nextFeedRefresh.value;
@@ -72,7 +67,6 @@ const App: FunctionComponent = function () {

      <div class="h-0 flex-grow flex gap-4">
        <div class="pl-4 pb-8 w-0 flex-1 max-w-[35rem] overflow-auto">
          {showAddFeed.value && <AddFeedForm />}
          <List />
        </div>
        <div class="pr-4 pb-8 w-0 flex-1 overflow-auto">
Original line number Diff line number Diff line
import { FunctionComponent } from "preact";
import useAppState from "../state/useAppState.ts";
import AddFeedForm from "./AddFeedForm.tsx";
import HighlightFeed from "./HighlightFeed.tsx";
import HighlightFeedEntry from "./HighlightFeedEntry.tsx";

@@ -12,6 +13,10 @@ const Highlight: FunctionComponent = function () {
  }

  const { type, feed, feedItem } = item;
  if (type === "addFeed") {
    return <AddFeedForm />;
  }

  if (type === "feed") {
    return <HighlightFeed feed={feed} />;
  }
Original line number Diff line number Diff line
import { JSX } from "preact/jsx-runtime";

interface TypographyProps extends JSX.HTMLAttributes<HTMLDivElement> {
  variant: "h1";
  variant: "h1" | "h3";
}

type Variant = TypographyProps["variant"];

const variantComponents = {
  h1: "h1",
  h3: "h3",
} as const;

const variantStyles: Record<Variant, string> = {
  h1: "text-3xl",
  h3: "text-lg",
};

export default function Typography({ variant, ...rest }: TypographyProps) {
Original line number Diff line number Diff line
@@ -33,11 +33,13 @@ type AsyncOperation<

export type HighlightedItemId =
  | { type: "feed"; feedId: number; feedItemId?: undefined }
  | { type: "feedItem"; feedId: number; feedItemId: number };
  | { type: "feedItem"; feedId: number; feedItemId: number }
  | { type: "addFeed"; feedId?: undefined; feedItemId?: undefined };

type HighlightedItem =
  | { type: "feed"; feed: Feed; feedItem?: undefined }
  | { type: "feedItem"; feed: Feed; feedItem: FeedItem };
  | { type: "feedItem"; feed: Feed; feedItem: FeedItem }
  | { type: "addFeed"; feed?: undefined; feedItem?: undefined };

interface NextFeedRefresh {
  feed: Feed;
@@ -52,7 +54,6 @@ export type ListDisplay =
export default interface State {
  feeds: Signal<Feed[]>;
  addFeed: {
    show: Signal<boolean>;
    submission: Signal<AsyncOperation<{ url: string }>>;
  };
  removingFeed: Signal<AsyncOperation<{ feedId: number }>>;