Skip to content

Commit

Permalink
remove export from func getRandomInteger
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaypratap003 committed Jun 6, 2024
1 parent 6795a79 commit 1f492d1
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 72 deletions.
138 changes: 68 additions & 70 deletions packages/react-core/src/demos/DataList/examples/DataListPagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,75 +115,73 @@ export const DataListPagination: React.FunctionComponent = () => {
);

return (
<React.Fragment>
<DashboardWrapper mainContainerId="main-content-datalist-view-pagination" breadcrumb={null}>
<PageSection variant={PageSectionVariants.light}>
<TextContent>
<Text component="h1">Projects</Text>
<Text component="p">This is a demo that showcases PatternFly Data List</Text>
</TextContent>
</PageSection>
<PageSection isFilled>
<Toolbar id="toolbar-group-types">
<ToolbarContent>{toolbarItems}</ToolbarContent>
</Toolbar>
<DataList aria-label="Demo data list">
{paginatedRows.map((row, rowIndex) => {
const { name, threads, applications, workspaces, lastModified } = row;
return (
<DataListItem aria-labelledby={`Demo-item-${rowIndex}`} key={rowIndex}>
<DataListItemRow>
<DataListItemCells
dataListCells={[
<DataListCell isFilled={false} key="buttons1">
<Flex direction={{ default: 'column' }}>
<FlexItem>
<Text id={`Demo-item-${rowIndex}`} component={TextVariants.p}>
{name}
</Text>
</FlexItem>
<FlexItem>
<Text component={TextVariants.small}>
Working repo for
<a href="http://www.patternfly.org/">PatternFly</a>
</Text>
</FlexItem>
<FlexItem>
<Flex spaceItems={{ default: 'spaceItemsSm' }}>
<FlexItem>
<CodeBranchIcon /> {threads}
</FlexItem>
<FlexItem>
<CodeIcon /> {applications}
</FlexItem>
<FlexItem>
<CubeIcon /> {workspaces}
</FlexItem>
<FlexItem> Updated {lastModified}</FlexItem>
</Flex>
</FlexItem>
</Flex>
</DataListCell>,
<DataListCell isFilled={false} alignRight key="secondary content align">
<Flex>
<FlexItem>
<Button variant="secondary">Action</Button>
</FlexItem>
<FlexItem>
<a href="#">Link</a>
</FlexItem>
</Flex>
</DataListCell>
]}
/>
</DataListItemRow>
</DataListItem>
);
})}
</DataList>
{renderPagination('bottom-pagination', PaginationVariant.bottom, true, true)}
</PageSection>
</DashboardWrapper>
</React.Fragment>
<DashboardWrapper mainContainerId="main-content-datalist-view-pagination" breadcrumb={null}>
<PageSection variant={PageSectionVariants.light}>
<TextContent>
<Text component="h1">Projects</Text>
<Text component="p">This is a demo that showcases PatternFly Data List</Text>
</TextContent>
</PageSection>
<PageSection isFilled>
<Toolbar id="toolbar-group-types">
<ToolbarContent>{toolbarItems}</ToolbarContent>
</Toolbar>
<DataList aria-label="Demo data list">
{paginatedRows.map((row, rowIndex) => {
const { name, threads, applications, workspaces, lastModified } = row;
return (
<DataListItem aria-labelledby={`Demo-item-${rowIndex}`} key={rowIndex}>
<DataListItemRow>
<DataListItemCells
dataListCells={[
<DataListCell isFilled={false} key="buttons1">
<Flex direction={{ default: 'column' }}>
<FlexItem>
<Text id={`Demo-item-${rowIndex}`} component={TextVariants.p}>
{name}
</Text>
</FlexItem>
<FlexItem>
<Text component={TextVariants.small}>
Working repo for
<a href="http://www.patternfly.org/">PatternFly</a>
</Text>
</FlexItem>
<FlexItem>
<Flex spaceItems={{ default: 'spaceItemsSm' }}>
<FlexItem>
<CodeBranchIcon /> {threads}
</FlexItem>
<FlexItem>
<CodeIcon /> {applications}
</FlexItem>
<FlexItem>
<CubeIcon /> {workspaces}
</FlexItem>
<FlexItem> Updated {lastModified}</FlexItem>
</Flex>
</FlexItem>
</Flex>
</DataListCell>,
<DataListCell isFilled={false} alignRight key="secondary content align">
<Flex>
<FlexItem>
<Button variant="secondary">Action</Button>
</FlexItem>
<FlexItem>
<a href="#">Link</a>
</FlexItem>
</Flex>
</DataListCell>
]}
/>
</DataListItemRow>
</DataListItem>
);
})}
</DataList>
{renderPagination('bottom-pagination', PaginationVariant.bottom, true, true)}
</PageSection>
</DashboardWrapper>
);
};
2 changes: 1 addition & 1 deletion packages/react-core/src/demos/sampleData.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const getRandomInteger = (min: number, max: number) => Math.floor(Math.random() * (max - min + 1)) + min;
const getRandomInteger = (min: number, max: number) => Math.floor(Math.random() * (max - min + 1)) + min;

export interface SampleDataRow {
name: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/react-table/src/demos/sampleData.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const getRandomInteger = (min: number, max: number) => Math.floor(Math.random() * (max - min + 1)) + min;
const getRandomInteger = (min: number, max: number) => Math.floor(Math.random() * (max - min + 1)) + min;

export interface SampleDataRow {
name: string;
Expand Down

0 comments on commit 1f492d1

Please sign in to comment.