Skip to content

Commit

Permalink
2826: Fixed styling of form
Browse files Browse the repository at this point in the history
  • Loading branch information
tuj committed Nov 20, 2024
1 parent fb58dfe commit b8c0e84
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/components/feed-sources/feed-source-form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,23 @@ function FeedSourceForm({
<ContentBody>
<FormInput
name="title"
formGroupClasses="mb-2"
type="text"
label={t("feed-source-name-label")}
value={feedSource.title}
onChange={handleInput}
/>
<FormInputArea
name="description"
formGroupClasses="mb-2"
type="text"
label={t("feed-source-description-label")}
value={feedSource.description}
onChange={handleInput}
/>
<FormSelect
name="feedType"
formGroupClasses="mb-2"
label={t("feed-source-feed-type-label")}
value={feedSource.feedType}
onChange={onFeedTypeChange}
Expand Down
11 changes: 9 additions & 2 deletions src/components/util/forms/form-input-area.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from "react";
import PropTypes from "prop-types";
import { FormLabel } from "react-bootstrap";

/**
* A text area for forms.
Expand All @@ -17,11 +18,16 @@ function FormInputArea({
label,
onChange,
value = "",
formGroupClasses = "",
placeholder = "",
required = false,
}) {
return (
<div className="form-group">
<label htmlFor={name}>{label}</label>
<div className={"form-group " + formGroupClasses}>
<FormLabel htmlFor={name}>
{label}
{required && " *"}
</FormLabel>
<textarea
name={name}
id={name}
Expand All @@ -40,6 +46,7 @@ FormInputArea.propTypes = {
label: PropTypes.string.isRequired,
placeholder: PropTypes.string,
value: PropTypes.string,
required: PropTypes.bool,
onChange: PropTypes.func.isRequired,
};

Expand Down
2 changes: 1 addition & 1 deletion src/translations/da/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@
"configuration-themes": "Temaer",
"configuration-users": "Brugere",
"activation-codes": "Aktiveringskoder",
"configuration-feedsources": "Datakilde"
"configuration-feedsources": "Datakilder"
},
"topbar": {
"brand": "OS2Display",
Expand Down

0 comments on commit b8c0e84

Please sign in to comment.