-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d8cdcae
commit d5612a2
Showing
5 changed files
with
82 additions
and
12 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
src/library-authoring/component-info/ComponentDeveloperInfo.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,33 @@ | ||
/* istanbul ignore file */ | ||
/* eslint-disable import/prefer-default-export */ | ||
// This file doesn't need test coverage nor i18n because it's only seen by devs | ||
import React from 'react'; | ||
import { LoadingSpinner } from '../../generic/Loading'; | ||
import { useXBlockOLX } from '../data/apiHooks'; | ||
|
||
interface Props { | ||
usageKey: string; | ||
} | ||
|
||
export const ComponentDeveloperInfo: React.FC<Props> = ({ usageKey }) => { | ||
const { data: olx, isLoading: isOLXLoading } = useXBlockOLX(usageKey); | ||
return ( | ||
<> | ||
<hr /> | ||
<h3 className="h5">Developer Component Details</h3> | ||
<p><small>(This panel is only visible in development builds.)</small></p> | ||
<dl> | ||
<dt>Usage key</dt> | ||
<dd><code>{usageKey}</code></dd> | ||
<dt>OLX</dt> | ||
<dd> | ||
{ | ||
olx ? <code className="micro">{olx}</code> : // eslint-disable-line | ||
isOLXLoading ? <LoadingSpinner /> : // eslint-disable-line | ||
<span>Error</span> | ||
} | ||
</dd> | ||
</dl> | ||
</> | ||
); | ||
}; |
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
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
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
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