- Refactored SharePanel to retrieve the share URL directly from the entry data. - Enhanced UrlBuilder with a new method for generating share URLs that includes view and subscription parameters. - Updated the shareEntry method to utilize the new structure for better flexibility. Signed-off-by: Innei <tukon479@gmail.com>
25 lines
594 B
TypeScript
25 lines
594 B
TypeScript
import { FeedViewType } from "@follow/constants"
|
|
import { UrlBuilder as UrlBuilderClass } from "@follow/utils/url-builder"
|
|
|
|
import { WEB_URL } from "~/constants/env"
|
|
|
|
class WebUrlBuilder extends UrlBuilderClass {
|
|
constructor() {
|
|
super(WEB_URL)
|
|
}
|
|
|
|
shareEntry(
|
|
id: string,
|
|
options?: {
|
|
view?: FeedViewType
|
|
subscriptionId?: string
|
|
},
|
|
) {
|
|
const { view = FeedViewType.Articles, subscriptionId = "all" } = options || {}
|
|
|
|
return super.join(`timeline/view-${view}/${subscriptionId}/${id}`, { share: "1" })
|
|
}
|
|
}
|
|
|
|
export const UrlBuilder = new WebUrlBuilder()
|