From 1cc09cb5ac41920818347f0036983ed64079a140 Mon Sep 17 00:00:00 2001 From: Shinwoo PARK Date: Thu, 13 Jun 2024 19:01:48 +0000 Subject: [PATCH] fix: correct url for repo & add util function for building url --- src/components/LoadedCode.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/LoadedCode.tsx b/src/components/LoadedCode.tsx index 490eced..19072fa 100644 --- a/src/components/LoadedCode.tsx +++ b/src/components/LoadedCode.tsx @@ -5,7 +5,11 @@ import { Button } from "@pswui/Button"; import { useToast } from "@pswui/Toast"; import { twMerge } from "tailwind-merge"; -export const GITHUB = "https://raw.githubusercontent.com/p-sw/ui/main"; +export const GITHUB_UI = "https://raw.githubusercontent.com/pswui/ui/main"; +export const GITHUB_DOCS = "https://raw.githubusercontent.com/pswui/docs/main"; +export const GITHUB_COMP = (componentName: string) => `${GITHUB_UI}/packages/react/components/${componentName}.tsx` +export const GITHUB_COMP_PREVIEW = (componentName: string) => `${GITHUB_DOCS}/src/docs/components/${componentName}Blocks/Preview.tsx` +export const GITHUB_STORY = (componentName: string, storyName: string) => `${GITHUB_DOCS}/src/docs/components/${componentName}Blocks/Examples/${storyName}.tsx`; export const LoadedCode = ({ from,