Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoDataPlaceholder component prop #149

Merged
merged 1 commit into from
Aug 27, 2024
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
4 changes: 3 additions & 1 deletion src/Components/NetworkTable/NetworkTable.styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
display: flex;
flex-direction: column;
align-items: center;
padding-top: $size-xxxl;
padding: $size-xxxl $size-l;
text-align: center;


.network-icon {
fill: $brand-primary-light-gray;
Expand Down
11 changes: 8 additions & 3 deletions src/Components/NetworkTable/NetworkTableBody.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const NetworkTableBody = ({ height }) => {
actions,
callbacks,
} = useNetwork();
const { enableAutoScroll } = useTheme();
const { enableAutoScroll, NoDataPlaceholder } = useTheme();
const numberOfNewEntries = state.get('numberOfNewEntries');
const data = state.get('data');
const actualData = state.get('actualData');
Expand Down Expand Up @@ -84,8 +84,13 @@ const NetworkTableBody = ({ height }) => {
className={Styles['no-data']}
>
<IconNetworkRequest className={Styles['network-icon']} />
<span className={Styles.header}>Recording network activity</span>
<span className={Styles.subtext}>Perform a request to see the network activity</span>
{NoDataPlaceholder && <NoDataPlaceholder />}
{!NoDataPlaceholder && (
<>
<span className={Styles.header}>Recording network activity</span>
<span className={Styles.subtext}>Perform a request to see the network activity</span>
</>
)}
</div>
);
}
Expand Down
1 change: 1 addition & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ export const SECTION_TITLES = Object.freeze({
export const MAX_COLOR_CONTENT_SIZE = 100000; // 100kB
export const TIMELINE_DATA_POINT_HEIGHT = 2;
export const NETWORK_VIEWER_DEFAULT_OPTIONS = {
NoDataPlaceholder: undefined,
enableAutoScroll: false,
showExportHar: false,
showImportHar: true,
Expand Down