Skip to content

Commit

Permalink
Merge pull request #36 from patternfly/readme-update
Browse files Browse the repository at this point in the history
update readme
  • Loading branch information
jschuler authored Sep 3, 2021
2 parents 2f31514 + 1105b82 commit 4e82c76
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"serve": "serve public"
},
"dependencies": {
"@patternfly/quickstarts": "1.2.0",
"@patternfly/quickstarts": "1.2.1",
"@patternfly/react-core": "^4.135.0",
"asciidoctor": "^2.2.1",
"i18next": "^19.8.3",
Expand Down
18 changes: 14 additions & 4 deletions packages/module/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,15 @@ import "@patternfly/quickstarts/dist/quickstarts.min.css";

import * as React from "react";
import {
QuickStartDrawer,
QuickStartContext,
QuickStartContextProvider,
QuickStartContainer,
QuickStartCatalogPage,
useLocalStorage
QuickStartContext,
useLocalStorage,
setQueryArgument,
removeQueryArgument,
QUICKSTART_ID_FILTER_KEY
} from "@patternfly/quickstarts";
import { Button } from "@patternfly/react-core";
import jsYaml from "js-yaml";
// quick start files could be yaml files or js files, or really anything,
// as long as they get parsed out to the expexted JSON format
Expand Down Expand Up @@ -82,6 +85,8 @@ const App = () => {
}, 1500);
}, []);

const withQueryParams = true;

const drawerProps = {
quickStarts,
activeQuickStartID,
Expand All @@ -90,15 +95,20 @@ const App = () => {
setAllQuickStartStates,
showCardFooters: false,
loading,
useQueryParams: withQueryParams,
};

const toggleQuickStart = (quickStartId: string) => {
if (activeQuickStartID !== quickStartId) {
// activate
setActiveQuickStartID(quickStartId);
// optionally add the browser URL query param
withQueryParams && setQueryArgument(QUICKSTART_ID_FILTER_KEY, quickStartId);
} else {
// deactivate
setActiveQuickStartID('');
// optionally remove the browser URL query param
withQueryParams && removeQueryArgument(QUICKSTART_ID_FILTER_KEY);
}
};

Expand Down
2 changes: 1 addition & 1 deletion packages/module/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@patternfly/quickstarts",
"version": "1.2.0",
"version": "1.2.1",
"description": "PatternFly quick starts",
"files": [
"dist"
Expand Down

0 comments on commit 4e82c76

Please sign in to comment.