Skip to content

Commit

Permalink
feat: remove string component type
Browse files Browse the repository at this point in the history
  • Loading branch information
dpilch committed Nov 3, 2021
1 parent 278b6f8 commit e61fa8d
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,4 @@ exports[`Component Renderers FlexRenderer 1`] = `"<Flex {...rest} {...getOverrid

exports[`Component Renderers ImageRenderer 1`] = `"<Image {...rest} {...getOverrideProps(overrides, \\"Image\\")}></Image>"`;

exports[`Component Renderers StringRenderer 1`] = `"<>{\\"test\\"}</>"`;

exports[`Component Renderers StringRenderer throws on missing props 1`] = `"Failed to render String - Unexpected component structure"`;

exports[`Component Renderers TextRenderer 1`] = `"<Text {...rest} {...getOverrideProps(overrides, \\"Text\\")}>{\\"test\\"}</Text>"`;
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import { StudioComponent } from '@amzn/studio-ui-codegen';
import { assertASTMatchesSnapshot } from '../__utils__/snapshot-helpers';

import renderString from '../../amplify-ui-renderers/string';
import { AmplifyRenderer } from '../../amplify-ui-renderers/amplify-renderer';

function testComponentRenderer(component: StudioComponent) {
Expand Down Expand Up @@ -124,28 +123,4 @@ describe('Component Renderers', () => {
};
testComponentRenderer(component);
});

test('StringRenderer', () => {
const component = {
componentType: 'String',
name: 'MyString',
properties: {
value: {
value: 'test',
},
},
bindingProperties: {},
};
testComponentRenderer(component);
});

test('StringRenderer throws on missing props', () => {
const component = {
componentType: 'String',
name: 'MyString',
properties: {},
bindingProperties: {},
};
expect(() => renderString(component)).toThrowErrorMatchingSnapshot();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {
import Primitives from '../primitives';
import { ReactStudioTemplateRenderer } from '../react-studio-template-renderer';
import TextRenderer from './text';
import renderString from './string';
import CustomComponentRenderer from './customComponent';
import CollectionRenderer from './collection';
import { ReactComponentWithChildrenRenderer } from '../react-component-with-children-renderer';
Expand Down Expand Up @@ -402,10 +401,6 @@ export class AmplifyRenderer extends ReactStudioTemplateRenderer {
parent,
).renderElement(renderChildren);

// to be removed
case 'String':
return renderString(component as StudioComponentChild);

default:
return new CustomComponentRenderer(component, this.importCollection, parent).renderElement(renderChildren);
}
Expand Down

This file was deleted.

0 comments on commit e61fa8d

Please sign in to comment.