Skip to content

Commit

Permalink
Don't spread props inside DomainInput
Browse files Browse the repository at this point in the history
  • Loading branch information
agjs committed Apr 13, 2024
1 parent f5f748c commit 0557514
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@programmer_network/yail",
"version": "1.0.145",
"version": "1.0.146",
"description": "Programmer Network's official UI library for React",
"author": "Aleksandar Grbic - (https://programmer.network)",
"publishConfig": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ exports[`DomainInput component > matches snapshot 1`] = `
<input
class="w-full cursor-pointer border-t-2 border-b-2 border-r-2 border-primary-text-color bg-transparent p-2 transition-colors focus:border-primary focus:outline-none focus:ring-transparent rounded-tr-md rounded-br-md group-hover:border-primary"
data-testid="input"
domain="example.com"
error=""
hint=""
max="0"
name="domainInput"
type="string"
value="test"
/>
</div>
Expand Down
10 changes: 7 additions & 3 deletions src/Components/Inputs/DomainInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import InputHeader from "Components/Inputs/Common/InputHeader";
import { IDomainInputProps } from "./types";

const DomainInput: FC<IDomainInputProps> = props => {
const { domain } = props;
const { domain, name, value, disabled } = props;
const [isFocused, setIsFocused] = useState(false);

const handleChange = (e: ChangeEvent<HTMLInputElement>) => {
Expand All @@ -27,7 +27,7 @@ const DomainInput: FC<IDomainInputProps> = props => {
data-testid='domain'
className={classNames(
"min-w-max border-2 border-primary-text-color px-4 py-2 leading-5 tracking-tighter selection:text-primary-text-color rounded-tl-md rounded-bl-md",
props?.domainClassName,
props.domainClassName,
{
"group-hover:border-primary": !props.disabled,
"!border-primary !ring-transparent": isFocused
Expand All @@ -37,8 +37,10 @@ const DomainInput: FC<IDomainInputProps> = props => {
{domain}
</span>
<input
{...props}
data-testid='input'
name={name}
value={value}
disabled={disabled}
onFocus={() => setIsFocused(true)}
onBlur={() => setIsFocused(false)}
className={classNames(
Expand All @@ -63,6 +65,8 @@ DomainInput.defaultProps = {
value: "",
hint: "",
className: "",
domainClassName: "",
inputWrapperClassName: "",
type: "string",
max: 0,
error: "",
Expand Down
1 change: 1 addition & 0 deletions src/Components/Inputs/Tiptap/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const headers = Heading.configure({ levels: [1, 2, 3, 4, 5, 6] }).extend({
5: toolbarItemToClassName[TIPTAP_TOOLBAR_ITEMS.HEADING_5].classes,
6: toolbarItemToClassName[TIPTAP_TOOLBAR_ITEMS.HEADING_6].classes
};

return [
`h${level}`,
mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {
Expand Down

0 comments on commit 0557514

Please sign in to comment.