Skip to content
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
10 changes: 5 additions & 5 deletions src/components/core/radio-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import React from 'react';
import PropTypes from 'prop-types';
import cn from 'classnames';

const RadioGroup = ({ name, label, options, value, onChange }) => {
const RadioGroup = ({ name, legend, options, value, onChange }) => {
return (
<div className="flex flex-col gap-2">
{label && <span className="text-text-primary text-base">{label}</span>}
<fieldset>
<legend className="text-text-primary text-base mb-2">{legend}</legend>
<div className="flex items-center">
{options.map((option) => (
<div key={option.value} className="flex flex-1 items-center">
Expand Down Expand Up @@ -39,13 +39,13 @@ const RadioGroup = ({ name, label, options, value, onChange }) => {
</div>
))}
</div>
</div>
</fieldset>
);
};

RadioGroup.propTypes = {
name: PropTypes.string.isRequired,
label: PropTypes.string,
legend: PropTypes.string.isRequired,
options: PropTypes.arrayOf(
PropTypes.shape({
value: PropTypes.string.isRequired,
Expand Down
2 changes: 1 addition & 1 deletion src/components/link-input-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const LinkInputModal = ({ isOpen, onClose, onConfirm }) => {
/>
<RadioGroup
name="link-open-method"
label={t('openMethod')}
legend={t('openMethod')}
options={[
{ value: 'new-tab', label: t('newTab') },
{ value: 'current-tab', label: t('currentTab') },
Expand Down
Loading