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 up post, profile and community forms. Fixes #409 #423

Merged
merged 1 commit into from
Sep 18, 2021
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
4 changes: 2 additions & 2 deletions src/shared/components/app/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { i18n } from "../../i18next";
import { UserService, WebSocketService } from "../../services";
import {
authField,
donateLemmyUrl,
fetchLimit,
getLanguage,
isBrowser,
Expand All @@ -28,7 +29,6 @@ import {
numToSI,
setTheme,
showAvatars,
supportLemmyUrl,
toast,
wsClient,
wsJsonToRes,
Expand Down Expand Up @@ -241,7 +241,7 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
<a
className="nav-link"
title={i18n.t("support_lemmy")}
href={supportLemmyUrl}
href={donateLemmyUrl}
>
<Icon icon="heart" classes="small" />
</a>
Expand Down
2 changes: 1 addition & 1 deletion src/shared/components/common/image-upload-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class ImageUploadForm extends Component<
<form class="d-inline">
<label
htmlFor={this.id}
class="pointer ml-4 text-muted small font-weight-bold"
class="pointer text-muted small font-weight-bold"
>
{!this.props.imageSrc ? (
<span class="btn btn-secondary">{this.props.uploadTitle}</span>
Expand Down
70 changes: 40 additions & 30 deletions src/shared/components/community/community-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,19 @@ export class CommunityForm extends Component<
<form onSubmit={linkEvent(this, this.handleCreateCommunitySubmit)}>
{!this.props.community_view && (
<div class="form-group row">
<label class="col-12 col-form-label" htmlFor="community-name">
<label
class="col-12 col-sm-2 col-form-label"
htmlFor="community-name"
>
{i18n.t("name")}
<span
class="pointer unselectable ml-2 text-muted"
class="position-absolute pointer unselectable ml-2 text-muted"
data-tippy-content={i18n.t("name_explain")}
>
<Icon icon="help-circle" classes="icon-inline" />
</span>
</label>
<div class="col-12">
<div class="col-12 col-sm-10">
<input
type="text"
id="community-name"
Expand All @@ -146,16 +149,19 @@ export class CommunityForm extends Component<
</div>
)}
<div class="form-group row">
<label class="col-12 col-form-label" htmlFor="community-title">
<label
class="col-12 col-sm-2 col-form-label"
htmlFor="community-title"
>
{i18n.t("display_name")}
<span
class="pointer unselectable ml-2 text-muted"
class="position-absolute pointer unselectable ml-2 text-muted"
data-tippy-content={i18n.t("display_name_explain")}
>
<Icon icon="help-circle" classes="icon-inline" />
</span>
</label>
<div class="col-12">
<div class="col-12 col-sm-10">
<input
type="text"
id="community-title"
Expand All @@ -168,30 +174,34 @@ export class CommunityForm extends Component<
/>
</div>
</div>
<div class="form-group">
<label>{i18n.t("icon")}</label>
<ImageUploadForm
uploadTitle={i18n.t("upload_icon")}
imageSrc={this.state.communityForm.icon}
onUpload={this.handleIconUpload}
onRemove={this.handleIconRemove}
rounded
/>
<div class="form-group row">
<label class="col-12 col-sm-2">{i18n.t("icon")}</label>
<div class="col-12 col-sm-10">
<ImageUploadForm
uploadTitle={i18n.t("upload_icon")}
imageSrc={this.state.communityForm.icon}
onUpload={this.handleIconUpload}
onRemove={this.handleIconRemove}
rounded
/>
</div>
</div>
<div class="form-group">
<label>{i18n.t("banner")}</label>
<ImageUploadForm
uploadTitle={i18n.t("upload_banner")}
imageSrc={this.state.communityForm.banner}
onUpload={this.handleBannerUpload}
onRemove={this.handleBannerRemove}
/>
<div class="form-group row">
<label class="col-12 col-sm-2">{i18n.t("banner")}</label>
<div class="col-12 col-sm-10">
<ImageUploadForm
uploadTitle={i18n.t("upload_banner")}
imageSrc={this.state.communityForm.banner}
onUpload={this.handleBannerUpload}
onRemove={this.handleBannerRemove}
/>
</div>
</div>
<div class="form-group row">
<label class="col-12 col-form-label" htmlFor={this.id}>
<label class="col-12 col-sm-2 col-form-label" htmlFor={this.id}>
{i18n.t("sidebar")}
</label>
<div class="col-12">
<div class="col-12 col-sm-10">
<MarkdownTextArea
initialContent={this.state.communityForm.description}
onContentChange={this.handleCommunityDescriptionChange}
Expand All @@ -201,18 +211,18 @@ export class CommunityForm extends Component<

{this.props.enableNsfw && (
<div class="form-group row">
<div class="col-12">
<legend class="col-form-label col-sm-2 pt-0">
{i18n.t("nsfw")}
</legend>
<div class="col-10">
<div class="form-check">
<input
class="form-check-input"
class="form-check-input position-static"
id="community-nsfw"
type="checkbox"
checked={this.state.communityForm.nsfw}
onChange={linkEvent(this, this.handleCommunityNsfwChange)}
/>
<label class="form-check-label" htmlFor="community-nsfw">
{i18n.t("nsfw")}
</label>
</div>
</div>
</div>
Expand Down
Loading