Skip to content
This repository has been archived by the owner on Aug 15, 2023. It is now read-only.

Commit

Permalink
chore(storybook): added stories for taboule
Browse files Browse the repository at this point in the history
  • Loading branch information
ascariandrea committed Oct 27, 2022
1 parent c909596 commit 5b53a33
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/shared/src/models/MetadataBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const MetadataBase = t.type(
*
* TODO: it may be replaced by the supporter id
*/
blang: t.union([t.string, t.null]),
blang: t.union([t.string, t.null, t.undefined]),
supporter: t.string,
researchTag: t.union([t.string, t.undefined]),
experimentId: t.union([t.string, t.undefined]),
Expand Down
30 changes: 30 additions & 0 deletions platforms/storybook/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,36 @@ module.exports = {
// console.log("config", config.resolve.plugins);
// console.log("config", config);

config.module.rules.push({
test: /\.tsx?$/,
exclude: /node_modules/,
use: [
{
loader: require.resolve('babel-loader'),
options: {
presets: [
require('@babel/preset-typescript').default,
[
require('@babel/preset-react').default,
{ runtime: 'automatic' },
],
require('@babel/preset-env').default,
],
},
},
],
});

config.resolve.extensions.push('.ts', '.tsx');

config.module.rules.push({
test: /\.mjs$/,
include: /node_modules/,
type: 'javascript/auto',
});

config.resolve.extensions.push('.mjs');

return config;
},
env: (config) => ({
Expand Down
32 changes: 30 additions & 2 deletions platforms/storybook/src/stories/Taboule.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,39 @@ const Meta: ComponentMeta<typeof Taboule> = {

export default Meta;

const tkBaseURL = 'http://localhost:14000/api';
const ytBaseURL = 'http://localhost:9000/api';

const Template: ComponentStory<typeof Taboule> = (args) => {
return <Taboule {...args} />;
};

export const Basic = Template.bind({});
Basic.args = {
export const YTPersonalSearches = Template.bind({});
YTPersonalSearches.args = {
baseURL: ytBaseURL,
query: 'youtubePersonalSearches',
};

export const YTPersonalHomes = Template.bind({});
YTPersonalHomes.args = {
baseURL: ytBaseURL,
query: 'youtubePersonalHomes',
};

export const YTPersonalVideos = Template.bind({});
YTPersonalVideos.args = {
baseURL: ytBaseURL,
query: 'youtubePersonalVideos',
};

export const TKPersonalNatives = Template.bind({});
TKPersonalNatives.args = {
baseURL: tkBaseURL,
query: 'tikTokPersonalNative',
};

export const TKPersonalSearch = Template.bind({});
TKPersonalSearch.args = {
baseURL: tkBaseURL,
query: 'tikTokPersonalSearch',
};

0 comments on commit 5b53a33

Please sign in to comment.