Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix checkbox / radio group refactor missing from example/src #385

Merged
merged 1 commit into from
Dec 28, 2022
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
8 changes: 3 additions & 5 deletions example/src/components/FormCheckboxDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { FormCheckbox, FormGroup } from '@capgeminiuk/dcx-react-library';
import { FormCheckbox, CheckboxGroup } from '@capgeminiuk/dcx-react-library';

export const FormCheckboxDemo = () => {
const [value, setValue] = React.useState('');
Expand Down Expand Up @@ -48,9 +48,8 @@ export const FormCheckboxDemo = () => {
disabled={true}
/>
<h2>Group</h2>
<FormGroup
<CheckboxGroup
name="name-of-group"
type="checkbox"
onChange={handleFormChange}
items={[
{
Expand Down Expand Up @@ -133,9 +132,8 @@ export const FormCheckboxDemo = () => {
}}
/>
<h2>Group using string values</h2>
<FormGroup
<CheckboxGroup
name="name-of-group-string"
type="checkbox"
onChange={handleFormChange}
items={['yes', 'no']}
/>
Expand Down
8 changes: 3 additions & 5 deletions example/src/components/FormRadioDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { FormRadio, FormGroup } from '@capgeminiuk/dcx-react-library';
import { FormRadio, RadioGroup } from '@capgeminiuk/dcx-react-library';

export const FormRadioDemo = () => {
const [selected, setSelected] = React.useState('single-2');
Expand Down Expand Up @@ -153,10 +153,9 @@ export const FormRadioDemo = () => {
}}
/>
<h4 id="basic-radio-group-tag">Basic Group Radios</h4>
<FormGroup
<RadioGroup
ariaDescribedBy="basic-radio-group-tag"
name="group3"
type="radio"
items={[
{
id: 'radio-1',
Expand Down Expand Up @@ -212,10 +211,9 @@ export const FormRadioDemo = () => {
<h4 id="basic-radio-group-with-string-tag">
Basic Group Radios using string
</h4>
<FormGroup
<RadioGroup
ariaDescribedBy="basic-radio-group-tag"
name="group4"
type="radio"
items={['Option 1', 'Option 2', 'Option 3']}
//@ts-ignore
onChange={handleGroupConditionalChange}
Expand Down
8 changes: 3 additions & 5 deletions example/src/pages/Register.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
FormRadio,
FormSelect,
Toggle,
FormGroup,
RadioGroup,
Autocomplete,
FormDate,
ErrorPosition,
Expand Down Expand Up @@ -462,9 +462,8 @@ export const Register = () => {
</div>

<div className="form-group">
<FormGroup
<RadioGroup
name="heard-about"
type="radio"
inputProps={{
className: 'class-name',
}}
Expand Down Expand Up @@ -517,8 +516,7 @@ export const Register = () => {
fieldsetClasses="field-set-class"
hint={{
id: 'heard-about-hint',
text:
'Please select the one closest to where you first heard about us',
text: 'Please select the one closest to where you first heard about us',
className: 'hint-class',
}}
itemsClasses="item-classes"
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from './formGroup';
export * from './checkboxGroup';
export * from './radioGroup';
export * from './formInput';
export * from './formRadio';
Expand Down