Skip to content

Commit

Permalink
feat: updated tab item UI
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxilll committed Apr 18, 2024
1 parent 552740f commit 5bb5b16
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 33 deletions.
84 changes: 60 additions & 24 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,25 +1,61 @@
.App {
color: black;
text-align: center;
}

.container {
width: 400px;
padding: 1rem;
background-color: white;
}

.tabs-list {
list-style-type: none;
padding: 0;
}

.tab-item {
margin-bottom: 1rem;
padding: 0.5rem;
border: 1px solid #ccc;
}

.tab-item button {
margin-left: 0.5rem;
}
color: black;
text-align: center;
}

.container {
width: 400px;
padding: 1rem;
background-color: white;
}

.tabs-list {
list-style-type: none;
padding: 0;
}

.tab-item {
list-style: none;
margin-bottom: 1rem;
padding: 1rem;
border: none;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
border-radius: 8px;
background-color: #f9f9f9;
display: flex;
justify-content: space-between;
align-items: center;
}

.tab-item span {
font-weight: bold;
color: #333;
cursor: pointer;
}

.tab-item div {
color: #666;
font-size: 0.9rem;
margin-top: 0.5rem;
}

.tab-item button {
padding: 0.5rem 1rem;
border: none;
background-color: #d32020;
color: white;
text-transform: uppercase;
font-weight: bold;
border-radius: 4px;
cursor: pointer;
outline: none;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.tab-item button:hover {
background-color: #0056b3;
}

.tab-item button:active {
background-color: #004085;
}
16 changes: 7 additions & 9 deletions src/components/TabsItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,13 @@ export const TabsItem: React.FC<TabsItemProps> = ({ tab, onDelete }) => {

return (
<li className="tab-item">
{
<div>
<span onClick={handleUrlClick} style={{ textDecoration: 'underline', color: 'blue', cursor: 'pointer' }}>
{title}
</span>
<div>{timestamp}</div>
<button onClick={() => onDelete(tab.tabId)}>Delete</button>
</div>
}
<div>
<span onClick={handleUrlClick} className="tab-title">
{title}
</span>
<div className="tab-timestamp">{timestamp}</div>
</div>
<button onClick={() => onDelete(tab.tabId)}>Delete</button>
</li>
);
};

0 comments on commit 5bb5b16

Please sign in to comment.