Skip to content

Commit

Permalink
feat: add example dir to infinite scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewgallo committed Nov 15, 2024
1 parent 112945a commit e4ce0ff
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 54 deletions.
11 changes: 11 additions & 0 deletions react/infiniteScroll/src/Example/Example.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Grid, Column } from '@carbon/react';
import { InfiniteScroll } from './InfiniteScroll';
import './example.scss';

export const Example = () => (
<Grid className="page-grid">
<Column sm={4} md={8} lg={16}>
<InfiniteScroll />
</Column>
</Grid>
);
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ const { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } =
DataTable;

import { fetchData, Resource, ResourceApiResponse } from './makeData';
import { ExampleLink } from './ExampleLink';
import { Launch } from '@carbon/react/icons';
import * as packageJson from '../package.json';

const fetchSize = 50;

Expand Down Expand Up @@ -148,22 +145,6 @@ export const InfiniteScroll = () => {
return (
<div className="virtual-example tanstack-example">
<h4>Virtualized infinite scroll</h4>
<span className="flex">
<ExampleLink
url={`${import.meta.env.VITE_CODE_SANDBOX_URL_ROOT}/${
packageJson.name
}`}
icon={Launch}
label="Code sandbox"
/>
<ExampleLink
url={`${import.meta.env.VITE_STACK_BLITZ_URL_ROOT}/${
packageJson.name
}`}
icon={Launch}
label="StackBlitz"
/>
</span>
{/* {process.env.NODE_ENV === 'development' ? (
<p className='virtual-description'>
<strong>Notice:</strong> You are currently running React in
Expand Down
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions react/infiniteScroll/src/Example/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Example } from './Example';
File renamed without changes.
9 changes: 0 additions & 9 deletions react/infiniteScroll/src/ExampleLink.tsx

This file was deleted.

13 changes: 0 additions & 13 deletions react/infiniteScroll/src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,8 @@
);
@use '@carbon/styles/scss/type';
@use '@carbon/ibm-products/css/index';
@use './App';

body {
margin: 0;
padding: 0;
}

.example--link {
@include type.type-style('label-01');

display: flex;
align-items: center;
margin-right: 0.5rem;
}

.example--link__icon {
margin-right: 0.25rem;
}
3 changes: 0 additions & 3 deletions react/infiniteScroll/src/index.ts

This file was deleted.

11 changes: 2 additions & 9 deletions react/infiniteScroll/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@ import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import {
CodeSnippet,
Column,
Grid,
Header,
HeaderContainer,
HeaderName,
} from '@carbon/react';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';

import { InfiniteScroll } from './InfiniteScroll';

import './index.scss';
import { Example } from './Example';
const queryClient = new QueryClient();

const renderUIShellHeader = () => (
Expand All @@ -35,11 +32,7 @@ createRoot(document.getElementById('root')!).render(
<QueryClientProvider client={queryClient}>
<StrictMode>
{renderUIShellHeader()}
<Grid className="page-grid">
<Column sm={4} md={8} lg={16}>
<InfiniteScroll />
</Column>
</Grid>
<Example />
</StrictMode>
</QueryClientProvider>
);
2 changes: 1 addition & 1 deletion react/infiniteScroll/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,

"types": [ "./src/customTypings.d.ts" ],
"types": ["./src/Example/customTypings.d.ts"],
"resolveJsonModule": true
},
"include": ["./src"]
Expand Down

0 comments on commit e4ce0ff

Please sign in to comment.