Skip to content

Commit

Permalink
info icon for version description
Browse files Browse the repository at this point in the history
  • Loading branch information
goodeats committed May 8, 2024
1 parent 800404b commit 0a3685d
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/components/templates/navbar/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './combobox'
export * from './tooltip-icon'
30 changes: 30 additions & 0 deletions app/components/templates/navbar/tooltip-icon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { Icon, type IconName } from '#app/components/ui/icon'
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from '#app/components/ui/tooltip'

export const TooltipIcon = ({
icon,
text,
tooltipText,
}: {
icon: IconName
text: string
tooltipText: string
}) => {
return (
<TooltipProvider>
<Tooltip>
<TooltipTrigger>
<Icon name={icon} className="scale-125 max-md:scale-150">
<span className="sr-only">{text}</span>
</Icon>
</TooltipTrigger>
<TooltipContent>{tooltipText}</TooltipContent>
</Tooltip>
</TooltipProvider>
)
}
1 change: 1 addition & 0 deletions app/components/ui/icons/name.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export type IconName =
| 'gear'
| 'github-logo'
| 'height'
| 'info-circled'
| 'instagram-logo'
| 'laptop'
| 'layers'
Expand Down
7 changes: 7 additions & 0 deletions app/components/ui/icons/sprite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
} from '#app/components/layout'
import { ComboboxNav } from '#app/components/templates/combobox'
import { IconLink } from '#app/components/templates/link'
import { TooltipIcon } from '#app/components/templates/navbar'
import { NewArtboardVersionSchema } from '#app/schema/artboard-version'
import { EntityParentIdType } from '#app/schema/entity'
import { useRouteLoaderMatchData } from '#app/utils/matches'
Expand Down Expand Up @@ -58,6 +59,11 @@ export const ArtboardHeader = () => {
slugParam="versionSlug"
baseUrl={`${baseUrl}/${artboard.slug}/${branch.slug}`}
/>
<TooltipIcon
icon="info-circled"
text="Info"
tooltipText={version.description}
/>
{!onLatestVersion && (
// this should be displayed when:
// - creating a new artboard version
Expand Down
13 changes: 13 additions & 0 deletions other/svg-icons/info-circled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0a3685d

Please sign in to comment.