Skip to content

Commit b73fc8e

Browse files
committed
fix(storybook): build and eslint compatibility with storybook 9
1 parent c0cabd7 commit b73fc8e

File tree

75 files changed

+671
-672
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+671
-672
lines changed

packages/@liexp/ui/eslint.config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ import tseslint from "typescript-eslint";
22
import reactEslintConfig from "@liexp/core/lib/eslint/react.config.js";
33

44
export default tseslint.config(...reactEslintConfig, {
5-
files: [
6-
"src/**/*.ts",
7-
"src/**/*.tsx"],
5+
files: ["src/**/*.ts", "src/**/*.tsx"],
86
languageOptions: {
97
parserOptions: {
108
project: ["./tsconfig.json"],

packages/@liexp/ui/src/components/Media/IframeMediaElement.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ interface IframeMediaElementProps {
4343
onLoad?: (rect: DOMRect) => void;
4444
onClick?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
4545
showPlay?: boolean;
46+
fallbackImage: string;
4647
}
4748

4849
const IframeMediaElement: React.FC<IframeMediaElementProps> = ({
@@ -53,6 +54,7 @@ const IframeMediaElement: React.FC<IframeMediaElementProps> = ({
5354
className,
5455
onClick,
5556
showPlay = true,
57+
fallbackImage,
5658
...props
5759
}) => {
5860
const ref = React.useRef<HTMLIFrameElement | null>(null);
@@ -80,7 +82,7 @@ const IframeMediaElement: React.FC<IframeMediaElementProps> = ({
8082
) : (
8183
<VideoCover
8284
className={classes.cover}
83-
thumbnail={media.thumbnail}
85+
thumbnail={media.thumbnail ?? fallbackImage}
8486
style={itemStyle}
8587
showPlay={showPlay}
8688
onClick={(e) => {

packages/@liexp/ui/src/components/Media/MediaElement.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ const MediaElement: React.FC<MediaElementProps> = ({
8383
itemStyle={itemStyle}
8484
className={clsx(classes.item, itemClassName)}
8585
media={{ ...media, type: Media.IframeVideoType.literals[0] }}
86+
fallbackImage={fallbackImage}
8687
/>
8788
);
8889
case Media.PDFType.Type: {

packages/@liexp/ui/src/components/admin/events/button/EventSocialPostButton.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ import { contentTypeFromFileExt } from "@liexp/shared/lib/utils/media.utils.js";
1212
import { throwTE } from "@liexp/shared/lib/utils/task.utils.js";
1313
import { pipe } from "fp-ts/lib/function.js";
1414
import * as React from "react";
15-
import { useDataProvider, useRecordContext } from "react-admin";
15+
import { useRecordContext } from "react-admin";
1616
import { useConfiguration } from "../../../../context/ConfigurationContext.js";
1717
import { useAPI } from "../../../../hooks/useAPI.js";
18+
import { useDataProvider } from "../../../../hooks/useDataProvider.js";
1819
import { fetchRelations } from "../../../../state/queries/SearchEventsQuery.js";
1920
import { SocialPostButton } from "../../common/SocialPostButton.js";
2021

packages/@liexp/ui/src/components/lists/AreaList.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ export const AreaListItem: React.FC<
3939
ListItemProps<Area> & {
4040
defaultImage: string;
4141
style?: React.CSSProperties;
42+
onLoad?: VoidFunction;
4243
}
43-
> = ({ item, onClick, defaultImage, style }) => {
44+
> = ({ item, onClick, defaultImage, style, onLoad }) => {
4445
const Queries = useEndpointQueries();
4546
const media = Queries.Media.list.useQuery(
4647
undefined,
@@ -79,6 +80,8 @@ export const AreaListItem: React.FC<
7980
className={classes.media}
8081
image={mediaSrc}
8182
title={item.label}
83+
component="img"
84+
onLoad={onLoad}
8285
/>
8386
<CardContent>
8487
<Typography gutterBottom variant="h6" component="h3">
@@ -96,17 +99,19 @@ export const AreaListItem: React.FC<
9699
);
97100
};
98101

99-
export interface AreaListProps extends ListProps {
102+
export interface AreaListProps extends Omit<ListProps, "onLoad"> {
100103
className?: string;
101104
areas: Area[];
102105
onAreaClick: (actor: Area) => void;
103106
style?: React.CSSProperties;
107+
onLoad?: VoidFunction;
104108
}
105109

106110
export const AreaList: React.FC<AreaListProps> = ({
107111
className,
108112
areas,
109113
onAreaClick,
114+
onLoad,
110115
...props
111116
}) => {
112117
const conf = useConfiguration();
@@ -121,6 +126,7 @@ export const AreaList: React.FC<AreaListProps> = ({
121126
ListItem={(area) => (
122127
<AreaListItem
123128
{...area}
129+
onLoad={onLoad}
124130
defaultImage={conf.platforms.web.defaultImage}
125131
/>
126132
)}

packages/@liexp/ui/src/context/DataProviderContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { getAuthFromLocalStorage } from "../client/api.js";
44

55
export const DataProviderContext = React.createContext<APIRESTClient>(
66
APIRESTClient({
7-
url: "https://alpha.api.lies.exposed/v1",
7+
url: "https://api.lies.exposed/v1",
88
getAuth: getAuthFromLocalStorage,
99
}),
1010
);

packages/@liexp/ui/src/context/JSONAPIProviderContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ import * as React from "react";
44
export const JSONAPIProviderContext = React.createContext(
55
APIRESTClient({
66
// todo: should be the endpoint of space storage
7-
url: "https://alpha.api.lies.exposed/v1",
7+
url: "https://api.lies.exposed/v1",
88
}),
99
);

packages/@liexp/ui/src/hooks/useDataProvider.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { DataProviderContext } from "../context/DataProviderContext.js";
44
/**
55
* Provide context with @ts-endpoint/react-admin client
66
*
7-
*
87
*/
98
export const useDataProvider = (): APIRESTClient => {
109
const dataProvider = useContext(DataProviderContext);

pnpm-lock.yaml

Lines changed: 123 additions & 63 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

services/storybook/.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
VITE_API_URL=https://alpha.api.lies.exposed
2-
VITE_PUBLIC_URL=https://alpha.lies.exposed/storybook/
1+
VITE_API_URL=http://api.liexp.dev/v1
2+
VITE_PUBLIC_URL=http://storybook.liexp.dev/

0 commit comments

Comments
 (0)