-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating Stories for Card, Banner, Media with Caption. #7
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
1f453e5
Banner changes
jenbreese 39e46d4
fixup to the media with caption
jenbreese 2235eb6
adding the composition to comply with lint
jenbreese 03c2bcc
removed experiment for lint
jenbreese 57d67c5
added the composition
jenbreese badc996
merging
jenbreese f083173
fixup for the error
jenbreese c64b3f5
Merge branch 'main' into FE-learning
jenbreese 9cc245f
padding and font size changes
jenbreese 56b7a3b
added typename and classes
jenbreese 19bab11
Merge branch 'main' into FE-learning
jenbreese 93c4ff7
Merge branch 'main' into FE-learning
jenbreese f807a61
Adding changes to the Lockup in the header
jenbreese 2b77862
merge
jenbreese a440083
change to modular type size
jenbreese File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import type {Meta, StoryObj} from '@storybook/react'; | ||
import {ComponentProps} from "react"; | ||
import {ParagraphStanfordBanner, Text} from "@lib/gql/__generated__/drupal"; | ||
import BannerParagraph from '@components/paragraphs/stanford-banner/banner-paragraph'; | ||
import { getStoryBookImage } from '../storybook-entities'; | ||
|
||
type ComponentStoryProps = ComponentProps<typeof BannerParagraph> & { | ||
text: Text["processed"] | ||
} | ||
|
||
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction | ||
const meta: Meta<ComponentStoryProps> = { | ||
title: 'Design/Paragraphs/Banner', | ||
component: BannerParagraph, | ||
tags: ['autodocs'], | ||
argTypes: {} | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<ComponentStoryProps>; | ||
|
||
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args | ||
export const Banner: Story = { | ||
render: ({...args}) => { | ||
return <BannerParagraph {...args}/> | ||
}, | ||
args: { | ||
paragraph:{ | ||
__typename: 'ParagraphStanfordBanner', | ||
composition: {}, | ||
langcode: {}, | ||
created: { | ||
offset: "", | ||
timestamp: Math.round(new Date().getTime() / 1000), | ||
time: new Date().toISOString(), | ||
timezone: "America/Los_Angeles" | ||
}, | ||
id: "9954cc81-919b-4498-9151-bf930831fca7", | ||
suBannerHeader: "Nam scelerisque, urna vitae auctor efficitur, tortor nunc cursus tortor, ut blandit purus arcu quis sapien", | ||
suBannerBody: { | ||
processed: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras vitae dignissim felis. Nullam nulla leo, venenatis at feugiat sit amet, ultricies non lorem.</p>" | ||
}, | ||
suBannerImage: getStoryBookImage(), | ||
suBannerSupHeader: "Vestibulum" | ||
} | ||
} | ||
}; |
50 changes: 50 additions & 0 deletions
50
.storybook/stories/paragraphs/MediaWithCaption.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { ComponentProps } from "react"; | ||
import StanfordMediaCaption from '@components/paragraphs/stanford-media-caption/media-caption-paragraph'; | ||
import { getStoryBookImage } from '../storybook-entities'; | ||
|
||
type ComponentStoryProps = ComponentProps<typeof StanfordMediaCaption> & { | ||
// text: Text["processed"] | ||
} | ||
|
||
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction | ||
const meta: Meta<ComponentStoryProps> = { | ||
title: 'Design/Paragraphs/MediaCaption', | ||
component: StanfordMediaCaption, | ||
tags: ['autodocs'], | ||
argTypes: {} | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<ComponentStoryProps>; | ||
|
||
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args | ||
export const Caption: Story = { | ||
render: ({ ...args }) => { | ||
return <StanfordMediaCaption {...args} /> | ||
}, | ||
args: { | ||
paragraph: { | ||
id:"6fa23537-dda7-4861-930a-648445d9904c", | ||
__typename: 'ParagraphStanfordMediaCaption', | ||
composition: {}, | ||
langcode: {}, | ||
created: { | ||
offset: "", | ||
timestamp: Math.round(new Date().getTime() / 1000), | ||
time: new Date().toISOString(), | ||
timezone: "America/Los_Angeles" | ||
}, | ||
suMediaCaptionCaption: { | ||
processed:"<p>Here is my caption.</p>" | ||
}, | ||
suMediaCaptionLink: { | ||
title:"Link text.", | ||
url:"/publications", | ||
internal:true | ||
}, | ||
suMediaCaptionMedia: getStoryBookImage(), | ||
} | ||
} | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a 100ch width applied to the p within this. It keeps it from aligning flush right to the image edge. @pookmish Do you know the best way to fix that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I know what you mean. when should the text align to the image edge of the banner?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry @pookmish That comment should have gone on the media with caption file.
cardinal-sites-next/src/components/paragraphs/stanford-media-caption/media-caption-paragraph.tsx
Line 40 in a440083
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, but from what I see, it is aligning to the right of the image. I'm not sure what you are seeing different

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it is right aligned fine now for me too. 🤷🏼♀️