Skip to content
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

Set pre-wrap for doc descriptions #81

Merged
merged 1 commit into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/BrickDocEvents/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function BrickDocEvents({
{event.deprecated ? <del>{event.name}</del> : event.name}
</code>
</td>
<td>{event.description}</td>
<td className="pre-wrap">{event.description}</td>
<td>
<MaybeEmptyCode>
{event.detail?.annotation ? (
Expand Down
2 changes: 1 addition & 1 deletion src/components/BrickDocInterface/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default function BrickDocInterface({
<td style={{ textAlign: "center" }}>
{item.type === "indexSignature" || item.optional ? "" : "✅"}
</td>
<td>{item.description}</td>
<td className="pre-wrap">{item.description}</td>
</tr>
))}
</tbody>
Expand Down
2 changes: 1 addition & 1 deletion src/components/BrickDocMethods/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function BrickDocMethods({
{method.deprecated ? <del>{method.name}</del> : method.name}
</code>
</td>
<td>{method.description}</td>
<td className="pre-wrap">{method.description}</td>
<td>
{method.params.map((param, index, array) => (
<React.Fragment key={index}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/BrickDocParts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function BrickDocParts({
<td>
<code>{part.name}</code>
</td>
<td>{part.description}</td>
<td className="pre-wrap">{part.description}</td>
</tr>
))}
</tbody>
Expand Down
2 changes: 1 addition & 1 deletion src/components/BrickDocProperties/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function BrickDocProperties({
{prop.deprecated ? <del>{prop.name}</del> : prop.name}
</code>
</td>
<td>{prop.description}</td>
<td className="pre-wrap">{prop.description}</td>
<td>
<MaybeEmptyCode>
<GeneralType annotation={prop.annotation} />
Expand Down
22 changes: 11 additions & 11 deletions src/components/BrickDocSlots/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import type { SlotManifest } from "@next-core/brick-manifest";
import MaybeEmptyCode from "@site/src/components/MaybeEmptyCode";

export default function BrickDocSlots({
slots
slots,
}: {
slots: SlotManifest[]
slots: SlotManifest[];
}): JSX.Element {
return (
<table>
Expand All @@ -16,15 +16,15 @@ export default function BrickDocSlots({
</tr>
</thead>
<tbody>
{
slots.map(slot => (
<tr key={slot.name}>
<td><MaybeEmptyCode fallback="(default)">{slot.name}</MaybeEmptyCode></td>
<td>{slot.description}</td>
</tr>
))
}
{slots.map((slot) => (
<tr key={slot.name}>
<td>
<MaybeEmptyCode fallback="(default)">{slot.name}</MaybeEmptyCode>
</td>
<td className="pre-wrap">{slot.description}</td>
</tr>
))}
</tbody>
</table>
)
);
}
2 changes: 1 addition & 1 deletion src/components/ProviderDocParams/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function ProviderDocParams({
{param.name}
</code>
</td>
<td>{param.description}</td>
<td className="pre-wrap">{param.description}</td>
<td>
<MaybeEmptyCode>
<GeneralType annotation={param.annotation} />
Expand Down
4 changes: 4 additions & 0 deletions src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,7 @@ html[data-theme="dark"] .header-github-link::before {

@media (max-width: 640px) {
}

.pre-wrap {
white-space: pre-wrap;
}
Loading