Skip to content

Commit c47aa52

Browse files
authored
Merge pull request #106 from yamanoku/fix-account-field-table-style
Fix: Responsive issue with `account.fieldHtmls` table
2 parents a99e8af + fccce72 commit c47aa52

File tree

2 files changed

+26
-19
lines changed

2 files changed

+26
-19
lines changed

CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ To be released.
2525
- On profile page, images are no more captioned using `<figcaption>` but
2626
use only `alt` attribute for accessibility. [[#99], [#100] by Okuto Oyama]
2727

28+
- Fixed a style bug where horizontal scrolling occurred when the screen
29+
size was reduced when there were many custom fields on profile page.
30+
[[#106] by Okuto Oyama]
31+
2832
- Added `ALLOW_HTML` environment variable to allow raw HTML inside Markdown.
2933
This is useful for allowing users to use broader formatting options outside
3034
of Markdown, but to avoid XSS attacks, it is still limited to a subset of
@@ -33,6 +37,7 @@ To be released.
3337
[#99]: https://github.com/fedify-dev/hollo/issues/99
3438
[#100]: https://github.com/fedify-dev/hollo/pull/100
3539
[#103]: https://github.com/fedify-dev/hollo/issues/103
40+
[#106]: https://github.com/fedify-dev/hollo/pull/106
3641
[`GET /api/v1/mutes`]: https://docs.joinmastodon.org/methods/mutes/#get
3742
[`GET /api/v1/blocks`]: https://docs.joinmastodon.org/methods/blocks/#get
3843

src/components/Profile.tsx

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -52,25 +52,27 @@ export function Profile({ accountOwner }: ProfileProps) {
5252
{/* biome-ignore lint/security/noDangerouslySetInnerHtml: no xss */}
5353
<div dangerouslySetInnerHTML={{ __html: bioHtml }} />
5454
{account.fieldHtmls && (
55-
<table>
56-
<thead>
57-
<tr>
58-
{Object.keys(account.fieldHtmls).map((key) => (
59-
<th>{key}</th>
60-
))}
61-
</tr>
62-
</thead>
63-
<tbody>
64-
<tr>
65-
{Object.values(account.fieldHtmls).map((value) => (
66-
<td
67-
// biome-ignore lint/security/noDangerouslySetInnerHtml: no xss
68-
dangerouslySetInnerHTML={{ __html: value }}
69-
/>
70-
))}
71-
</tr>
72-
</tbody>
73-
</table>
55+
<div class="overflow-auto">
56+
<table>
57+
<thead>
58+
<tr>
59+
{Object.keys(account.fieldHtmls).map((key) => (
60+
<th>{key}</th>
61+
))}
62+
</tr>
63+
</thead>
64+
<tbody>
65+
<tr>
66+
{Object.values(account.fieldHtmls).map((value) => (
67+
<td
68+
// biome-ignore lint/security/noDangerouslySetInnerHtml: no xss
69+
dangerouslySetInnerHTML={{ __html: value }}
70+
/>
71+
))}
72+
</tr>
73+
</tbody>
74+
</table>
75+
</div>
7476
)}
7577
</div>
7678
);

0 commit comments

Comments
 (0)