Skip to content

Commit

Permalink
feat: discover page
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed May 31, 2024
1 parent fdd7b77 commit 01ed20c
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useState } from "react"

import { FollowDialog } from "./dialog"

export function FollowButton({ feed }: { feed: FeedResponse }) {
export function DiscoverButton({ feed }: { feed: FeedResponse }) {
const [open, setOpen] = useState(false)
const [isSuccessful, setIsSuccessful] = useState(false)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { useForm } from "react-hook-form"
import { z } from "zod"

import { FollowSummary } from "../feed-summary"
import { FollowButton } from "./button"
import { DiscoverButton } from "./button"

const formSchema = z.object({
keyword: z.string().min(1),
Expand Down Expand Up @@ -53,7 +53,7 @@ const info: Record<
},
}

export function FollowForm({ type }: { type: string }) {
export function DiscoverForm({ type }: { type: string }) {
const { prefix } = info[type]
const form = useForm<z.infer<typeof formSchema>>({
resolver: zodResolver(formSchema),
Expand Down Expand Up @@ -186,7 +186,7 @@ export function FollowForm({ type }: { type: string }) {
</Button>
) :
(
<FollowButton feed={item.feed} />
<DiscoverButton feed={item.feed} />
)}
<div className="ml-6 text-zinc-500">
<span className="font-medium text-zinc-800">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const list = [
},
]

export function FollowImport() {
export function DiscoverImport() {
const form = useForm<z.infer<typeof formSchema>>({
resolver: zodResolver(formSchema),
})
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/components/feed-column/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function FeedColumn() {
</Link>
</Button>
<Button variant="ghost" size="sm">
<Link to="/follow" className="flex">
<Link to="/discover" className="flex">
<i className="i-mingcute-add-line size-5 text-zinc-500" />
</Link>
</Button>
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/components/feed-column/item.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FollowDialog } from "@renderer/components/discover/dialog"
import { FeedIcon } from "@renderer/components/feed-icon"
import { FollowDialog } from "@renderer/components/follow/dialog"
import { Dialog } from "@renderer/components/ui/dialog"
import { ToastAction } from "@renderer/components/ui/toast"
import {
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ const router = createBrowserRouter([
lazy: () => import("./pages/(main)/(context)/index"),
},
{
path: "/follow",
lazy: () => import("./pages/(main)/(context)/follow/layout"),
path: "/discover",
lazy: () => import("./pages/(main)/(context)/discover/layout"),
children: [
{
path: "",
lazy: () => import("./pages/(main)/(context)/follow/index"),
lazy: () => import("./pages/(main)/(context)/discover/index"),
},
],
},
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/src/pages/(external)/feed/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function Component() {
<div className="mb-4 text-sm">
<strong>{feed.data.subscriptionCount}</strong>
{" "}
subscriptions with
follows with
{" "}
<strong>{feed.data.readCount}</strong>
{" "}
Expand All @@ -75,7 +75,7 @@ export function Component() {
on Follow
</div>
<a className="mb-8" href={`follow://subscribe?id=${id}`}>
<Button>Subscribe on Follow</Button>
<Button>Follow on Follow</Button>
</a>
<div className={cn(
"w-full",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FollowForm } from "@renderer/components/follow/form"
import { FollowImport } from "@renderer/components/follow/import"
import { Recommendations } from "@renderer/components/follow/recommendations"
import { DiscoverForm } from "@renderer/components/discover/form"
import { DiscoverImport } from "@renderer/components/discover/import"
import { Recommendations } from "@renderer/components/discover/recommendations"
import {
Tabs,
TabsContent,
Expand Down Expand Up @@ -62,10 +62,10 @@ export function Component() {
<TabsContent key={tab.name} value={tab.name} className="mt-8 h-96">
{tab.value === "import" ?
(
<FollowImport />
<DiscoverImport />
) :
(
<FollowForm type={tab.value} />
<DiscoverForm type={tab.value} />
)}
<Recommendations type={tab.value} />
</TabsContent>
Expand Down

0 comments on commit 01ed20c

Please sign in to comment.