handle pagination in clinics page & change design login & fix bug filter state & change list most searched in home page & handle error page doctor item & change key url doctors and home page and get data from url & send data with url search to doctors page & show pagination only when list is long
This commit is contained in:
@@ -11,22 +11,22 @@ function Content({ data, setData }) {
|
||||
const router = useRouter();
|
||||
const { parentList, childrenList } = filterList(data);
|
||||
|
||||
const changeUrl = (value, name, removeExpertise) => {
|
||||
const changeUrl = (value, name, removeSpecialties) => {
|
||||
const current = new URLSearchParams(window.location.search);
|
||||
current.set(name, value.id || value);
|
||||
if (removeExpertise) {
|
||||
current.delete('expertise')
|
||||
if (removeSpecialties) {
|
||||
current.delete('specialties')
|
||||
};
|
||||
const queryString = current.toString();
|
||||
router.push(`/doctors?${queryString}`)
|
||||
}
|
||||
|
||||
const changeData = (value, name, removeExpertise) => {
|
||||
changeUrl(value, name, removeExpertise);
|
||||
const changeData = (value, name, removeSpecialties) => {
|
||||
changeUrl(value, name, removeSpecialties);
|
||||
const newData = data;
|
||||
newData[name] = value;
|
||||
if (removeExpertise) {
|
||||
newData.expertise = ''
|
||||
if (removeSpecialties) {
|
||||
newData.specialties = ''
|
||||
};
|
||||
setData(newData);
|
||||
}
|
||||
@@ -47,8 +47,8 @@ function Content({ data, setData }) {
|
||||
list={childrenList}
|
||||
updateData={changeData}
|
||||
sendAll={true}
|
||||
value={data.expertise}
|
||||
name="expertise"
|
||||
value={data.specialties}
|
||||
name="specialties"
|
||||
label="تخصص"
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user