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
6 changes: 3 additions & 3 deletions config/tailwind/buttons.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ module.exports = plugin(({ addComponents }) => {
// Variants
'.btn': {
...base,
'@apply bg-blue-500 text-white enabled:hover:bg-blue-600 enabled:active:bg-blue-700 aria-expanded:bg-blue-700':
'@apply bg-blue-500 text-white hover:bg-blue-600 active:bg-blue-700 aria-expanded:bg-blue-700':
{},
},
'.btn-outline': {
...base,
'@apply bg-transparent text-gray-600 border border-gray-600 enabled:hover:bg-black/5 enabled:active:bg-black/10 aria-expanded:bg-black/10':
'@apply bg-transparent text-gray-600 border border-gray-600 hover:bg-black/5 active:bg-black/10 aria-expanded:bg-black/10':
{},
},
'.btn-subtle': {
...base,
'@apply bg-transparent text-gray-600 enabled:hover:bg-black/5 enabled:active:bg-black/10 aria-expanded:bg-black/10 dark:text-gray-300 dark:active:text-white dark:enabled:active:bg-black/30 dark:enabled:hover:bg-black/20 dark:aria-expanded:bg-black/30 dark:aria-expanded:text-white':
'@apply bg-transparent text-gray-600 hover:bg-black/5 active:bg-black/10 aria-expanded:bg-black/10 dark:text-gray-300 dark:active:text-white dark:active:bg-black/30 dark:hover:bg-black/20 dark:aria-expanded:bg-black/30 dark:aria-expanded:text-white':
{},
},

Expand Down
1 change: 1 addition & 0 deletions src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export function App(props: AppProps) {
<UtilityBar
isDoc={activeNavItem?.doc ?? false}
showSettings={!hasConfigUrl}
partUrl={activeNavItem?.url ?? null}
/>

<div className="flex flex-grow items-stretch justify-center">
Expand Down
28 changes: 28 additions & 0 deletions src/features/utility-bar/DirectLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Link1Icon } from '@radix-ui/react-icons'

interface DirectLinkProps {
url?: string
}

export function DirectLink({
url,
}: DirectLinkProps) {
if (!url) {
return null
}

// TODO eventually refactor to use a button component
return (
<a
className="btn-subtle btn-icon"
href={url}
target="_blank"
rel="noreferrer noopener"
title="Open direct link"
>
<Link1Icon />
</a>
)
}


5 changes: 5 additions & 0 deletions src/features/utility-bar/UtilityBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ import ToggleFullscreen from './ToggleFullscreen'
import ToggleTheme from './ToggleTheme'
import ToggleViewportDropdown from './ToggleViewportDropdown'
import ToggleSettingsDialog from './ToggleSettingsDialog'
import { DirectLink } from './DirectLink'

interface UtilityBarProps {
showSettings: boolean
isDoc: boolean
partUrl?: string|null
}

export default function (props: UtilityBarProps) {
Expand Down Expand Up @@ -36,6 +38,9 @@ export default function (props: UtilityBarProps) {
{/* Settings Control */}
{props.showSettings && <ToggleSettingsDialog />}

{/* Direct Link */}
{props.partUrl && <DirectLink url={props.partUrl} />}

{/* Fullscreen control */}
<ToggleFullscreen />
</div>
Expand Down
Loading