Skip to content

Commit

Permalink
fix: Use correct classes for Field (shdwmtr#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
ricewind012 authored Dec 17, 2024
1 parent 639390d commit 4ce6b5d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
7 changes: 7 additions & 0 deletions assets/src/classes.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { findClassModule } from "@steambrew/client"

export const devClasses = findClassModule(m => m.richPresenceLabel && m.blocked) as any
export const fieldClasses: any = findClassModule(
(m) =>
m.FieldLabel &&
!m.GyroButtonPickerDialog &&
!m.ControllerOutline &&
!m.AwaitingEmailConfIcon,
);
export const pagedSettingsClasses = findClassModule(m => m.PagedSettingsDialog_PageList) as any
export const settingsClasses = findClassModule(m => m.SettingsTitleBar && m.SettingsDialogButton) as any
export const notificationClasses = findClassModule(m => m.GroupMessageTitle && !m.ShortTemplate && !m.TwoLine && !m.FriendIndicator && !m.AchievementIcon) as any;
31 changes: 12 additions & 19 deletions assets/src/custom_components/Field.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
import React, { ReactNode } from "react";
import { Classes, classMap, findClassModule } from "@steambrew/client";
import { fieldClasses } from "../classes";

const containerClasses = [
Classes.Field,
Classes.WithFirstRow,
Classes.VerticalAlignCenter,
Classes.WithDescription,
Classes.WithBottomSeparatorStandard,
Classes.ChildrenWidthFixed,
Classes.ExtraPaddingOnChildrenBelow,
Classes.StandardPadding,
Classes.HighlightOnFocus,
fieldClasses.Field,
fieldClasses.WithFirstRow,
fieldClasses.VerticalAlignCenter,
fieldClasses.WithDescription,
fieldClasses.WithBottomSeparatorStandard,
fieldClasses.ChildrenWidthFixed,
fieldClasses.ExtraPaddingOnChildrenBelow,
fieldClasses.StandardPadding,
fieldClasses.HighlightOnFocus,
"Panel",
].join(" ");
const fieldClasses: any = findClassModule(
(m) =>
m.FieldLabel &&
!m.GyroButtonPickerDialog &&
!m.ControllerOutline &&
!m.AwaitingEmailConfIcon,
);

interface FieldProps {
children: ReactNode;
Expand All @@ -41,8 +34,8 @@ export const Field: React.FC<FieldProps> = ({
<div className={containerClasses}>
<div className={fieldClasses.FieldLabelRow}>
<div className={fieldClasses.FieldLabel}>{label}</div>
<div className={classMap.FieldChildrenWithIcon}>{children}</div>
<div className={fieldClasses.FieldChildrenWithIcon}>{children}</div>
</div>
<div className={classMap.FieldDescription}>{description}</div>
<div className={fieldClasses.FieldDescription}>{description}</div>
</div>
);

0 comments on commit 4ce6b5d

Please sign in to comment.