Skip to content

Commit

Permalink
fix className comment, fix projectInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
Jolie Rabideau authored and Jolie Rabideau committed Dec 4, 2024
1 parent b2b6c78 commit ad26be6
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion lib/platform-bible-react/dist/index.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/platform-bible-react/dist/index.cjs.map

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions lib/platform-bible-react/dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ export type SelectedSettingsSidebarItem = {
label: string;
projectId?: string;
};
type ProjectInfo = {
export type ProjectInfo = {
projectId: string;
projectName: string;
};
Expand All @@ -446,7 +446,7 @@ export type SettingsSidebarProps = {
/** Extension labels from contribution */
extensionLabels: string[];
/** Project names and ids */
projectOptions: ProjectInfo[];
projectInfo: ProjectInfo[];
/** Handler for selecting a sidebar item */
handleSelectSidebarItem: (key: string, projectId?: string) => void;
/** The current selected value in the sidebar */
Expand All @@ -458,14 +458,14 @@ export type SettingsSidebarProps = {
/** Placeholder text for the button */
buttonPlaceholderText: string;
};
export function SettingsSidebar({ id, extensionLabels, projectOptions, handleSelectSidebarItem, selectedSidebarItem, extensionsSidebarGroupLabel, projectsSidebarGroupLabel, buttonPlaceholderText, }: SettingsSidebarProps): import("react/jsx-runtime").JSX.Element;
export function SettingsSidebar({ id, extensionLabels, projectInfo, handleSelectSidebarItem, selectedSidebarItem, extensionsSidebarGroupLabel, projectsSidebarGroupLabel, buttonPlaceholderText, }: SettingsSidebarProps): import("react/jsx-runtime").JSX.Element;
export type SettingsSidebarContentSearchProps = SettingsSidebarProps & React$1.PropsWithChildren & {
/** Optional id for testing */
id?: string;
/** Handler to run when the value of the search bar changes */
onSearch: (searchQuery: string) => void;
};
export function SettingsSidebarContentSearch({ id, extensionLabels, projectOptions, children, handleSelectSidebarItem, selectedSidebarItem, onSearch, extensionsSidebarGroupLabel, projectsSidebarGroupLabel, buttonPlaceholderText, }: SettingsSidebarContentSearchProps): import("react/jsx-runtime").JSX.Element;
export function SettingsSidebarContentSearch({ id, extensionLabels, projectInfo, children, handleSelectSidebarItem, selectedSidebarItem, onSearch, extensionsSidebarGroupLabel, projectsSidebarGroupLabel, buttonPlaceholderText, }: SettingsSidebarContentSearchProps): import("react/jsx-runtime").JSX.Element;
/**
* Information (e.g., a checking error or some other type of "transient" annotation) about something
* noteworthy at a specific place in an instance of the Scriptures.
Expand Down Expand Up @@ -925,6 +925,7 @@ export type IconButtonProps = React$1.PropsWithChildren<{
export declare function IconButton({ id, label, isDisabled, tooltip, isTooltipSuppressed, adjustMarginToAlignToEdge, size, className, onClick, children, }: IconButtonProps): import("react/jsx-runtime").JSX.Element;
/** Props for the SearchBar component. */
export type SearchBarProps = {
/** Additional css classes to help with unique styling of the search bar */
className?: string;
/**
* Callback fired to handle the search query when button pressed
Expand Down Expand Up @@ -1508,7 +1509,6 @@ export declare const usePromise: <T>(promiseFactoryCallback: (() => Promise<T>)
export declare function cn(...inputs: ClassValue[]): string;

export {
ProjectInfo as ProjectOptions,
TabNavigationContentSearch as NavigationContentSearch,
sonner,
};
Expand Down
6 changes: 3 additions & 3 deletions lib/platform-bible-react/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/platform-bible-react/dist/index.js.map

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export type SettingsSidebarContentSearchProps = SettingsSidebarProps &
export default function SettingsSidebarContentSearch({
id,
extensionLabels,
projectOptions,
projectInfo,
children,
handleSelectSidebarItem,
selectedSidebarItem,
Expand All @@ -36,7 +36,7 @@ export default function SettingsSidebarContentSearch({
<SidebarProvider id={id} className="tw-h-full tw-flex-1 tw-gap-4 tw-overflow-auto">
<SettingsSidebar
extensionLabels={extensionLabels}
projectOptions={projectOptions}
projectInfo={projectInfo}
handleSelectSidebarItem={handleSelectSidebarItem}
selectedSidebarItem={selectedSidebarItem}
extensionsSidebarGroupLabel={extensionsSidebarGroupLabel}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export type SettingsSidebarProps = {
extensionLabels: string[];

/** Project names and ids */
projectOptions: ProjectInfo[];
projectInfo: ProjectInfo[];

/** Handler for selecting a sidebar item */
handleSelectSidebarItem: (key: string, projectId?: string) => void;
Expand All @@ -48,7 +48,7 @@ export type SettingsSidebarProps = {
export default function SettingsSidebar({
id,
extensionLabels,
projectOptions,
projectInfo,
handleSelectSidebarItem,
selectedSidebarItem,
extensionsSidebarGroupLabel,
Expand All @@ -64,10 +64,10 @@ export default function SettingsSidebar({

const getProjectNameFromProjectId = useCallback(
(projectId: string) => {
const project = projectOptions.find((option) => option.projectId === projectId);
const project = projectInfo.find((info) => info.projectId === projectId);
return project ? project.projectName : projectId;
},
[projectOptions],
[projectInfo],
);

const getIsActive: (label: string) => boolean = useCallback(
Expand Down Expand Up @@ -113,7 +113,7 @@ export default function SettingsSidebar({
<SidebarGroupContent className="tw-pl-3">
<ComboBox
popoverContentClassName="tw-z-[1000]"
options={projectOptions.flatMap((option) => option.projectId)}
options={projectInfo.flatMap((info) => info.projectId)}
getOptionLabel={(projectId: ComboBoxOption) => {
// This function expects a ComboBoxOption, but we know it is a string
// eslint-disable-next-line no-type-assertion/no-type-assertion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useState } from 'react';

/** Props for the SearchBar component. */
export type SearchBarProps = {
/** Additional css classes to help with unique styling of the search bar */
className?: string;
/**
* Callback fired to handle the search query when button pressed
Expand Down
2 changes: 1 addition & 1 deletion lib/platform-bible-react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export {
export {
default as SettingsSidebar,
type SettingsSidebarProps,
type ProjectInfo as ProjectOptions,
type ProjectInfo,
type SelectedSettingsSidebarItem,
} from './components/advanced/settings-components/settings-sidebar.component';
export { default as SettingsSidebarContentSearch } from './components/advanced/settings-components/settings-sidebar-content-search.component';
Expand Down

0 comments on commit ad26be6

Please sign in to comment.