Skip to content

Commit eb60ae2

Browse files
committed
Using fewer classnames
1 parent 9af0ba7 commit eb60ae2

5 files changed

Lines changed: 20 additions & 37 deletions

File tree

frontend/src/components/pages/rp-connect/template-gallery/template-form-panel.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,7 @@ export const TemplateFormPanel = forwardRef<TemplateFormPanelHandle, TemplateFor
241241
key={section}
242242
>
243243
<div className="flex flex-wrap items-center gap-2.5 border-divider-default border-b pb-2.5">
244-
<Heading
245-
className="font-bold text-foreground text-sm uppercase tracking-wider"
246-
id={`section-${section}`}
247-
level={5}
248-
>
244+
<Heading className="font-bold uppercase tracking-wider" id={`section-${section}`} level={5}>
249245
{SECTION_LABELS[section]}
250246
</Heading>
251247
{endpoint ? <EndpointBadge endpoint={endpoint} /> : null}

frontend/src/components/pages/rp-connect/template-gallery/template-gallery-grid.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export const TemplateGalleryGrid = ({ onSelect }: TemplateGalleryGridProps) => {
155155
data-testid="template-gallery-empty"
156156
>
157157
<Search aria-hidden className="h-6 w-6 text-muted-foreground" />
158-
<Text className="font-medium">No templates match your search</Text>
158+
<Text variant="bodyStrongMedium">No templates match your search</Text>
159159
{hasFiltersActive ? (
160160
<Button onClick={clearFilters} size="sm" variant="outline">
161161
Clear filters
@@ -177,11 +177,7 @@ export const TemplateGalleryGrid = ({ onSelect }: TemplateGalleryGridProps) => {
177177
data-testid={`template-gallery-category-${category}`}
178178
key={category}
179179
>
180-
<Heading
181-
className="font-semibold text-base text-foreground"
182-
id={`gallery-category-${category}`}
183-
level={3}
184-
>
180+
<Heading id={`gallery-category-${category}`} level={4}>
185181
{TEMPLATE_CATEGORY_LABELS[category]}
186182
</Heading>
187183
<div className="grid grid-cols-1 gap-2.5 md:grid-cols-2 lg:grid-cols-3">

frontend/src/components/redpanda-ui/components/code-block-dynamic.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { buttonVariants } from './button';
2929
import { useShiki } from '../lib/use-shiki';
3030
import { cn, type SharedProps } from '../lib/utils';
3131

32-
export function useEffectEvent<F extends (...params: never[]) => unknown>(callback: F): F {
32+
export function useStableCallback<F extends (...params: never[]) => unknown>(callback: F): F {
3333
const ref = useRef(callback);
3434
ref.current = callback;
3535

@@ -40,7 +40,7 @@ export function useCopyButton(onCopy: () => void | Promise<void>): [checked: boo
4040
const [checked, setChecked] = useState(false);
4141
const timeoutRef = useRef<number | null>(null);
4242

43-
const onClick: MouseEventHandler = useEffectEvent(() => {
43+
const onClick: MouseEventHandler = useStableCallback(() => {
4444
if (timeoutRef.current) {
4545
window.clearTimeout(timeoutRef.current);
4646
}
@@ -293,8 +293,6 @@ export function DynamicCodeBlock({
293293

294294
return (
295295
<>
296-
{/* React 19 stylesheet hoisting props (href, precedence) — not yet typed in @types/react@18. */}
297-
{/* @ts-expect-error remove once React types are upgraded to 19 */}
298296
<style href="shiki-dual-theme" precedence="medium">
299297
{shikiDualThemeStyles}
300298
</style>

frontend/src/components/ui/connect/log-explorer.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,9 +366,7 @@ export function LogExplorer({ pipeline, serverless, enableLiveView = false, titl
366366
<div className="flex items-center justify-between gap-2">
367367
<div className="flex items-center gap-3">
368368
{title ? (
369-
<Heading className="font-semibold text-base text-foreground" level={3}>
370-
{title}
371-
</Heading>
369+
<Heading level={4}>{title}</Heading>
372370
) : null}
373371
{!liveViewEnabled && (
374372
<DataTableFilter actions={actions} columns={filterColumns} filters={filters} table={table} />

frontend/src/components/ui/secret/quick-add-secrets.tsx

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ import { Button } from 'components/redpanda-ui/components/button';
1919
import { Card, CardContent, CardHeader, CardTitle } from 'components/redpanda-ui/components/card';
2020
import { Field, FieldDescription, FieldError, FieldLabel } from 'components/redpanda-ui/components/field';
2121
import { Input } from 'components/redpanda-ui/components/input';
22+
import { Spinner } from 'components/redpanda-ui/components/spinner';
2223
import { Text } from 'components/redpanda-ui/components/typography';
23-
import { Check, Key, Loader2, Plus, X } from 'lucide-react';
24+
import { Check, Key, Plus, X } from 'lucide-react';
2425
import { CreateSecretRequestSchema } from 'protogen/redpanda/api/console/v1alpha1/secret_pb';
2526
import {
2627
CreateSecretRequestSchema as CreateSecretRequestSchemaDataPlane,
@@ -265,7 +266,7 @@ export const QuickAddSecrets: React.FC<QuickAddSecretsProps> = ({
265266

266267
const requiredSecretsForm = (
267268
<>
268-
<Alert variant="warning">
269+
<Alert variant="destructive">
269270
<AlertTitle>Required secrets are missing</AlertTitle>
270271
<AlertDescription>
271272
The tool requires secrets to function properly. Create them below before proceeding.
@@ -299,7 +300,7 @@ export const QuickAddSecrets: React.FC<QuickAddSecretsProps> = ({
299300
<Button className="w-full" disabled={form.formState.isSubmitting} type="submit" variant="primary">
300301
{form.formState.isSubmitting ? (
301302
<div className="flex items-center gap-2">
302-
<Loader2 className="h-4 w-4 animate-spin" />
303+
<Spinner />
303304
<Text as="span">Creating...</Text>
304305
</div>
305306
) : (
@@ -318,20 +319,16 @@ export const QuickAddSecrets: React.FC<QuickAddSecretsProps> = ({
318319
<>
319320
{/* Display newly created secrets */}
320321
{newlyCreatedSecrets.length > 0 && (
321-
<div className="space-y-2">
322-
<Text className="font-medium text-muted-foreground text-sm">Created secrets</Text>
323-
<div className="flex flex-col gap-1.5">
322+
<Alert icon={<Check />} variant="success">
323+
<AlertTitle>Created secrets</AlertTitle>
324+
<AlertDescription>
324325
{newlyCreatedSecrets.map((secretName) => (
325-
<div
326-
className="flex items-center gap-2 rounded-md border border-green-600/30 bg-green-600/5 px-3 py-2"
327-
key={secretName}
328-
>
329-
<Check className="h-4 w-4 shrink-0 text-green-600" />
330-
<Text className="font-mono text-sm">{secretName}</Text>
331-
</div>
326+
<Text className="font-mono" key={secretName} variant="bodyMedium">
327+
{secretName}
328+
</Text>
332329
))}
333-
</div>
334-
</div>
330+
</AlertDescription>
331+
</Alert>
335332
)}
336333

337334
{/* Form to add new secrets */}
@@ -385,7 +382,7 @@ export const QuickAddSecrets: React.FC<QuickAddSecretsProps> = ({
385382
<Button className="w-full" disabled={newSecretForm.formState.isSubmitting} type="submit" variant="primary">
386383
{newSecretForm.formState.isSubmitting ? (
387384
<div className="flex items-center gap-2">
388-
<Loader2 className="h-4 w-4 animate-spin" />
385+
<Spinner />
389386
<Text as="span">Creating...</Text>
390387
</div>
391388
) : (
@@ -423,9 +420,7 @@ export const QuickAddSecrets: React.FC<QuickAddSecretsProps> = ({
423420
<div className={hasRequiredSection ? 'space-y-3 border-t pt-4' : 'space-y-4'}>
424421
{hasRequiredSection && (
425422
<div className="flex items-center justify-between gap-2">
426-
<Text className="font-medium" variant="bodyStrongMedium">
427-
Add a custom secret
428-
</Text>
423+
<Text variant="bodyStrongMedium">Add a custom secret</Text>
429424
<Button
430425
aria-label="Hide custom secret form"
431426
icon={<X />}

0 commit comments

Comments
 (0)