Skip to content

Commit

Permalink
chore(dashboard): remove hook
Browse files Browse the repository at this point in the history
  • Loading branch information
seaerchin committed Sep 29, 2022
1 parent b255e46 commit 2083043
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
6 changes: 6 additions & 0 deletions src/layouts/ReviewRequest/Dashboard.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { ComponentMeta, Story } from "@storybook/react"

import { MOCK_ITEMS } from "mocks/constants"

import {
ReviewRequestDashboard,
ReviewRequestDashboardProps,
Expand All @@ -16,6 +18,10 @@ export const Playground: Story<ReviewRequestDashboardProps> = Template.bind({})
Playground.args = {
siteName: "MOCK_ADMINS",
reviewUrl: "Copied to your clipboard kekw",
title: "Update STCCED hyperlink, customs duty",
requestor: "seaerchin",
reviewers: ["nat mae tan", "jiachin er"],
changedItems: MOCK_ITEMS,
}

export default dashboardMeta
23 changes: 9 additions & 14 deletions src/layouts/ReviewRequest/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,26 @@ import {
import { useState } from "react"
import { BiLink } from "react-icons/bi"

import { MOCK_ITEMS } from "mocks/constants"
import { extractInitials, getDateTimeFromUnixTime } from "utils"

import { RequestOverview } from "./components/RequestOverview"

const useGetPullRequest = (siteName: string) => {
return {
title: "Update STCCED hyperlink, customs duty",
requestor: "seaerchin",
reviewers: ["nat mae tan", "jiachin er"],
changedItems: MOCK_ITEMS,
}
}
import { RequestOverview, EditedItemProps } from "./components/RequestOverview"

export interface ReviewRequestDashboardProps {
siteName: string
reviewUrl: string
title: string
requestor: string
reviewers: string[]
changedItems: EditedItemProps[]
}
export const ReviewRequestDashboard = ({
siteName,
reviewUrl,
title,
requestor,
reviewers,
changedItems,
}: ReviewRequestDashboardProps): JSX.Element => {
const { title, requestor, reviewers, changedItems } = useGetPullRequest(
siteName
)
const { onCopy, hasCopied } = useClipboard(reviewUrl)

return (
Expand Down

0 comments on commit 2083043

Please sign in to comment.