Skip to content

Commit

Permalink
refactor(root): prettier
Browse files Browse the repository at this point in the history
unrelated fixes after prettier sweep
  • Loading branch information
gd2910 committed Jan 21, 2025
1 parent 40e0385 commit 62d70f9
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 7 deletions.
6 changes: 5 additions & 1 deletion src/components/AnchorNav/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ interface AnchorNavProps {
id?: string;
}

const AnchorNav: React.FC<AnchorNavProps> = ({ allHeadings, currentPage, id }) => {
const AnchorNav: React.FC<AnchorNavProps> = ({
allHeadings,
currentPage,
id,
}) => {
const headings = allHeadings.filter(({ depth }) => depth === 2);

const headingIds = headings.map(({ value }) => slug(value));
Expand Down
6 changes: 3 additions & 3 deletions src/components/CodePreview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ const ComponentPreview: React.FC<ComponentPreviewProps> = ({

const tabSelectCallback = (ev: CustomEvent) => {
setSelectedTab(ev.detail.tabLabel);
localStorage.setItem("selectedTab", ev.detail.tabLabel);
localStorage.setItem("selectedTab", ev.detail.tabLabel);

const event = new CustomEvent("tabSelectionChanged", {
detail: { selectedTab: ev.detail.tabLabel },
});
Expand All @@ -295,7 +295,7 @@ const ComponentPreview: React.FC<ComponentPreviewProps> = ({
setSelectedTab(event.detail.selectedTab);
};

window.addEventListener("tabSelectionChanged", handleTabSelectionChange);
window.addEventListener("tabSelectionChanged", handleTabSelectionChange);

return () => {
window.removeEventListener(
Expand Down
5 changes: 5 additions & 0 deletions src/content/structured/get-started/angular.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,17 @@ yarn add @ukic/web-components@next @ukic/fonts@next
Import the `CUSTOM_ELEMENTS_SCHEMA`:

### For modules

Into the `app.module.ts` file:

```jsx
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from "@angular/core";
```

### For standalone components

Into the `app.component.ts` file:

```jsx
import { CUSTOM_ELEMENTS_SCHEMA, Component } from "@angular/core";
```
Expand All @@ -64,6 +68,7 @@ Include `CUSTOM_ELEMENTS_SCHEMA` in the decorator object in the same file:
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
```

### For standalone components

```jsx
Expand Down
4 changes: 4 additions & 0 deletions src/content/structured/get-started/vue.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ yarn add @ukic/web-components@next @ukic/fonts@next
Add the necessary options to your relevant configuration:

### In-Browser config

This only works if using in-browser compilation.

```jsx
app.config.compilerOptions.isCustomElement = (tag) => tag.startsWith("ic-");
```

### Vite config

Add the following to your `vite.config.js`:

```jsx
Expand All @@ -65,7 +67,9 @@ export default {
```

### Vue CLI config

Add the following to your `vue.config.js`:

```jsx
module.exports = {
chainWebpack: (config) => {
Expand Down
19 changes: 16 additions & 3 deletions src/templates/CoreTemplate/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ const CoreMDXLayout: React.FC<CoreMDXLayoutProps> = ({

useEffect(() => {
const checkFontSize = () => {
const bodyFontSize = parseFloat(window.getComputedStyle(document.body).fontSize);
const bodyFontSize = parseFloat(
window.getComputedStyle(document.body).fontSize
);
if (bodyFontSize > 16) {
setIsLargeFont(true);
} else {
Expand All @@ -85,8 +87,19 @@ const CoreMDXLayout: React.FC<CoreMDXLayoutProps> = ({
tabs={mdx.frontmatter.tabs}
location={location}
/>
<ic-section-container aligned="center" id={isLargeFont ? "page-section-container-large-font" : "page-section-container"}>
<AnchorNav currentPage={mdx.fields.slug} allHeadings={mdx.headings} id={isLargeFont ? 'anchor-nav-large-font' : ''} />
<ic-section-container
aligned="center"
id={
isLargeFont
? "page-section-container-large-font"
: "page-section-container"
}
>
<AnchorNav
currentPage={mdx.fields.slug}
allHeadings={mdx.headings}
id={isLargeFont ? "anchor-nav-large-font" : ""}
/>
<div className="content-container">
<PageMetadataContext.Provider value={pageTitleValue}>
<MDXRenderer>{children}</MDXRenderer>
Expand Down

0 comments on commit 62d70f9

Please sign in to comment.