Skip to content

Commit 63c8e8f

Browse files
committed
refactor: use const to avoid typos
1 parent 8f0adf4 commit 63c8e8f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

core/src/components/content/content.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export class Content implements ComponentInterface {
8282
* For example, if a FAB in the fixed slot should receive keyboard focus before
8383
* the main page content, set this property to `'beforeContent'`.
8484
*/
85-
@Prop() fixedSlotPlacement: 'afterContent' | 'beforeContent' = 'afterContent';
85+
@Prop() fixedSlotPlacement: 'afterContent' | 'beforeContent' = AFTER_CONTENT_SLOT_POSITION;
8686

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

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

461461
<div
462462
class={{
@@ -479,7 +479,7 @@ export class Content implements ComponentInterface {
479479
</div>
480480
) : null}
481481

482-
{fixedSlotPlacement !== 'beforeContent' ? <slot name="fixed"></slot> : null}
482+
{fixedSlotPlacement === AFTER_CONTENT_SLOT_POSITION ? <slot name="fixed"></slot> : null}
483483
</Host>
484484
);
485485
}
@@ -545,3 +545,6 @@ const updateScrollDetail = (detail: ScrollDetail, el: Element, timestamp: number
545545
detail.velocityY = velocityY * 0.7 + detail.velocityY * 0.3;
546546
}
547547
};
548+
549+
const BEFORE_CONTENT_SLOT_POSITION = 'beforeContent';
550+
const AFTER_CONTENT_SLOT_POSITION = 'afterContent';

0 commit comments

Comments
 (0)