Skip to content

Commit

Permalink
update ts
Browse files Browse the repository at this point in the history
  • Loading branch information
severinlandolt committed Jun 28, 2024
1 parent ae461fb commit 2b9a684
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 72 deletions.
5 changes: 2 additions & 3 deletions src/app/(main)/details/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { siteConfig } from "@/app/siteConfig"
import { Button } from "@/components/Button"
import { ArrowAnimated } from "@/components/ui/icons/ArrowAnimated"
import { TremorPlaceholder } from "@/components/ui/icons/TremorPlaceholder"
import Link from "next/link"

export default function Example() {
return (
Expand All @@ -21,13 +20,13 @@ export default function Example() {
Ideal for providing analytics to your users.
</p>
<Button className="group mt-6" variant="secondary" asChild>
<Link href={siteConfig.externalLink.blocks}>
<a href={siteConfig.externalLink.blocks}>
Get full template here
<ArrowAnimated
className="stroke-gray-900 dark:stroke-gray-50"
aria-hidden="true"
/>
</Link>
</a>
</Button>
</div>
</div>
Expand Down
5 changes: 2 additions & 3 deletions src/app/settings/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Button } from "@/components/Button"
import { ArrowAnimated } from "@/components/ui/icons/ArrowAnimated"
import { TremorPlaceholder } from "@/components/ui/icons/TremorPlaceholder"
import Link from "next/link"
import { siteConfig } from "../siteConfig"

export default function Settings() {
Expand All @@ -18,13 +17,13 @@ export default function Settings() {
Ideal for providing analytics to your users.
</p>
<Button className="group mt-6" variant="secondary" asChild>
<Link href={siteConfig.externalLink.blocks}>
<a href={siteConfig.externalLink.blocks}>
Get full template here
<ArrowAnimated
className="stroke-gray-900 dark:stroke-gray-50"
aria-hidden="true"
/>
</Link>
</a>
</Button>
</div>
</div>
Expand Down
66 changes: 0 additions & 66 deletions src/components/LineChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,6 @@ interface ChartTooltipProps {
const OverviewChartTooltip = ({
active,
payload,
label,
categoryColors,
valueFormatter,
}: ChartTooltipProps) => {
Expand Down Expand Up @@ -462,71 +461,6 @@ const OverviewChartTooltip = ({
return null
}

// Standard tooltip below without percentage change logic

const ChartTooltip = ({
active,
payload,
label,
categoryColors,
valueFormatter,
}: ChartTooltipProps) => {
if (active && payload) {
const filteredPayload = payload.filter((item: any) => item.type !== "none")

return (
<div
className={cx(
// base
"rounded-md border text-xs shadow-md",
// border color
"border-gray-200 dark:border-gray-800",
// background color
"bg-white dark:bg-gray-950",
)}
>
<div
className={cx(
// base
"border-b border-inherit px-2 py-1",
)}
>
<p
className={cx(
// base
"font-medium",
// text color
"text-gray-900 dark:text-gray-50",
)}
>
{label}
</p>
</div>

<div className={cx("space-y-1 px-2 py-1")}>
{filteredPayload.map(
(
{ value, name }: { value: number; name: string },
index: number,
) => (
<ChartTooltipRow
key={`id-${index}`}
value={valueFormatter(value)}
name={name}
color={getColorClassName(
categoryColors.get(name) as AvailableChartColorsKeys,
"bg",
)}
/>
),
)}
</div>
</div>
)
}
return null
}

//#region LineChart

interface ActiveDot {
Expand Down
3 changes: 3 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"allowUnusedLabels": false,
"noUnusedLocals": true,
"noUnusedParameters": true,
"plugins": [
{
"name": "next"
Expand Down

0 comments on commit 2b9a684

Please sign in to comment.