Skip to content
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
9 changes: 8 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,17 @@ function App() {
<input
name="date3"
placeholder="Custom Input"
style={{ height: 32, width: '100%' }}
className="customClassName"
style={{
height: 40,
width: '100%',
padding: '4px',
fontSize: '18px',
}}
/>
}
/>
<hr />
<button type="submit">Submit</button>
</form>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
.nepaliDateInput {
width: 100%;
padding: 4px 8px;
line-height: 22px;
border-radius: 5px;
border-width: 1px;
border-style: solid;
outline: 0;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
Expand Down
16 changes: 12 additions & 4 deletions src/components/core/NepaliDateInput/NepaliDateInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const NepaliDateInput: React.FC<INepaliDateInputProps> = ({

const handleBlur = () => onComplete?.()

const inputProps = {
const defaultInputProps = {
...rest,
value,
onChange,
Expand All @@ -34,17 +34,25 @@ const NepaliDateInput: React.FC<INepaliDateInputProps> = ({
onBlur: handleBlur,
className: classNames(
'ndt-date-input',
styles.nepaliDateInput,
hasError && styles.nepaliDateInputError,
className
),
}

if (inputElement) {
return cloneElement(inputElement, inputProps)
return cloneElement(inputElement, defaultInputProps)
}

return <input type="text" {...inputProps} />
const nepaliDateInputProps = {
...defaultInputProps,
className: classNames(
'ndt-date-input',
hasError && styles.nepaliDateInputError,
className,
styles.nepaliDateInput
),
}
return <input type="text" {...nepaliDateInputProps} />
}

export default NepaliDateInput
6 changes: 0 additions & 6 deletions src/components/core/PickerInput/PickerInput.module.scss

This file was deleted.

16 changes: 0 additions & 16 deletions src/components/core/PickerInput/PickerInput.tsx

This file was deleted.

1 change: 0 additions & 1 deletion src/components/core/PickerInput/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ button {
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
background-color: rgba(0, 0, 0, 0.5);
cursor: pointer;
transition: border-color 0.25s;
}
Expand Down