Skip to content

Commit

Permalink
fix: group header extra action button for wider mode
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Aug 22, 2024
1 parent f33598b commit 213b4a5
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/renderer/src/modules/entry-column/layouts/EntryListHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { EntryHeader } from "@renderer/modules/entry-content/header"
import { useRefreshFeedMutation } from "@renderer/queries/feed"
import { useFeedById, useFeedHeaderTitle } from "@renderer/store/feed"
import type { FC } from "react"
import * as React from "react"

import { MarkAllReadButton } from "../components/mark-all-button"

Expand Down Expand Up @@ -108,12 +109,14 @@ export const EntryListHeader: FC<{
entryId !== ROUTE_ENTRY_PENDING && (
<>
<EntryHeader view={view} entryId={entryId} />
<DividerVertical className="w-px" />
<DividerVertical className="mx-2 w-px" />
</>
)}

{view === FeedViewType.SocialMedia && <DailyReportButton />}
{view === FeedViewType.Pictures && <SwitchToMasonryButton />}
<AppendTaildingDivider>
{view === FeedViewType.SocialMedia && <DailyReportButton />}
{view === FeedViewType.Pictures && <SwitchToMasonryButton />}
</AppendTaildingDivider>

{isOnline ? (
feed?.ownerUserId === user?.id && isBizId(routerParams.feedId!) ?
Expand Down Expand Up @@ -215,3 +218,10 @@ const SwitchToMasonryButton = () => {
</ImpressionView>
)
}

const AppendTaildingDivider = ({ children }: { children: React.ReactNode }) => (
<>
{children}
{React.Children.count(children) > 1 && (<DividerVertical className="mx-2 w-px" />)}
</>
)

0 comments on commit 213b4a5

Please sign in to comment.