-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: remove placeholder property * Have github actions setup with necessary jobs * Have code climate errors removed * Corrected codeclimate issues * --ammend * --ammend --------- Co-authored-by: ceelogre <[email protected]> Co-authored-by: Ndahimana Bonheur <[email protected]>
- Loading branch information
1 parent
283d80b
commit a1cd33d
Showing
12 changed files
with
332 additions
and
332 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Devpulse CI | ||
|
||
on: | ||
push: | ||
branches: [ develop ] | ||
pull_request: | ||
branches: [ develop ] | ||
|
||
jobs: | ||
test-and-build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Install dependencies | ||
run: npm install --legacy-peer-deps | ||
|
||
- name: Run tests | ||
run: npm test | ||
|
||
- name: Build | ||
run: npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react'; | ||
|
||
interface DatalistProps { | ||
id: string; | ||
options: { value: string; label?: string }[]; | ||
style?: React.CSSProperties; | ||
} | ||
|
||
const Datalist: React.FC<DatalistProps> = ({ id, options }) => { | ||
return ( | ||
<datalist id={id}> | ||
{options.map((option, index) => ( | ||
<option key={index} value={option.value}> | ||
{option.label || option.value} | ||
</option> | ||
))} | ||
</datalist> | ||
); | ||
}; | ||
|
||
export default Datalist; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import React from 'react'; | ||
|
||
interface SelectFieldProps { | ||
id?: string; | ||
name?: string; | ||
value?: string | number; | ||
options: { value: string | number; label: string }[]; | ||
onChange?: (e: React.ChangeEvent<HTMLSelectElement>) => void; | ||
ref?: React.Ref<HTMLSelectElement>; | ||
className?: string; | ||
defaultValue?: string | number; | ||
onBlur?: (e: React.FocusEvent<HTMLSelectElement>) => void; | ||
} | ||
|
||
const SelectField: React.FC<SelectFieldProps> = ({ | ||
id, | ||
name, | ||
value, | ||
options, | ||
onChange, | ||
ref, | ||
className = "", | ||
defaultValue, | ||
onBlur | ||
}) => { | ||
return ( | ||
<select | ||
id={id} | ||
name={name} | ||
ref={ref} | ||
defaultValue={defaultValue} | ||
value={value} | ||
onChange={onChange} | ||
className={`dark:bg-dark-tertiary dark:text-white shadow appearance-none py-2 px-3 rounded w-full leading-tight focus:outline-none focus:shadow-outline ${className}`} | ||
onBlur={(e: React.FocusEvent<HTMLSelectElement>) => onBlur?.(e)} | ||
> | ||
{options.map((option) => ( | ||
<option key={option.value} value={option.value}> | ||
{option.label} | ||
</option> | ||
))} | ||
</select> | ||
); | ||
}; | ||
|
||
export default SelectField; |
Oops, something went wrong.