Skip to content

Commit

Permalink
fix: ci / eslint, typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredrethman committed Sep 12, 2024
1 parent e024f85 commit d54bf67
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Grid, TextControl } from '../../../../../components/src';
export default function AuthorBio( {
update,
data,
}: SectionComponentProps< DisplaySettings > ) {
}: ThemeModComponentProps< DisplaySettings > ) {
return (
<Grid gutter={ 32 }>
<Grid columns={ 1 } gutter={ 16 }>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function DisplaySettings() {
const [ data, setData ] =
hooks.useObjectState< DisplaySettings >( DEFAULT_THEME_MODS );

const { wizardApiFetch } = useWizardApiFetch(
const { wizardApiFetch, isFetching } = useWizardApiFetch(
'newspack-settings/display-settings'
);

Expand Down Expand Up @@ -63,8 +63,11 @@ export default function DisplaySettings() {
}

return (
<WizardsTab title={ __( 'Display Settings', 'newspack-plugin' ) }>
<pre>{ JSON.stringify( data, null, 2 ) }</pre>
<WizardsTab
title={ __( 'Display Settings', 'newspack-plugin' ) }
className={ isFetching ? 'is-fetching' : '' }
>
{ /* <pre>{ JSON.stringify( data, null, 2 ) }</pre> */ }
<WizardSection title={ __( 'Recirculation', 'newspack-plugin' ) }>
<Recirculation update={ setData } data={ data } />
</WizardSection>
Expand Down
11 changes: 5 additions & 6 deletions src/wizards/wizards-action-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ const WizardsActionCard = ( {
children,
...props
}: ActionCardProps ) => {
let checkbox: 'checked' | 'unchecked' | undefined;
if ( typeof isChecked !== 'undefined' ) {
checkbox = isChecked ? 'checked' : 'unchecked';
}
return (
<ActionCard
{ ...{
description,
checkbox:
typeof isChecked === 'undefined'
? undefined
: isChecked
? 'checked'
: 'unchecked',
checkbox,
notification: error,
notificationLevel,
...props,
Expand Down
8 changes: 7 additions & 1 deletion src/wizards/wizards-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,21 @@
function WizardsTab( {
title,
children,
isFetching,
...props
}: {
title: string;
children: React.ReactNode;
isFetching?: boolean;
className?: string;
} ) {
const className = props.className || '';
return (
<div className={ `${ className } newspack-wizard__sections` }>
<div
className={ `${
isFetching ? '' : 'is-fetching'
} ${ className } newspack-wizard__sections` }
>
<h1>{ title }</h1>
{ children }
</div>
Expand Down

0 comments on commit d54bf67

Please sign in to comment.