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

add pagination component #404

Merged
merged 1 commit into from
Jan 24, 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
5 changes: 5 additions & 0 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,7 @@ The 'Quality' type represents quality as whole numeric values between `1` and `1
scalar Quality

type Query {
_node(id: ID!, locale: String, preview: Boolean): _Node
asset(id: String!, locale: String, preview: Boolean): Asset
assetCollection(limit: Int = 100, locale: String, order: [AssetOrder], preview: Boolean, skip: Int = 0, where: AssetFilter): AssetCollection
codeStandard(id: String!, locale: String, preview: Boolean): CodeStandard
Expand Down Expand Up @@ -1301,6 +1302,10 @@ input SysFilter {
publishedVersion_not_in: [Float]
}

interface _Node {
_id: ID!
}

input cfComponentModifierNestedFilter {
AND: [cfComponentModifierNestedFilter]
OR: [cfComponentModifierNestedFilter]
Expand Down
4 changes: 4 additions & 0 deletions src/pages/components/Components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ const Components = (): JSX.Element => {
}
]
},
{
text: 'Pagination',
to: basePath + '/pagination'
},
{
text: 'Ribbon',
to: basePath + '/ribbon'
Expand Down
7 changes: 6 additions & 1 deletion src/pages/components/variants/Preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ const Preview = (props: Props): JSX.Element => {
DefaultNavTertiary: lazy(() => import('./navTertiary/DefaultNavTertiary')),
InputTextController: lazy(() => import('./inputText/_InputTextController')),
TextareaController: lazy(() => import('./textarea/_TextareaController')),
SelectController: lazy(() => import('./select/_SelectController'))
SelectController: lazy(() => import('./select/_SelectController')),
PaginationController: lazy(() => import('./pagination/DefaultPagination'))
};

if (props.shouldLinkToExamples) {
Expand Down Expand Up @@ -172,6 +173,10 @@ const Preview = (props: Props): JSX.Element => {
setRenderedComponent(<ComponentControllers.ModalController variantId={variantId} />);
break;

case 'pagination':
setRenderedComponent(<ComponentControllers.PaginationController />);
break;

case 'primary-navigation':
setRenderedComponent(<ComponentControllers.NavPrimaryController variantId={variantId} />);
break;
Expand Down
12 changes: 12 additions & 0 deletions src/pages/components/variants/pagination/DefaultPagination.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Pagination } from '@boston-scientific/anatomy-react';
import Example from 'shared/components/Example';

const DefaultPagination = () => {
return (
<Example>
<Pagination numberOfPages={10} />
</Example>
);
};

export default DefaultPagination;
12 changes: 12 additions & 0 deletions src/shared/types/contentful.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1668,6 +1668,7 @@ export enum PagePropertiesOrder {

export type Query = {
__typename?: 'Query';
_node?: Maybe<_Node>;
asset?: Maybe<Asset>;
assetCollection?: Maybe<AssetCollection>;
codeStandard?: Maybe<CodeStandard>;
Expand All @@ -1692,6 +1693,13 @@ export type Query = {
};


export type Query_NodeArgs = {
id: Scalars['ID'];
locale?: InputMaybe<Scalars['String']>;
preview?: InputMaybe<Scalars['Boolean']>;
};


export type QueryAssetArgs = {
id: Scalars['String'];
locale?: InputMaybe<Scalars['String']>;
Expand Down Expand Up @@ -2042,6 +2050,10 @@ export type SysFilter = {
publishedVersion_not_in?: InputMaybe<Array<InputMaybe<Scalars['Float']>>>;
};

export type _Node = {
_id: Scalars['ID'];
};

export type CfComponentModifierNestedFilter = {
AND?: InputMaybe<Array<InputMaybe<CfComponentModifierNestedFilter>>>;
OR?: InputMaybe<Array<InputMaybe<CfComponentModifierNestedFilter>>>;
Expand Down