diff --git a/.prettierignore b/.prettierignore index 00633c2..792d21a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -40,4 +40,5 @@ yarn-error.log* *.tsbuildinfo next-env.d.ts -.gitignore \ No newline at end of file +.gitignore +.github \ No newline at end of file diff --git a/src/app/(authenticated)/workplace/page.tsx b/src/app/(authenticated)/workplace/page.tsx index c63962b..27e77d3 100644 --- a/src/app/(authenticated)/workplace/page.tsx +++ b/src/app/(authenticated)/workplace/page.tsx @@ -4,15 +4,17 @@ import FeatureFlagCard from "@/components/application/workplace/feature-flag-car import MetricCard from "@/components/application/workplace/metric-cards"; import QuickAction from "@/components/application/workplace/quick-action"; import RecentActivity from "@/components/application/workplace/recent-activity"; +import FeatureFlagsSkeleton from "@/components/application/workplace/skeletons/feature-flags-skeleton"; +import MetricCardSkeleton from "@/components/application/workplace/skeletons/metric-cards-skeleton"; +import RecentActivitySkeleton from "@/components/application/workplace/skeletons/recent-activity-skeleton"; import { useUserFlagQuery } from "@/lib/tanstack/hooks/feature-flag"; import { useGetMetrics } from "@/lib/tanstack/hooks/metrics"; import { useRecentActivity } from "@/lib/tanstack/hooks/recent-activity"; import { Flag, ArrowRight, - Loader2, - ChartColumn, ChartBarIncreasing, + ChartColumn, } from "lucide-react"; import Link from "next/link"; @@ -27,7 +29,7 @@ const Workplace = () => {
{metricsLoading ? ( - + ) : metrics ? ( Object.entries(metrics.data).map(([key, data]) => ( { Feature Flags {isLoading ? ( - + ) : featureFlags && featureFlags.data.length === 0 ? ( } @@ -93,7 +95,7 @@ const Workplace = () => {
{metricsLoading ? ( - + ) : metrics ? ( Object.entries(metrics.data).map(([key, data]) => ( {
{activityLoading ? ( - + ) : recentActivity && recentActivity.data.length > 0 ? ( recentActivity.data.map((item, index) => ( { const searchParams = useSearchParams(); @@ -16,7 +16,7 @@ const FlagList = () => { return (
{isLoading ? ( - + ) : ( featureFlags && featureFlags.data.map((flag, index) => { diff --git a/src/components/application/settings/api-key/all-keys.tsx b/src/components/application/settings/api-key/all-keys.tsx index 7eb903f..029410e 100644 --- a/src/components/application/settings/api-key/all-keys.tsx +++ b/src/components/application/settings/api-key/all-keys.tsx @@ -17,6 +17,7 @@ import { useQueryAPIKeys, useRevokeAPIKey, } from "@/lib/tanstack/hooks/api-key"; +import APIKeysSkeleton from "../skeletons/api-keys-skeleton"; export function AllKeys() { const { data: apiKeys, isLoading } = useQueryAPIKeys(); @@ -40,7 +41,7 @@ export function AllKeys() { }; return isLoading ? ( - + ) : apiKeys && apiKeys.data.length <= 0 ? ( } diff --git a/src/components/application/settings/enviroment/index.tsx b/src/components/application/settings/enviroment/index.tsx index de0c80e..df7cd9a 100644 --- a/src/components/application/settings/enviroment/index.tsx +++ b/src/components/application/settings/enviroment/index.tsx @@ -15,6 +15,7 @@ import { useAddEnvUrlMutation, useGetEnvQuery, } from "@/lib/tanstack/hooks/flag-env"; +import EnvironmentSkeleton from "../skeletons/environment-skeleton"; import { Loader2 } from "lucide-react"; const Environment = () => { @@ -69,7 +70,7 @@ const Environment = () => { {isLoading && !envUrls ? ( - + ) : (
diff --git a/src/components/application/settings/skeletons/api-keys-skeleton.tsx b/src/components/application/settings/skeletons/api-keys-skeleton.tsx new file mode 100644 index 0000000..9e399ab --- /dev/null +++ b/src/components/application/settings/skeletons/api-keys-skeleton.tsx @@ -0,0 +1,55 @@ +import { + Table, + TableBody, + TableCaption, + TableCell, + TableHead, + TableHeader, + TableRow, +} from "@/components/ui/table"; +import { Skeleton } from "@/components/ui/skeleton"; + +const APIKeysSkeleton = () => { + return ( + + Loading API Keys... + + + + + + + + + + + + + + + + + + {[...Array(3)].map((_, index) => ( + + + + + + + + + + + + + + + + ))} + +
+ ); +}; + +export default APIKeysSkeleton; diff --git a/src/components/application/settings/skeletons/environment-skeleton.tsx b/src/components/application/settings/skeletons/environment-skeleton.tsx new file mode 100644 index 0000000..bc609fc --- /dev/null +++ b/src/components/application/settings/skeletons/environment-skeleton.tsx @@ -0,0 +1,37 @@ +import { + Card, + CardContent, + CardFooter, + CardHeader, +} from "@/components/ui/card"; +import { Skeleton } from "@/components/ui/skeleton"; + +const EnvironmentSkeleton = () => { + return ( + + + + + + +
+ + +
+
+ + +
+
+ + +
+
+ + + +
+ ); +}; + +export default EnvironmentSkeleton; diff --git a/src/components/application/workplace/skeletons/feature-flags-skeleton.tsx b/src/components/application/workplace/skeletons/feature-flags-skeleton.tsx new file mode 100644 index 0000000..11fddbd --- /dev/null +++ b/src/components/application/workplace/skeletons/feature-flags-skeleton.tsx @@ -0,0 +1,71 @@ +import { + Card, + CardContent, + CardFooter, + CardHeader, +} from "@/components/ui/card"; +import { Skeleton } from "@/components/ui/skeleton"; +import { cn } from "@/lib/utils"; + +const FeatureFlagCardSkeleton = ({ + roundTop, + roundBottom, +}: { + roundTop: boolean; + roundBottom: boolean; +}) => { + return ( + + +
+
+ + + + +
+ +
+ +
+ + + + + + + +
+
+ + +
+ +
+ +
+
+ ); +}; + +const FeatureFlagsSkeleton = () => { + return ( +
+ {[...Array(3)].map((_, index) => ( + + ))} +
+ ); +}; + +export default FeatureFlagsSkeleton; diff --git a/src/components/application/workplace/skeletons/metric-cards-skeleton.tsx b/src/components/application/workplace/skeletons/metric-cards-skeleton.tsx new file mode 100644 index 0000000..dd72dce --- /dev/null +++ b/src/components/application/workplace/skeletons/metric-cards-skeleton.tsx @@ -0,0 +1,32 @@ +import { + Card, + CardContent, + CardFooter, + CardHeader, +} from "@/components/ui/card"; +import { Skeleton } from "@/components/ui/skeleton"; + +const MetricCardSkeleton = () => { + return ( + <> + {[...Array(4)].map((_, index) => ( + + + + + + + + + + + + ))} + + ); +}; + +export default MetricCardSkeleton; diff --git a/src/components/application/workplace/skeletons/recent-activity-skeleton.tsx b/src/components/application/workplace/skeletons/recent-activity-skeleton.tsx new file mode 100644 index 0000000..5847076 --- /dev/null +++ b/src/components/application/workplace/skeletons/recent-activity-skeleton.tsx @@ -0,0 +1,20 @@ +import { Skeleton } from "@/components/ui/skeleton"; + +const RecentActivitySkeleton = () => { + return ( +
+ {[...Array(5)].map((_, index) => ( +
+ + + +
+ ))} +
+ ); +}; + +export default RecentActivitySkeleton;