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

fix: Fix heading levels #1762

Merged
merged 3 commits into from
Jul 3, 2023
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/shared/components/community/communities.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export class Communities extends Component<any, CommunitiesState> {
const { listingType, page } = this.getCommunitiesQueryParams();
return (
<div>
<h1 className="h4">
<h1 className="h4 mb-4">
{I18NextService.i18n.t("list_of_communities")}
</h1>
<div className="row g-2 justify-content-between">
Expand Down
2 changes: 1 addition & 1 deletion src/shared/components/community/community.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ export class Community extends Component<
community && (
<div className="mb-2">
<BannerIconHeader banner={community.banner} icon={community.icon} />
<h5 className="mb-0 overflow-wrap-anywhere">{community.title}</h5>
<h1 className="h4 mb-0 overflow-wrap-anywhere">{community.title}</h1>
<CommunityLink
community={community}
realLink
Expand Down
4 changes: 3 additions & 1 deletion src/shared/components/community/create-community.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ export class CreateCommunity extends Component<any, CreateCommunityState> {
/>
<div className="row">
<div className="col-12 col-lg-6 offset-lg-3 mb-4">
<h5>{I18NextService.i18n.t("create_community")}</h5>
<h1 className="h4 mb-4">
{I18NextService.i18n.t("create_community")}
</h1>
<CommunityForm
onUpsertCommunity={this.handleCommunityCreate}
enableNsfw={enableNsfw(this.state.siteRes)}
Expand Down
4 changes: 2 additions & 2 deletions src/shared/components/community/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {

return (
<div>
<h5 className="mb-0">
<h2 className="h5 mb-0">
{this.props.showIcon && !community.removed && (
<BannerIconHeader icon={community.icon} banner={community.banner} />
)}
Expand All @@ -191,7 +191,7 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
{I18NextService.i18n.t("nsfw")}
</small>
)}
</h5>
</h2>
<CommunityLink
community={community}
realLink
Expand Down
10 changes: 8 additions & 2 deletions src/shared/components/home/admin-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ export class AdminSettings extends Component<any, AdminSettingsState> {
role="tabpanel"
id="site-tab-pane"
>
<h1 className="h4 mb-4">
{I18NextService.i18n.t("site_config")}
</h1>
<div className="row">
<div className="col-12 col-md-6">
<SiteForm
Expand All @@ -149,6 +152,7 @@ export class AdminSettings extends Component<any, AdminSettingsState> {
</div>
<div className="col-12 col-md-6">
{this.admins()}
<hr />
{this.bannedUsers()}
</div>
</div>
Expand Down Expand Up @@ -249,7 +253,9 @@ export class AdminSettings extends Component<any, AdminSettingsState> {
admins() {
return (
<>
<h5>{capitalizeFirstLetter(I18NextService.i18n.t("admins"))}</h5>
<h2 className="h5">
{capitalizeFirstLetter(I18NextService.i18n.t("admins"))}
</h2>
<ul className="list-unstyled">
{this.state.siteRes.admins.map(admin => (
<li key={admin.person.id} className="list-inline-item">
Expand Down Expand Up @@ -289,7 +295,7 @@ export class AdminSettings extends Component<any, AdminSettingsState> {
const bans = this.state.bannedRes.data.banned;
return (
<>
<h5>{I18NextService.i18n.t("banned_users")}</h5>
<h2 className="h5">{I18NextService.i18n.t("banned_users")}</h2>
<ul className="list-unstyled">
{bans.map(banned => (
<li key={banned.person.id} className="list-inline-item">
Expand Down
2 changes: 1 addition & 1 deletion src/shared/components/home/emojis-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class EmojiForm extends Component<EmojiFormProps, EmojiFormState> {
title={this.documentTitle}
path={this.context.router.route.match.url}
/>
<h5 className="col-12">{I18NextService.i18n.t("custom_emojis")}</h5>
<h1 className="h4 mb-4">{I18NextService.i18n.t("custom_emojis")}</h1>
{customEmojisLookup.size > 0 && (
<div>
<EmojiMart
Expand Down
43 changes: 27 additions & 16 deletions src/shared/components/home/instances.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,24 +85,35 @@ export class Instances extends Component<any, InstancesState> {
case "success": {
const instances = this.state.instancesRes.data.federated_instances;
return instances ? (
<div className="row">
<div className="col-md-6">
<h5>{I18NextService.i18n.t("linked_instances")}</h5>
{this.itemList(instances.linked)}
</div>
{instances.allowed && instances.allowed.length > 0 && (
<div className="col-md-6">
<h5>{I18NextService.i18n.t("allowed_instances")}</h5>
{this.itemList(instances.allowed)}
</div>
)}
{instances.blocked && instances.blocked.length > 0 && (
<>
<h1 className="h4 mb-4">{I18NextService.i18n.t("instances")}</h1>
<div className="row">
<div className="col-md-6">
<h5>{I18NextService.i18n.t("blocked_instances")}</h5>
{this.itemList(instances.blocked)}
<h2 className="h5 mb-3">
{I18NextService.i18n.t("linked_instances")}
</h2>
{this.itemList(instances.linked)}
</div>
)}
</div>
</div>
<div className="row">
{instances.allowed && instances.allowed.length > 0 && (
<div className="col-md-6">
<h2 className="h5 mb-3">
{I18NextService.i18n.t("allowed_instances")}
</h2>
{this.itemList(instances.allowed)}
</div>
)}
{instances.blocked && instances.blocked.length > 0 && (
<div className="col-md-6">
<h2 className="h5 mb-3">
{I18NextService.i18n.t("blocked_instances")}
</h2>
{this.itemList(instances.blocked)}
</div>
)}
</div>
</>
) : (
<></>
);
Expand Down
4 changes: 2 additions & 2 deletions src/shared/components/home/login-reset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ export class LoginReset extends Component<any, State> {
loginResetForm() {
return (
<form onSubmit={linkEvent(this, this.handlePasswordReset)}>
<h5>
<h1 className="h4 mb-4">
{capitalizeFirstLetter(I18NextService.i18n.t("forgot_password"))}
</h5>
</h1>

<div className="form-group row">
<label className="col-form-label">
Expand Down
2 changes: 1 addition & 1 deletion src/shared/components/home/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class Login extends Component<any, State> {
return (
<div>
<form onSubmit={linkEvent(this, this.handleLoginSubmit)}>
<h5>{I18NextService.i18n.t("login")}</h5>
<h1 className="h4 mb-4">{I18NextService.i18n.t("login")}</h1>
<div className="mb-3 row">
<label
className="col-sm-2 col-form-label"
Expand Down
4 changes: 3 additions & 1 deletion src/shared/components/home/rate-limit-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ export default class RateLimitsForm extends Component<
className="rate-limit-form"
onSubmit={linkEvent(this, submitRateLimitForm)}
>
<h5>{I18NextService.i18n.t("rate_limit_header")}</h5>
<h1 className="h4 mb-4">
{I18NextService.i18n.t("rate_limit_header")}
</h1>
<Tabs
tabs={rateLimitTypes.map(rateLimitType => ({
key: rateLimitType,
Expand Down
6 changes: 4 additions & 2 deletions src/shared/components/home/setup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ export class Setup extends Component<any, State> {
<Helmet title={this.documentTitle} />
<div className="row">
<div className="col-12 offset-lg-3 col-lg-6">
<h3>{I18NextService.i18n.t("lemmy_instance_setup")}</h3>
<h1 className="h4 mb-4">
{I18NextService.i18n.t("lemmy_instance_setup")}
</h1>
{!this.state.doneRegisteringUser ? (
this.registerUser()
) : (
Expand All @@ -84,7 +86,7 @@ export class Setup extends Component<any, State> {
registerUser() {
return (
<form onSubmit={linkEvent(this, this.handleRegisterSubmit)}>
<h5>{I18NextService.i18n.t("setup_admin")}</h5>
<h2 className="h5 mb-3">{I18NextService.i18n.t("setup_admin")}</h2>
<div className="mb-3 row">
<label className="col-sm-2 col-form-label" htmlFor="username">
{I18NextService.i18n.t("username")}
Expand Down
2 changes: 1 addition & 1 deletion src/shared/components/home/signup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export class Signup extends Component<any, State> {
className="was-validated"
onSubmit={linkEvent(this, this.handleRegisterSubmit)}
>
<h5>{this.titleName(siteView)}</h5>
<h1 className="h4 mb-4">{this.titleName(siteView)}</h1>

{this.isLemmyMl && (
<div className="mb-3 row">
Expand Down
4 changes: 2 additions & 2 deletions src/shared/components/home/site-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
!this.state.submitted
}
/>
<h5>{`${
<h2 className="h5">{`${
siteSetup
? capitalizeFirstLetter(I18NextService.i18n.t("edit"))
: capitalizeFirstLetter(I18NextService.i18n.t("setup"))
} ${I18NextService.i18n.t("your_site")}`}</h5>
} ${I18NextService.i18n.t("your_site")}`}</h2>
<div className="mb-3 row">
<label className="col-12 col-form-label" htmlFor="create-site-name">
{I18NextService.i18n.t("name")}
Expand Down
2 changes: 1 addition & 1 deletion src/shared/components/home/tagline-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class TaglineForm extends Component<TaglineFormProps, TaglineFormState> {
title={this.documentTitle}
path={this.context.router.route.match.url}
/>
<h5 className="col-12">{I18NextService.i18n.t("taglines")}</h5>
<h1 className="h4 mb-4">{I18NextService.i18n.t("taglines")}</h1>
<div className="table-responsive col-12">
<table id="taglines_table" className="table table-sm table-hover">
<thead className="pointer">
Expand Down
150 changes: 73 additions & 77 deletions src/shared/components/modlog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -751,87 +751,83 @@ export class Modlog extends Component<
path={this.context.router.route.match.url}
/>

<div>
<div
className="alert alert-warning text-sm-start text-xs-center"
role="alert"
>
<Icon
icon="alert-triangle"
inline
classes="me-sm-2 mx-auto d-sm-inline d-block"
/>
<T i18nKey="modlog_content_warning" class="d-inline">
#<strong>#</strong>#
</T>
</div>
{this.state.communityRes.state === "success" && (
<h5>
<Link
className="text-body"
to={`/c/${this.state.communityRes.data.community_view.community.name}`}
>
/c/{this.state.communityRes.data.community_view.community.name}{" "}
</Link>
<span>{I18NextService.i18n.t("modlog")}</span>
</h5>
)}
<div className="row mb-2">
<div className="col-sm-6">
<select
value={actionType}
onChange={linkEvent(this, this.handleFilterActionChange)}
className="form-select"
aria-label="action"
>
<option disabled aria-hidden="true">
{I18NextService.i18n.t("filter_by_action")}
</option>
<option value={"All"}>{I18NextService.i18n.t("all")}</option>
<option value={"ModRemovePost"}>Removing Posts</option>
<option value={"ModLockPost"}>Locking Posts</option>
<option value={"ModFeaturePost"}>Featuring Posts</option>
<option value={"ModRemoveComment"}>Removing Comments</option>
<option value={"ModRemoveCommunity"}>
Removing Communities
</option>
<option value={"ModBanFromCommunity"}>
Banning From Communities
</option>
<option value={"ModAddCommunity"}>
Adding Mod to Community
</option>
<option value={"ModTransferCommunity"}>
Transferring Communities
</option>
<option value={"ModAdd"}>Adding Mod to Site</option>
<option value={"ModBan"}>Banning From Site</option>
</select>
</div>
<h1 className="h4 mb-4">{I18NextService.i18n.t("modlog")}</h1>

<div
className="alert alert-warning text-sm-start text-xs-center"
role="alert"
>
<Icon
icon="alert-triangle"
inline
classes="me-sm-2 mx-auto d-sm-inline d-block"
/>
<T i18nKey="modlog_content_warning" class="d-inline">
#<strong>#</strong>#
</T>
</div>
{this.state.communityRes.state === "success" && (
<h5>
<Link
className="text-body"
to={`/c/${this.state.communityRes.data.community_view.community.name}`}
>
/c/{this.state.communityRes.data.community_view.community.name}{" "}
</Link>
<span>{I18NextService.i18n.t("modlog")}</span>
</h5>
)}
<div className="row mb-2">
<div className="col-sm-6">
<select
value={actionType}
onChange={linkEvent(this, this.handleFilterActionChange)}
className="form-select"
aria-label="action"
>
<option disabled aria-hidden="true">
{I18NextService.i18n.t("filter_by_action")}
</option>
<option value={"All"}>{I18NextService.i18n.t("all")}</option>
<option value={"ModRemovePost"}>Removing Posts</option>
<option value={"ModLockPost"}>Locking Posts</option>
<option value={"ModFeaturePost"}>Featuring Posts</option>
<option value={"ModRemoveComment"}>Removing Comments</option>
<option value={"ModRemoveCommunity"}>Removing Communities</option>
<option value={"ModBanFromCommunity"}>
Banning From Communities
</option>
<option value={"ModAddCommunity"}>Adding Mod to Community</option>
<option value={"ModTransferCommunity"}>
Transferring Communities
</option>
<option value={"ModAdd"}>Adding Mod to Site</option>
<option value={"ModBan"}>Banning From Site</option>
</select>
</div>
<div className="row mb-2">
</div>
<div className="row mb-2">
<Filter
filterType="user"
onChange={this.handleUserChange}
onSearch={this.handleSearchUsers}
value={userId}
options={userSearchOptions}
loading={loadingUserSearch}
/>
{!this.isoData.site_res.site_view.local_site
.hide_modlog_mod_names && (
<Filter
filterType="user"
onChange={this.handleUserChange}
onSearch={this.handleSearchUsers}
value={userId}
options={userSearchOptions}
loading={loadingUserSearch}
filterType="mod"
onChange={this.handleModChange}
onSearch={this.handleSearchMods}
value={modId}
options={modSearchOptions}
loading={loadingModSearch}
/>
{!this.isoData.site_res.site_view.local_site
.hide_modlog_mod_names && (
<Filter
filterType="mod"
onChange={this.handleModChange}
onSearch={this.handleSearchMods}
value={modId}
options={modSearchOptions}
loading={loadingModSearch}
/>
)}
</div>
{this.renderModlogTable()}
)}
</div>
{this.renderModlogTable()}
</div>
);
}
Expand Down
Loading