Skip to content

Commit

Permalink
refactor: use const to avoid typos
Browse files Browse the repository at this point in the history
  • Loading branch information
liamdebeasi committed Apr 1, 2024
1 parent 8f0adf4 commit 63c8e8f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions core/src/components/content/content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class Content implements ComponentInterface {
* For example, if a FAB in the fixed slot should receive keyboard focus before
* the main page content, set this property to `'beforeContent'`.
*/
@Prop() fixedSlotPlacement: 'afterContent' | 'beforeContent' = 'afterContent';
@Prop() fixedSlotPlacement: 'afterContent' | 'beforeContent' = AFTER_CONTENT_SLOT_POSITION;

/**
* If `true` and the content does not cause an overflow scroll, the scroll interaction will cause a bounce.
Expand Down Expand Up @@ -456,7 +456,7 @@ export class Content implements ComponentInterface {
>
<div ref={(el) => (this.backgroundContentEl = el)} id="background-content" part="background"></div>

{fixedSlotPlacement === 'beforeContent' ? <slot name="fixed"></slot> : null}
{fixedSlotPlacement === BEFORE_CONTENT_SLOT_POSITION ? <slot name="fixed"></slot> : null}

<div
class={{
Expand All @@ -479,7 +479,7 @@ export class Content implements ComponentInterface {
</div>
) : null}

{fixedSlotPlacement !== 'beforeContent' ? <slot name="fixed"></slot> : null}
{fixedSlotPlacement === AFTER_CONTENT_SLOT_POSITION ? <slot name="fixed"></slot> : null}
</Host>
);
}
Expand Down Expand Up @@ -545,3 +545,6 @@ const updateScrollDetail = (detail: ScrollDetail, el: Element, timestamp: number
detail.velocityY = velocityY * 0.7 + detail.velocityY * 0.3;
}
};

const BEFORE_CONTENT_SLOT_POSITION = 'beforeContent';
const AFTER_CONTENT_SLOT_POSITION = 'afterContent';

0 comments on commit 63c8e8f

Please # to comment.