Skip to content

Commit

Permalink
fix(radiobutton): applying border radius token (#263)
Browse files Browse the repository at this point in the history
* fix(radiobutton): applying border radius token

DSY-2591

Co-authored-by: Design system Natura in behalf of Design System Team <[email protected]>
  • Loading branch information
Davi Mattos and Design-System-Natura authored Mar 11, 2022
1 parent 0dd652d commit 9f261ca
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@naturacosmeticos/natds-rn",
"version": "7.26.4",
"version": "7.26.5-DSY-2591.0",
"license": "ISC",
"main": "build/lib/index.js",
"keywords": [
Expand Down
27 changes: 12 additions & 15 deletions src/components/RadioButton/RadioButton.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ import {
} from '../../common/themeSelectors'
import { RadioButtonColors } from './RadioButton'

type RadioButtonProps = {
theme: Theme;
color: RadioButtonColors;
selected?: boolean;
disabled: boolean;
}

function getCircleColor(
selected = false,
disabled: boolean,
Expand Down Expand Up @@ -44,17 +51,12 @@ export const Label = styled.Text<{ theme: Theme; disabled: boolean }>(({ theme,
marginLeft: getSpacingTiny(theme)
}))

export const Circle = styled.View<{
theme: Theme;
color: RadioButtonColors;
selected?: boolean;
disabled: boolean;
}>(({
export const Circle = styled.View<RadioButtonProps>(({
theme,
color,
selected,
disabled
}) => ({
}: RadioButtonProps) => ({
alignItems: 'center',
borderColor: getCircleColor(selected, disabled, color, theme),
borderRadius: 12,
Expand All @@ -64,19 +66,14 @@ export const Circle = styled.View<{
width: 20
}))

export const Center = styled.View<{
theme: Theme;
color: RadioButtonColors;
selected?: boolean;
disabled: boolean;
}>(({
export const Center = styled.View<RadioButtonProps>(({
theme,
color,
selected,
disabled
}) => ({
}: RadioButtonProps) => ({
backgroundColor: getCircleColor(selected, disabled, color, theme),
borderRadius: 12,
borderRadius: `${theme.radioButton.borderRadius}px`,
height: 10,
width: 10
}))
Expand Down

0 comments on commit 9f261ca

Please sign in to comment.