Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve code snippet UI #189

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import { useEffect, useState, type FC } from 'react';
import { cn, type CodeSnippetsProps } from '@repo/utils';
import { type CodeSnippetsProps } from '@repo/utils';
import { CodeSnippetsWrapper } from '@repo/ui';
import { useDocs } from '../../../../app/docs/provider';
import { getFilters } from './utils/get-filters';
Expand Down Expand Up @@ -152,7 +152,7 @@ export const CodeSnippetsClient: FC<CodeSnippetsClientProps> = ({
{activeContent?.content ? (
<>
{error && (
<div className="flex items-center gap-2 px-4 py-3 mb-4 text-orange-900 bg-orange-100 border border-orange-300 rounded dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400">
<div className="mb-4 flex items-center gap-2 rounded border border-orange-300 bg-orange-100 px-4 py-3 text-orange-900 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400">
<InfoIcon />
{error}
</div>
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/code-snippets-wrapper/wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const CodeSnippetsWrapper: FC<CodeSnippetsWrapperProps> = ({
top,
}) => {
return (
<div className="ui-mb-6 ui-w-full ui-overflow-hidden ui-rounded ui-border ui-border-zinc-300 dark:ui-border-slate-700">
<div className="ui-my-6 ui-w-full ui-overflow-hidden ui-rounded ui-border ui-border-zinc-300 dark:ui-border-slate-700">
<div className="ui-bg-slate-50 dark:ui-bg-slate-950">
{top ? <div className="ui-px-3 ui-pb-1 ui-pt-3">{top}</div> : null}
<div className="ui-flex ui-h-12 ui-items-center ui-justify-between ui-border-b ui-border-b-zinc-300 ui-py-2 ui-pl-5 ui-pr-4 dark:ui-border-slate-700">
Expand All @@ -40,7 +40,7 @@ export const CodeSnippetsWrapper: FC<CodeSnippetsWrapperProps> = ({
</div>
</div>
</div>
<div className="ui-max-w-full ui-overflow-auto ui-p-4 ui-text-sm dark:ui-bg-slate-900">
<div className="ui-max-w-full ui-overflow-auto ui-p-4 ui-text-sm ui-bg-white dark:ui-bg-slate-900">
{children}
</div>
</div>
Expand Down