Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/extension/react/components/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ function Panel() {
<div className="font-medium dark:text-charcoal-100">Devtron</div>
<div className="flex gap-2">
<CircularButton
tooltip="Switch between Light and Dark theme"
onClick={() => {
setTheme(theme === 'light' ? 'dark' : 'light');
}}
Expand All @@ -230,6 +231,7 @@ function Panel() {
)}
</CircularButton>
<CircularButton
tooltip="Toggle Detail Panel position (right/bottom)"
onClick={() => {
setDetailPanelPosition(detailPanelPosition === 'right' ? 'bottom' : 'right');
}}
Expand All @@ -242,6 +244,11 @@ function Panel() {
</CircularButton>

<CircularButton
tooltip={
lockToBottom
? 'Turn Auto Scrolling Off'
: 'Turn Auto Scrolling On (Auto Scroll to newly added events)'
}
active={lockToBottom}
onClick={() => {
setLockToBottom(!lockToBottom);
Expand All @@ -255,7 +262,7 @@ function Panel() {
)}
</CircularButton>

<CircularButton onClick={clearEvents}>
<CircularButton tooltip="Clear all events" onClick={clearEvents}>
<Ban strokeWidth={3} size={15} />
</CircularButton>
</div>
Expand Down
33 changes: 19 additions & 14 deletions src/extension/react/ui/CircularButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,26 @@ type Props = {
active?: boolean;
};

function CircularButton({ children, onClick, disabled = false, active = false }: Props) {
function CircularButton({
children,
onClick,
tooltip = '',
disabled = false,
active = false,
}: Props) {
return (
<div>
<button
disabled={disabled}
className={`${active ? 'text-blue-500' : 'text-charcoal-200'} rounded-full p-1 ${
disabled
? 'cursor-not-allowed opacity-50'
: 'cursor-pointer hover:bg-gray-300 hover:dark:bg-charcoal-300'
}`}
onClick={() => onClick()}
>
{children}
</button>
</div>
<button
title={tooltip}
disabled={disabled}
className={`${active ? 'text-blue-500' : 'text-charcoal-200'} rounded-full p-1 ${
disabled
? 'cursor-not-allowed opacity-50'
: 'cursor-pointer hover:bg-gray-300 hover:dark:bg-charcoal-300'
}`}
onClick={() => onClick()}
>
{children}
</button>
);
}

Expand Down