Skip to content

Commit

Permalink
Merge pull request #17 from yauheni-kryzhyk-deriv/yauheni/74116/forms…
Browse files Browse the repository at this point in the history
…ubheader_ts_mifration

Yauheni/74116/formsubheader ts mifration
  • Loading branch information
suisin-deriv committed Nov 1, 2022
2 parents 897dc7b + b808b10 commit 35b232e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import { FormSubHeader } from '../form-sub-header';
import { FormSubHeader, TFormSubHeader } from '../form-sub-header';

describe('Testing FormSubHeader component', () => {
it('should render properties', () => {
const props = {
const props: TFormSubHeader = {
title: 'test-title',
subtitle: 'test-subtitle',
description: 'lorem ipsum',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ import classNames from 'classnames';
import React from 'react';
import { Text } from '@deriv/components';

export const FormSubHeader = ({ title, subtitle, description }) => {
export type TFormSubHeader = {
description?: string;
subtitle?: string;
title: string;
};

export const FormSubHeader = ({ description, subtitle, title }: TFormSubHeader) => {
const title_as_class = title.replace(/\s+/g, '-').toLowerCase();
return (
<React.Fragment>
Expand Down
3 changes: 0 additions & 3 deletions packages/account/src/Components/form-sub-header/index.js

This file was deleted.

3 changes: 3 additions & 0 deletions packages/account/src/Components/form-sub-header/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { FormSubHeader } from './form-sub-header';

export default FormSubHeader;
Original file line number Diff line number Diff line change
Expand Up @@ -1084,10 +1084,7 @@ export const PersonalDetailsForm = ({
<>
<div className='account-form__divider' />
<div className='pro-client'>
<FormSubHeader
className='account-form__red-header'
title={localize('Professional Client')}
/>
<FormSubHeader title={localize('Professional Client')} />
<FormBodySection>
<fieldset className='account-form__fieldset'>
<div>
Expand Down

0 comments on commit 35b232e

Please sign in to comment.