Skip to content

Commit cdde4e2

Browse files
add activeTab query param to select tabs
1 parent 94eaaa5 commit cdde4e2

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

src/components/BlogTabs/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ function BlogTabs({ data, columns }) {
6161
setIndex(activeBlogTab);
6262
setPlatform(true);
6363
}
64+
const queryParams = new URLSearchParams(window.location.search);
65+
const tab = queryParams.get('activeTab');
66+
if (tab) setIndex(+tab);
6467
}, [platformData, openSourceData, activeBlogTab]);
6568

6669
const platforms = {

src/pages/hackshack/workshops/template.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ const Workshop = (props) => {
9191
};
9292
getToken();
9393
// eslint-disable-next-line
94+
const queryParams = new URLSearchParams(window.location.search);
95+
const tab = queryParams.get('activeTab');
96+
if (tab) setIndex(+tab);
9497
}, []);
9598

9699
const { title, description, badgeImg } = props.pageContext;

src/pages/tags/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export const pageQuery = graphql`
8989
limit: 2000
9090
filter: { frontmatter: { disable: { ne: true } } }
9191
) {
92-
group(field: {frontmatter: {tags: SELECT}}) {
92+
group(field: { frontmatter: { tags: SELECT } }) {
9393
fieldValue
9494
totalCount
9595
}

0 commit comments

Comments
 (0)