remove trailing slashes from URLs in frontend code
This commit is contained in:
@@ -6,7 +6,7 @@ import { classnames } from '../../utils';
|
||||
import { HOST } from '../../constants';
|
||||
|
||||
export const Image = ({ imageSrc, compact, extraClasses = '' }) => {
|
||||
const fullImageSrc = `https://${HOST}/api/${imageSrc}&client=wizard`;
|
||||
const fullImageSrc = `https://${HOST}/api${imageSrc}&client=wizard`;
|
||||
|
||||
return (
|
||||
<div className={`${extraClasses} relative w-full relative`}>
|
||||
|
||||
@@ -27,13 +27,13 @@ const DemoScreen = () => {
|
||||
|
||||
const firstCardUrl =
|
||||
selectedUserName.length > 0
|
||||
? `https://${HOST}/api/?username=${selectedUserName}&client=demo`
|
||||
: `https://${HOST}/api/?username=anuraghazra&client=demo`;
|
||||
? `https://${HOST}/api?username=${selectedUserName}&client=demo`
|
||||
: `https://${HOST}/api?username=anuraghazra&client=demo`;
|
||||
|
||||
const secondCardUrl =
|
||||
selectedUserName.length > 0
|
||||
? `https://${HOST}/api/top-langs/?username=${selectedUserName}&client=demo`
|
||||
: `https://${HOST}/api/top-langs/?username=anuraghazra&client=demo`;
|
||||
? `https://${HOST}/api/top-langs?username=${selectedUserName}&client=demo`
|
||||
: `https://${HOST}/api/top-langs?username=anuraghazra&client=demo`;
|
||||
|
||||
return (
|
||||
<div className="h-full py-8 flex flex-col xl:flex-row justify-center items-center">
|
||||
|
||||
@@ -29,7 +29,7 @@ const DisplayStage = ({ userId, themeSuffix }) => {
|
||||
|
||||
const copyUrl = () => {
|
||||
navigator.clipboard.writeText(
|
||||
`https://${HOST}/api/${themeSuffix}&username=${userId}`,
|
||||
`https://${HOST}/api${themeSuffix}&username=${userId}`,
|
||||
);
|
||||
toast.info('Copied to Clipboard!', {
|
||||
position: 'bottom-right',
|
||||
|
||||
@@ -20,27 +20,27 @@ const SelectCardStage = ({ selectedCard, setSelectedCard, setImageSrc }) => {
|
||||
{
|
||||
title: 'Top Languages Card',
|
||||
description: 'your most frequently used languages',
|
||||
imageSrc: `top-langs/?&username=${userId}&langs_count=4`,
|
||||
imageSrc: `/top-langs?&username=${userId}&langs_count=4`,
|
||||
cardType: 'top-langs',
|
||||
},
|
||||
{
|
||||
title: 'GitHub Extra Pins',
|
||||
description:
|
||||
'pin more than 6 repositories in your profile using a GitHub profile readme',
|
||||
imageSrc: 'pin/?repo=anuraghazra/github-readme-stats',
|
||||
imageSrc: '/pin?repo=anuraghazra/github-readme-stats',
|
||||
cardType: 'pin',
|
||||
},
|
||||
{
|
||||
title: 'GitHub Gist Pins',
|
||||
description:
|
||||
'pin gists in your GitHub profile using a GitHub profile readme',
|
||||
imageSrc: 'gist/?id=bbfce31e0217a3689c8d961a356cb10d',
|
||||
imageSrc: '/gist?id=bbfce31e0217a3689c8d961a356cb10d',
|
||||
cardType: 'gist',
|
||||
},
|
||||
{
|
||||
title: 'WakaTime Stats Card',
|
||||
description: 'your coding activity from WakaTime',
|
||||
imageSrc: 'wakatime/?username=ffflabs&langs_count=6&card_width=450',
|
||||
imageSrc: '/wakatime?username=ffflabs&langs_count=6&card_width=450',
|
||||
cardType: 'wakatime',
|
||||
},
|
||||
].map((card, index) => (
|
||||
|
||||
Reference in New Issue
Block a user