Skip to content

Commit

Permalink
refactor(ui): radio/checkbox size variant remove
Browse files Browse the repository at this point in the history
  • Loading branch information
32penkin authored and artyorsh committed May 27, 2019
1 parent 50ef9fe commit ecb6568
Show file tree
Hide file tree
Showing 15 changed files with 94 additions and 498 deletions.
2 changes: 1 addition & 1 deletion config/dev.env.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ module.exports = {
ENV: 'dev',
KITTEN_PATH: path.resolve(__dirname, '../src/framework'),
MAPPING_PATH: path.resolve(evaPath, 'packages/mapping/eva'),
THEME_PATH: path.resolve(evaPath, 'packages/theme/eva'),
THEME_PATH: path.resolve(evaPath, 'packages/themes'),
PROCESSOR_PATH: path.resolve(evaPath, 'packages/processor/kitten')
};
9 changes: 2 additions & 7 deletions src/framework/ui/checkbox/checkbox.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ interface ComponentProps {
checked?: boolean;
indeterminate?: boolean;
status?: string;
size?: string;
onChange?: (checked: boolean, indeterminate: boolean) => void;
}

Expand All @@ -57,10 +56,6 @@ export type CheckBoxProps = StyledComponentProps & TouchableOpacityProps & Compo
* Can be 'primary' | 'success' | 'info' | 'warning' | 'danger'.
* By default status is 'primary'.
*
* @property {string} size - Determines the size of the component.
* Can be 'tiny' | 'small' | 'medium' | 'large' | 'giant'.
* By default size is 'medium'.
*
* @property {string} text - Determines text of the component.
*
* @property {StyleProp<TextStyle>} textStyle - Customizes text style.
Expand Down Expand Up @@ -97,7 +92,6 @@ export type CheckBoxProps = StyledComponentProps & TouchableOpacityProps & Compo
* <Checkbox
* checked={this.state.toggled}
* status='info'
* size='large'
* text='Place your text'
* textStyle={styles.checkboxText}
* onChange={this.onChange}
Expand Down Expand Up @@ -163,10 +157,11 @@ class CheckBoxComponent extends React.Component<CheckBoxProps> {
outlineHeight,
outlineBorderRadius,
outlineBackgroundColor,
hitSlop,
...containerParameters
} = source;

const hitSlop: number = 40 - containerParameters.width;

return {
container: {
...StyleSheet.flatten(style),
Expand Down
8 changes: 2 additions & 6 deletions src/framework/ui/radio/radio.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ interface ComponentProps {
text?: string;
checked?: boolean;
status?: string;
size?: string;
onChange?: (selected: boolean) => void;
}

Expand All @@ -53,10 +52,6 @@ export type RadioProps = StyledComponentProps & TouchableOpacityProps & Componen
* Can be 'primary' | 'success' | 'info' | 'warning' | 'danger'.
* By default status='primary'.
*
* @property {string} size - Determines whether component is disabled.
* Can be 'small' | 'medium' | 'large'.
* By default size='medium'.
*
* @property {string} text - Determines text of the component.
*
* @property {StyleProp<TextStyle>} textStyle - Customizes text style.
Expand Down Expand Up @@ -155,10 +150,11 @@ export class RadioComponent extends React.Component<RadioProps> {
outlineHeight,
outlineBorderRadius,
outlineBackgroundColor,
hitSlop,
...containerParameters
} = source;

const hitSlop: number = 40 - containerParameters.width;

return {
container: {
...styles.container,
Expand Down
1 change: 0 additions & 1 deletion src/framework/ui/radio/radio.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ exports[`@radio: matches snapshot default 1`] = `
onPress={[Function]}
onPressIn={[Function]}
onPressOut={[Function]}
size="medium"
style={
Object {
"alignItems": "center",
Expand Down
2 changes: 0 additions & 2 deletions src/framework/ui/radioGroup/radioGroup.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ export type RadioGroupProps = StyledComponentProps & ViewProps & ComponentProps;
* <Radio
* style={styles.radioButton}
* status='danger'
* size='small'
* />
* <Radio
* style={styles.radioButton}
Expand All @@ -73,7 +72,6 @@ export type RadioGroupProps = StyledComponentProps & ViewProps & ComponentProps;
* <Radio
* style={styles.radioButton}
* status='danger'
* size='large'
* />
* </RadioGroup>
* );
Expand Down
Loading

0 comments on commit ecb6568

Please sign in to comment.