-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: move slack channel to top of table description (#1446)
* fix: move slack channel to top of table description * fix: move slack channel to top of table description * address comments * use pinnedCustomProperties to order properties * use pinnedCustomProperties to order properties
- Loading branch information
Showing
2 changed files
with
63 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
querybook/webapp/ui/KeyContentDisplay/KeyContentDisplayLink.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import * as React from 'react'; | ||
|
||
import { isValidUrl, titleize } from 'lib/utils'; | ||
import { Link } from 'ui/Link/Link'; | ||
|
||
import { KeyContentDisplay } from './KeyContentDisplay'; | ||
|
||
export const KeyContentDisplayLink: React.FunctionComponent<{ | ||
keyString: string; | ||
value: string | number; | ||
}> = ({ keyString, value }) => { | ||
const valueStr = value?.toString() ?? ''; | ||
return ( | ||
<KeyContentDisplay | ||
key={keyString} | ||
keyString={titleize(keyString, '_', ' ')} | ||
> | ||
{valueStr && isValidUrl(valueStr.trim()) ? ( | ||
<Link to={valueStr} newTab> | ||
{valueStr} | ||
</Link> | ||
) : ( | ||
valueStr | ||
)} | ||
</KeyContentDisplay> | ||
); | ||
}; |