Skip to content

Commit

Permalink
[Upd #149] Updated media content story and added isIframe as global p…
Browse files Browse the repository at this point in the history
…arameter
  • Loading branch information
LaChope committed May 26, 2022
1 parent 640bb98 commit 92ffdf5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 28 deletions.
7 changes: 7 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ export const globalTypes = {
defaultValue: false,
control: { type: "boolean" },
},
isIframe: {
name: "IFrame",
description: "Set IFrame to eligible media contents",
defaultValue: false,
control: { type: "boolean" },
},
};

const options = {
Expand All @@ -61,6 +67,7 @@ const options = {
wizardStepButtons: true,
enableForwardSkip: true,
startingStep: 1,
isIframe: false,
debugMode: false,
users: [
{ id: "http://fel.cvut.cz/people/max-chopart", label: "Max Chopart" },
Expand Down
32 changes: 4 additions & 28 deletions src/stories/MediaContent.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ const question = {
"http://www.w3.org/2000/01/rdf-schema#label": "Job",
"http://onto.fel.cvut.cz/ontologies/form/has-media-content": [
"https://www.youtube.com/embed/yzXRaJCZdFI",
"https://www.youtube.com/watch?v=yzXRaJCZdFI",
"https://drive.google.com/file/d/1C8vvDQX90vFDno0HpUCUNmVhW1_EchaX/preview",
"https://drive.google.com/file/d/1ItZqsUm82nKW4ZqvKaiGUn202NEF79FC/view?usp=sharing",
"https://drive.google.com/file/d/1ItZqsUm82nKW4ZqvKaiGUn202NEF79FC/preview",
"https://medecine.univ-lorraine.fr/sites/medecine.univ-lorraine.fr/files/users/documents/schema-etudes.png",
],
};

Expand All @@ -25,33 +27,7 @@ const Template: ComponentStory<typeof MediaContent> = (args) => {
return <MediaContent {...args} />;
};

export const YoutubeVideo = Template.bind({});
YoutubeVideo.args = {
question: questionWithMedia,
};

export const ParsedUrl = Template.bind({});
ParsedUrl.args = {
export const Default = Template.bind({});
Default.args = {
question: question,
};

export const PreviewUrl = Template.bind({});
PreviewUrl.args = {
iFrame: true,
hardcodedLink:
"https://drive.google.com/file/d/1ItZqsUm82nKW4ZqvKaiGUn202NEF79FC/preview",
};

export const ViewUrl = Template.bind({});
ViewUrl.args = {
iFrame: true,
hardcodedLink:
"https://drive.google.com/file/d/1ItZqsUm82nKW4ZqvKaiGUn202NEF79FC/view?usp=sharing",
};

export const ExportViewUrl = Template.bind({});
ExportViewUrl.args = {
iFrame: true,
hardcodedLink:
"https://drive.google.com/uc?export=view&id=1ItZqsUm82nKW4ZqvKaiGUn202NEF79FC",
};

0 comments on commit 92ffdf5

Please sign in to comment.