add prettier formatter to all file
This commit is contained in:
@@ -1,22 +1,25 @@
|
||||
import { Button } from "@mui/material"
|
||||
import { Button } from "@mui/material";
|
||||
|
||||
function ItemTitle({ name, idx, activeBtn, setActiveBtn }) {
|
||||
|
||||
return (
|
||||
<li>
|
||||
<Button
|
||||
className={`
|
||||
return (
|
||||
<li>
|
||||
<Button
|
||||
className={`
|
||||
!py-[4px] md:!py-[6px] lg:!py-[8px] !px-[8px] md:!px-[12px] lg:!px-[16px] !shadow-none !rounded-[8px] !text-[14px] md:!text-[16px
|
||||
${activeBtn === idx ? '!bg-[#F17732] !text-[#FAFAFA]' : '!bg-[#F5F5F5] !text-[#3B3B3B]'}
|
||||
${
|
||||
activeBtn === idx
|
||||
? "!bg-[#F17732] !text-[#FAFAFA]"
|
||||
: "!bg-[#F5F5F5] !text-[#3B3B3B]"
|
||||
}
|
||||
`}
|
||||
onClick={() => setActiveBtn(idx)}
|
||||
variant="contained"
|
||||
color="secondary"
|
||||
>
|
||||
{name}
|
||||
</Button>
|
||||
</li>
|
||||
)
|
||||
onClick={() => setActiveBtn(idx)}
|
||||
variant="contained"
|
||||
color="secondary"
|
||||
>
|
||||
{name}
|
||||
</Button>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
|
||||
export default ItemTitle
|
||||
export default ItemTitle;
|
||||
|
||||
@@ -1,26 +1,25 @@
|
||||
'use client';
|
||||
"use client";
|
||||
import { useState } from "react";
|
||||
import ItemTitle from "./ItemTitle";
|
||||
|
||||
const listTitle = ['سلامت روان', 'پوست و مو', 'کودک و نوجوان', 'دارو', 'تغذیه'];
|
||||
const listTitle = ["سلامت روان", "پوست و مو", "کودک و نوجوان", "دارو", "تغذیه"];
|
||||
|
||||
function Title() {
|
||||
const [activeBtn, setActiveBtn] = useState(0);
|
||||
|
||||
const [activeBtn, setActiveBtn] = useState(0);
|
||||
|
||||
return (
|
||||
<ul className="flex w-full overflow-auto hidden-scroll items-center justify-start gap-[8px] sm:gap-[10px] md:gap-[13px] lg:gap-[16px]">
|
||||
{listTitle.map((name, idx) => (
|
||||
<ItemTitle
|
||||
setActiveBtn={setActiveBtn}
|
||||
activeBtn={activeBtn}
|
||||
name={name}
|
||||
idx={idx}
|
||||
key={idx}
|
||||
/>
|
||||
))}
|
||||
</ul>
|
||||
)
|
||||
return (
|
||||
<ul className="flex w-full overflow-auto hidden-scroll items-center justify-start gap-[8px] sm:gap-[10px] md:gap-[13px] lg:gap-[16px]">
|
||||
{listTitle.map((name, idx) => (
|
||||
<ItemTitle
|
||||
setActiveBtn={setActiveBtn}
|
||||
activeBtn={activeBtn}
|
||||
name={name}
|
||||
idx={idx}
|
||||
key={idx}
|
||||
/>
|
||||
))}
|
||||
</ul>
|
||||
);
|
||||
}
|
||||
|
||||
export default Title
|
||||
export default Title;
|
||||
|
||||
Reference in New Issue
Block a user