parent
6091957a2f
commit
98dff089ac
6 changed files with 106 additions and 14 deletions
@ -0,0 +1,27 @@ |
||||
import React from "react"; |
||||
|
||||
interface Props { |
||||
name: string; |
||||
} |
||||
|
||||
const Tab: React.FC<Props> = ({ }) => { |
||||
|
||||
|
||||
|
||||
return( |
||||
<div className="w-2/12 min-h-10 bg-yellow-300 flex flex-row-reverse rounded-md"> |
||||
{/* sample tab */} |
||||
<div className='w-11/12 p-auto py-1/2'> |
||||
<p className="h-full text-right pr-4 pt-2">تب شماره 1</p> |
||||
</div> |
||||
<button key={1} className="relative top-0 left-2 rounded-full my-3"></button> |
||||
{/* <div className='w-2/12 h-full p-0 pl-1'> |
||||
<button className=""></button> |
||||
</div> */} |
||||
</div> |
||||
); |
||||
}; |
||||
|
||||
export default Tab; |
||||
|
||||
// ×
|
@ -1,15 +1,41 @@ |
||||
import React from 'react'; |
||||
import React, {useState} from 'react'; |
||||
import Tab from './Tab'; |
||||
|
||||
|
||||
interface Props { |
||||
name: string; |
||||
} |
||||
|
||||
const TabBar: React.FC<Props> = ({ }) => { |
||||
const TabBar: React.FC = () => { |
||||
|
||||
const [buttons, setButtons] = useState<number[]>([1]); |
||||
|
||||
const handleButtonClick = (index: number): void => { |
||||
const updatedButtons = buttons.filter((_, i) => i !== index); |
||||
setButtons(updatedButtons); |
||||
}; |
||||
return( |
||||
<h1>hello</h1> |
||||
<div className='fixed top-0 right-0 w-full min-h-20 bg-gray-500'> |
||||
{/* the URL and Tabs container */} |
||||
<div className="w-full min-h-10 flex flex-row-reverse"> |
||||
{/* tabs and search-tabs section */} |
||||
<div className="w-11 min-h-10 flex flex-row m-1"> |
||||
{/* the search-tabs section */} |
||||
<button className='h-full w-full mb-0 rounded-md'></button> |
||||
</div> |
||||
<div className="w-full min-h-10 bg-gray-500 flex flex-row-reverse border-box rounded-md mr-1"> |
||||
{/* the tabBars container */} |
||||
<Tab name='hello'/> |
||||
<button key={1} id='addTabBtn' className="block w-1 h-2/3 bg-black relative top-2 right-1 rounded-full z-2" onClick={ () => handleButtonClick(1)}></button> |
||||
{/* {buttons.map((button, index) => ( |
||||
<button key={index} onClick={() => handleButtonClick(index)}> |
||||
{button} |
||||
</button> */} |
||||
{/* ))} */} |
||||
</div> |
||||
</div> |
||||
<div className='fixed top-13 right-0 w-full min-h-10 bg-red-400'></div> |
||||
</div> |
||||
); |
||||
}; |
||||
} |
||||
|
||||
|
||||
|
||||
export default TabBar; |
Loading…
Reference in new issue