Skip to content

Commit bb849ea

Browse files
committed
Refactor imports in manager.ts and manager-helpers.tsx for consistency
1 parent ecaa79d commit bb849ea

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

.storybook/manager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { addons } from "storybook/manager-api";
1+
import { addons } from 'storybook/manager-api';
22

3-
import { renderLabel } from "../dist/manager-helpers.js";
3+
import { renderLabel } from '../src/manager-helpers';
44

55
/*
66
* This is an example of opt-in usage of addon exports. Your users can choose to

src/manager-helpers.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
import React from "react";
2-
import type { API_HashEntry } from 'storybook/internal/types'
3-
import { ADDON_ID } from "./constants";
1+
import React from 'react';
2+
import type { API_HashEntry } from 'storybook/internal/types';
3+
import { ADDON_ID } from './constants';
44

55
/**
66
* This opt-in helper can be manually imported by your users who want to
77
* use it, and ignored by those who don't.
88
*/
99
export function renderLabel(item: API_HashEntry) {
10-
if (
11-
item.type !== 'story' &&
12-
item.type !== 'docs'
13-
) {
14-
return
10+
if (item.type !== 'story' && item.type !== 'docs') {
11+
return;
1512
}
1613

1714
if (item.title.startsWith(ADDON_ID)) {
18-
return <span>🌟 {item.name}</span>
15+
return <span>🌟 {item.name}</span>;
1916
}
20-
}
17+
}

0 commit comments

Comments
 (0)