-
Notifications
You must be signed in to change notification settings - Fork 3
Center Bible card content #243
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@youversion/platform-react-ui": minor | ||
| --- | ||
|
|
||
| Center card content within full-width BibleCard and VerseOfTheDay layouts. |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -160,48 +160,51 @@ export function BibleCard({ | |||||||||||||||||||||||||||||||||||||||||||||||||||
| <section | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| data-yv-sdk | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| data-yv-theme={theme} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| className="yv:w-full yv:flex yv:flex-col yv:grow yv:bg-card yv:p-6 yv:max-w-md yv:rounded-2xl" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| className="yv:w-full yv:flex yv:flex-col yv:grow yv:bg-card yv:p-6 yv:rounded-2xl" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| style={{ boxSizing: 'border-box' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div className="yv:flex yv:w-full yv:justify-between yv:items-center yv:mb-4"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| {passage && !passageError ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div className="yv:grow yv:flex yv:items-center yv:gap-1.5"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| <BibleCardHeaderReference passage={passage} version={version} /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| {showSpinner ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| <LoaderIcon className="yv:size-3 yv:animate-spin yv:text-muted-foreground" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) : null} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) : passageError ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| <BibleCardHeaderError /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) : ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| <LoaderIcon className="yv:size-3 yv:animate-spin yv:text-muted-foreground" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| {showVersionPicker && !passageError ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| <BibleCardVersionPicker | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| versionId={versionNum} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| onVersionChange={setVersionNum} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div style={{ width: '100%', maxWidth: 600, marginInline: 'auto' }}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+163
to
+166
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: packages/ui/src/components/bible-card.tsx
Line: 163-166
Comment:
Inline styles for layout constraints (`maxWidth`, `marginInline`, `boxSizing`) are inconsistent with the Tailwind-first approach used throughout the rest of this component. The equivalent utilities `yv:max-w-[600px]`, `yv:mx-auto`, `yv:w-full`, and `yv:box-border` would keep the styling layer uniform.
```suggestion
className="yv:w-full yv:flex yv:flex-col yv:grow yv:bg-card yv:p-6 yv:rounded-2xl yv:box-border"
>
<div className="yv:w-full yv:max-w-[600px] yv:mx-auto">
```
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div className="yv:flex yv:w-full yv:justify-between yv:items-center yv:mb-4"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| {passage && !passageError ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div className="yv:grow yv:flex yv:items-center yv:gap-1.5"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| <BibleCardHeaderReference passage={passage} version={version} /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| {showSpinner ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| <LoaderIcon className="yv:size-3 yv:animate-spin yv:text-muted-foreground" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) : null} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) : passageError ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| <BibleCardHeaderError /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) : ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| <LoaderIcon className="yv:size-3 yv:animate-spin yv:text-muted-foreground" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| {showVersionPicker && !passageError ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| <BibleCardVersionPicker | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| versionId={versionNum} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| onVersionChange={setVersionNum} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| theme={theme} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| onVersionPickerPress={onVersionPickerPress} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) : null} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| <AnimatedHeight> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| <BibleTextView | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| theme={theme} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| onVersionPickerPress={onVersionPickerPress} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| fontSize={16} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| fontFamily={SOURCE_SERIF_FONT} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| reference={reference} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| versionId={versionNum} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| passageState={{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| passage, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| loading: passageLoading, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| error: passageError, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) : null} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| </AnimatedHeight> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| <AnimatedHeight> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| <BibleTextView | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| theme={theme} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| fontSize={16} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| fontFamily={SOURCE_SERIF_FONT} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| reference={reference} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| versionId={versionNum} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| passageState={{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| passage, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| loading: passageLoading, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| error: passageError, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| </AnimatedHeight> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| <BibleCardFooter copyright={!passageError ? version?.copyright : null} /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| <BibleCardFooter copyright={!passageError ? version?.copyright : null} /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| </section> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
max-width: 65chaffects all standaloneBibleTextViewconsumersBibleTextViewis a public export (packages/ui/src/components/index.ts). Removingmax-width: 65chfrom the[data-slot='yv-bible-renderer']CSS rule changes its rendered width for any consumer usingBibleTextViewdirectly — not wrapped in aBibleCardorVerseOfTheDay. Those callers previously got a readability constraint "for free"; they'll now render unbounded unless they add their own wrapper. The changeset description only mentions the card-centering behavior and doesn't call out this broader behavioral change to the low-level component.Prompt To Fix With AI