Skip to content

Commit

Permalink
πŸ’„ Hide disabled query strings
Browse files Browse the repository at this point in the history
  • Loading branch information
wei committed Oct 19, 2020
1 parent a03834f commit 7be9887
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ You can download the image as a `.png`, `.jpeg` or `.webp` and use it anywhere i
<img width="410" alt="Session Bot Example" src="https://socialify.git.ci/MLH-Fellowship/event-bot/image?description=1&font=Bitter&forks=0&issues=0&language=1&logo=https%3A%2F%2Fgist.githack.com%2Fwei%2F13e3f6e161cb1d0709abd847102dc80c%2Fraw%2Fmlh-color-square.svg&owner=0&pattern=Circuit%20Board&pulls=0&stargazers=0&theme=Light" />
</a>

<a href="https://socialify.git.ci/MLH-Fellowship/class-photo?font=Inter&language=0&logo=https%3A%2F%2Favatars0.githubusercontent.com%2Fu%2F65834464%3Fs%3D200%26v%3D4&owner=1&pattern=Diagonal%20Stripes&stargazers=0&theme=Dark">
<img width="410" alt="Class Photo Example" src="https://socialify.git.ci/MLH-Fellowship/class-photo/image?font=Inter&language=0&logo=https%3A%2F%2Favatars0.githubusercontent.com%2Fu%2F65834464%3Fs%3D200%26v%3D4&owner=1&pattern=Diagonal%20Stripes&stargazers=0&theme=Dark" />
<a href="https://socialify.git.ci/MLH-Fellowship/class-photo?font=Inter&logo=https%3A%2F%2Favatars0.githubusercontent.com%2Fu%2F65834464%3Fs%3D200%26v%3D4&owner=1&pattern=Diagonal%20Stripes&stargazers=0&theme=Dark">
<img width="410" alt="Class Photo Example" src="https://socialify.git.ci/MLH-Fellowship/class-photo/image?font=Inter&logo=https%3A%2F%2Favatars0.githubusercontent.com%2Fu%2F65834464%3Fs%3D200%26v%3D4&owner=1&pattern=Diagonal%20Stripes&stargazers=0&theme=Dark" />
</a>

<a href="https://socialify.git.ci/modfy/modfy.video?description=1&forks=1&issues=1&language=1&logo=https%3A%2F%2Fmodfy.video%2Fimages%2Flogo.png&owner=1&pattern=Plus&pulls=1&stargazers=1&theme=Dark">
<img width="410" alt="Modfy Example" src="https://socialify.git.ci/modfy/modfy.video/image?description=1&forks=1&issues=1&language=1&logo=https%3A%2F%2Fmodfy.video%2Fimages%2Flogo.png&owner=1&pattern=Plus&pulls=1&stargazers=1&theme=Dark" />
</a>

<a href="https://socialify.git.ci/wei/pull?description=1&font=Source%20Code%20Pro&forks=1&issues=0&language=1&logo=https%3A%2F%2Fgist.githack.com%2Fwei%2F40d98877c6ac5f917d78ccfe72a0f928%2Fraw%2Fpull-18h.svg&pattern=Floating%20Cogs&stargazers=1&theme=Light">
<img width="410" alt="Pull Example" src="https://socialify.git.ci/wei/pull/image?description=1&font=Source%20Code%20Pro&forks=1&issues=0&language=1&logo=https%3A%2F%2Fgist.githack.com%2Fwei%2F40d98877c6ac5f917d78ccfe72a0f928%2Fraw%2Fpull-18h.svg&pattern=Floating%20Cogs&stargazers=1&theme=Light" />
<a href="https://socialify.git.ci/wei/pull?description=1&font=Source%20Code%20Pro&forks=1&language=1&logo=https%3A%2F%2Fgist.githack.com%2Fwei%2F40d98877c6ac5f917d78ccfe72a0f928%2Fraw%2Fpull-18h.svg&pattern=Floating%20Cogs&stargazers=1&owner=1&theme=Light">
<img width="410" alt="Pull Example" src="https://socialify.git.ci/wei/pull/image?description=1&font=Source%20Code%20Pro&forks=1&language=1&logo=https%3A%2F%2Fgist.githack.com%2Fwei%2F40d98877c6ac5f917d78ccfe72a0f928%2Fraw%2Fpull-18h.svg&pattern=Floating%20Cogs&stargazers=1&owner=1&theme=Light" />
</a>

<a href="https://socialify.git.ci/traefik/traefik?description=1&font=Rokkitt&forks=1&issues=0&language=0&logo=https%3A%2F%2Fpbs.twimg.com%2Fmedia%2FCcZdW37UcAA9DZz%3Fformat%3Dpng%26name%3Dsmall&owner=0&pattern=Signal&pulls=1&stargazers=1&theme=Light">
<img width="410" alt="Traefik Example" src="https://socialify.git.ci/traefik/traefik/image?description=1&font=Rokkitt&forks=1&issues=0&language=0&logo=https%3A%2F%2Fpbs.twimg.com%2Fmedia%2FCcZdW37UcAA9DZz%3Fformat%3Dpng%26name%3Dsmall&owner=0&pattern=Signal&pulls=1&stargazers=1&theme=Light" />
<a href="https://socialify.git.ci/traefik/traefik?description=1&font=Rokkitt&forks=1&logo=https%3A%2F%2Fpbs.twimg.com%2Fmedia%2FCcZdW37UcAA9DZz%3Fformat%3Dpng%26name%3Dsmall&owner=0&pattern=Signal&pulls=1&stargazers=1&owner=1&theme=Light">
<img width="410" alt="Traefik Example" src="https://socialify.git.ci/traefik/traefik/image?description=1&font=Rokkitt&forks=1&logo=https%3A%2F%2Fpbs.twimg.com%2Fmedia%2FCcZdW37UcAA9DZz%3Fformat%3Dpng%26name%3Dsmall&owner=0&pattern=Signal&pulls=1&stargazers=1&owner=1&theme=Light" />
</a>

<a href="https://socialify.git.ci/facebook/react?description=1&font=Bitter&language=0&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0xMS41IC0xMC4yMzE3NCAyMyAyMC40NjM0OCI%2BCiAgPHRpdGxlPlJlYWN0IExvZ288L3RpdGxlPgogIDxjaXJjbGUgY3g9IjAiIGN5PSIwIiByPSIyLjA1IiBmaWxsPSIjNjFkYWZiIi8%2BCiAgPGcgc3Ryb2tlPSIjNjFkYWZiIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiPgogICAgPGVsbGlwc2Ugcng9IjExIiByeT0iNC4yIi8%2BCiAgICA8ZWxsaXBzZSByeD0iMTEiIHJ5PSI0LjIiIHRyYW5zZm9ybT0icm90YXRlKDYwKSIvPgogICAgPGVsbGlwc2Ugcng9IjExIiByeT0iNC4yIiB0cmFuc2Zvcm09InJvdGF0ZSgxMjApIi8%2BCiAgPC9nPgo8L3N2Zz4K&owner=0&pattern=Formal%20Invitation&pulls=1&stargazers=1&theme=Dark">
Expand Down Expand Up @@ -81,5 +81,5 @@ Please subscribe to [#47](https://github.com/wei/socialify/issues/47) if you wou

Consider downloading the images or self-hosting should this be a problem.

[socialify-image]: https://socialify.git.ci/wei/socialify/image?description=1&font=Raleway&issues=1&language=1&logo=https%3A%2F%2Fgist.githack.com%2Fwei%2F13e3f6e161cb1d0709abd847102dc80c%2Fraw%2Fmlh-white-square.svg&owner=0&pattern=Charlie%20Brown&pulls=1&stargazers=1&theme=Dark
[socialify-edit-link]: https://socialify.git.ci/wei/socialify?description=1&font=Raleway&issues=1&language=1&logo=https%3A%2F%2Fgist.githack.com%2Fwei%2F13e3f6e161cb1d0709abd847102dc80c%2Fraw%2Fmlh-white-square.svg&owner=0&pattern=Charlie%20Brown&pulls=1&stargazers=1&theme=Dark
[socialify-image]: https://socialify.git.ci/wei/socialify/image?description=1&font=Raleway&issues=1&language=1&pattern=Charlie%20Brown&pulls=1&stargazers=1&theme=Light
[socialify-edit-link]: https://socialify.git.ci/wei/socialify?description=1&font=Raleway&issues=1&language=1&pattern=Charlie%20Brown&pulls=1&stargazers=1&theme=Light
4 changes: 2 additions & 2 deletions common/configHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ const getOptionalConfig = (repository: repoQueryResponse['repository']) => {
const language =
languages.length > 0 ? languages[0]?.name || 'unknown' : 'unknown'
const newConfig: OptionalConfigs = {
owner: { state: true, value: repository.owner.login },
owner: { state: false, value: repository.owner.login },
description: {
state: false,
editable: true,
value: repository.description || ''
},
language: { state: true, value: language },
language: { state: false, value: language },
stargazers: { state: false, value: repository.stargazerCount },
forks: { state: false, value: repository.forkCount },
pulls: { state: false, value: repository.pullRequests.totalCount },
Expand Down
4 changes: 4 additions & 0 deletions src/components/configuration/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ const Config = ({ repository }: ConfigProp) => {
} else {
urlParams[key] = '0'
}

if (!urlParams[key] || urlParams[key] === '0') {
delete urlParams[key]
}
})

router.push(
Expand Down
2 changes: 1 addition & 1 deletion src/components/repo/repo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Repo: React.FC = () => {
)
if (repoMatches) {
router.push(
`/${repoMatches[2]}/${repoMatches[3]}?stargazers=1&theme=Light`
`/${repoMatches[2]}/${repoMatches[3]}?language=1&owner=1&stargazers=1&theme=Light`
)
} else {
notification.error({
Expand Down

1 comment on commit 7be9887

@vercel
Copy link

@vercel vercel bot commented on 7be9887 Oct 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

Please # to comment.