Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

use the default border in border selection #365

Merged
merged 1 commit into from
Sep 11, 2024
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
10 changes: 5 additions & 5 deletions src/pods/canvas/canvas.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ export const generateDefaultOtherProps = (
backgroundColor: INPUT_SHAPE.DEFAULT_FILL_BACKGROUND,
textColor: INPUT_SHAPE.DEFAULT_FILL_TEXT,
strokeStyle: [],
borderRadius: '12',
borderRadius: `${INPUT_SHAPE.DEFAULT_CORNER_RADIUS}`,
};
case 'tooltip':
return {
Expand All @@ -403,15 +403,15 @@ export const generateDefaultOtherProps = (
backgroundColor: BASIC_SHAPE.DEFAULT_FILL_BACKGROUND,
textColor: BASIC_SHAPE.DEFAULT_FILL_TEXT,
strokeStyle: [],
borderRadius: '12',
borderRadius: `${INPUT_SHAPE.DEFAULT_CORNER_RADIUS}`,
};
case 'combobox':
return {
stroke: BASIC_SHAPE.DEFAULT_STROKE_COLOR,
backgroundColor: BASIC_SHAPE.DEFAULT_FILL_BACKGROUND,
textColor: BASIC_SHAPE.DEFAULT_FILL_TEXT,
strokeStyle: [],
borderRadius: '12',
borderRadius: `${INPUT_SHAPE.DEFAULT_CORNER_RADIUS}`,
};
case 'modal':
case 'buttonBar':
Expand All @@ -433,7 +433,7 @@ export const generateDefaultOtherProps = (
backgroundColor: '#FFFF99',
textColor: '#000000',
strokeStyle: [],
borderRadius: '12',
borderRadius: `${INPUT_SHAPE.DEFAULT_CORNER_RADIUS}`,
};

case 'circle':
Expand All @@ -450,7 +450,7 @@ export const generateDefaultOtherProps = (
stroke: '#000000',
backgroundColor: '#ffffff',
strokeStyle: [],
borderRadius: '12',
borderRadius: `${INPUT_SHAPE.DEFAULT_CORNER_RADIUS}`,
};
case 'line':
return {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { BASIC_SHAPE } from '@/common/components/front-components/shape.const';
import classes from './border-radius.module.css';

interface Props {
Expand All @@ -6,6 +7,10 @@ interface Props {
onChange: (borderRadius: string) => void;
}

const BORDER_RADIUS_NONE = '0';
const BORDER_RADIUS_SMALL = `${BASIC_SHAPE.DEFAULT_CORNER_RADIUS}`;
const BORDER_RADIUS_BIG = '12';

export const BorderRadius: React.FC<Props> = props => {
const { label, borderRadius, onChange } = props;

Expand All @@ -14,8 +19,8 @@ export const BorderRadius: React.FC<Props> = props => {
<p>{label}</p>
<div className={classes.buttonsContainer}>
<button
onClick={() => onChange('0')}
className={`${classes.button} ${borderRadius === '0' ? classes.active : ''}`}
onClick={() => onChange(BORDER_RADIUS_NONE)}
className={`${classes.button} ${borderRadius === BORDER_RADIUS_NONE ? classes.active : ''}`}
style={{ borderRadius: '0' }}
>
<svg
Expand All @@ -35,8 +40,8 @@ export const BorderRadius: React.FC<Props> = props => {
</svg>
</button>
<button
onClick={() => onChange('12')}
className={`${classes.button} ${borderRadius === '12' ? classes.active : ''}`}
onClick={() => onChange(BORDER_RADIUS_SMALL)}
className={`${classes.button} ${borderRadius === BORDER_RADIUS_SMALL ? classes.active : ''}`}
style={{ borderRadius: '0' }}
>
<svg
Expand All @@ -56,8 +61,8 @@ export const BorderRadius: React.FC<Props> = props => {
</svg>
</button>
<button
onClick={() => onChange('30')}
className={`${classes.button} ${borderRadius === '30' ? classes.active : ''}`}
onClick={() => onChange(BORDER_RADIUS_BIG)}
className={`${classes.button} ${borderRadius === BORDER_RADIUS_BIG ? classes.active : ''}`}
style={{ borderRadius: '0' }}
>
<svg
Expand Down
Loading